From: Mikko Rasa Date: Sun, 29 Aug 2021 08:59:32 +0000 (+0300) Subject: Remove unnecessary std:: qualifiers X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=20c897ece781e18ba54c41fd68e232ce566a938d;p=libs%2Fcore.git Remove unnecessary std:: qualifiers --- diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index 9040f5d..0f8886a 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -315,7 +315,7 @@ string GetOpt::generate_help() const } -GetOpt::OptionImpl::OptionImpl(char s, const std::string &l, const Store &t, ArgType a): +GetOpt::OptionImpl::OptionImpl(char s, const string &l, const Store &t, ArgType a): shrt(s), lng(l), arg_type(a), diff --git a/source/debug/exceptiontrace.cpp b/source/debug/exceptiontrace.cpp index 30df4b6..fb72223 100644 --- a/source/debug/exceptiontrace.cpp +++ b/source/debug/exceptiontrace.cpp @@ -61,11 +61,11 @@ const Backtrace &get_exception_trace() } // namespace Msp #if defined(WITH_EXCEPTION_TRACE) && !defined(_WIN32) && defined(__GLIBC__) -extern "C" void __cxa_throw(void *exc, std::type_info *type, void (*dest) (void *)) +extern "C" void __cxa_throw(void *exc, type_info *type, void (*dest) (void *)) { if(trace_enabled) get_thread_backtrace() = Msp::Debug::Backtrace::create(); orig_cxa_throw(exc, type, dest); - std::terminate(); + terminate(); } #endif diff --git a/source/debug/profiler.cpp b/source/debug/profiler.cpp index c33aebf..c4c880b 100644 --- a/source/debug/profiler.cpp +++ b/source/debug/profiler.cpp @@ -30,7 +30,7 @@ void Profiler::set_period(unsigned p) } } -void Profiler::add_scope(const std::string &name) +void Profiler::add_scope(const string &name) { if(!scopes.count(name)) { diff --git a/source/fs/path.cpp b/source/fs/path.cpp index bd107f1..353c63e 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -8,7 +8,7 @@ using namespace std; namespace { #ifdef _WIN32 -inline bool is_windows_drive(const std::string &p) +inline bool is_windows_drive(const string &p) { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); } #endif diff --git a/source/fs/stat.cpp b/source/fs/stat.cpp index f4566ae..2269ae1 100644 --- a/source/fs/stat.cpp +++ b/source/fs/stat.cpp @@ -50,14 +50,14 @@ Stat::~Stat() delete priv; } -const std::string &Stat::get_owner() const +const string &Stat::get_owner() const { if(priv && owner_info.owner.empty()) priv->fill_owner_info(owner_info); return owner_info.owner; } -const std::string &Stat::get_group() const +const string &Stat::get_group() const { if(priv && owner_info.group.empty()) priv->fill_owner_info(owner_info); diff --git a/source/io/buffered.cpp b/source/io/buffered.cpp index 55c69a6..77a5f45 100644 --- a/source/io/buffered.cpp +++ b/source/io/buffered.cpp @@ -150,7 +150,7 @@ size_t Buffered::put(char c) return do_write(&c, 1); } -bool Buffered::getline(std::string &line) +bool Buffered::getline(string &line) { set_op(M_READ); diff --git a/source/io/zlibcompressed.cpp b/source/io/zlibcompressed.cpp index f477bdc..2220bcc 100644 --- a/source/io/zlibcompressed.cpp +++ b/source/io/zlibcompressed.cpp @@ -8,7 +8,7 @@ using namespace std; namespace Msp { namespace IO { -zlib_error::zlib_error(const std::string &w, int c): +zlib_error::zlib_error(const string &w, int c): #ifdef WITH_ZLIB runtime_error(w+": "+zError(c)), #else diff --git a/source/stringcodec/utf16.cpp b/source/stringcodec/utf16.cpp index fed994e..09fb3b6 100644 --- a/source/stringcodec/utf16.cpp +++ b/source/stringcodec/utf16.cpp @@ -47,7 +47,7 @@ void Utf16::Encoder::encode_char(unichar ch, string &buf) } } -void Utf16::Encoder::transliterate(unichar, std::string &buf) +void Utf16::Encoder::transliterate(unichar, string &buf) { if(endian==LITTLE) buf.append("\xFD\xFF", 2); diff --git a/source/strings/lexicalcast.cpp b/source/strings/lexicalcast.cpp index f4b5830..8789544 100644 --- a/source/strings/lexicalcast.cpp +++ b/source/strings/lexicalcast.cpp @@ -108,12 +108,12 @@ string int_to_str(T v, const Fmt &f) } template -T str_to_int(const std::string &s, const Fmt &f) +T str_to_int(const string &s, const Fmt &f) { if(s.empty()) throw lexical_error("conversion of '' to integer"); - std::string::const_iterator i = s.begin(); + string::const_iterator i = s.begin(); // See if the input starts with a sign bool neg = false; @@ -389,7 +389,7 @@ T str_to_flt(const string &s, const Fmt &) if(s.empty()) throw lexical_error("conversion of '' to floating-point"); - std::string::const_iterator i = s.begin(); + string::const_iterator i = s.begin(); // See if the input starts with a sign bool neg = false; @@ -564,7 +564,7 @@ void operator>>(const LexicalConverter &c, char &v) v = str_to_int(c.get(), c.get_fmt()); else { - const std::string &s = c.get(); + const string &s = c.get(); if(s.empty()) throw lexical_error("conversion of '' to character"); if(s.size()>1) diff --git a/source/strings/utils.cpp b/source/strings/utils.cpp index 80e59f0..1b4cad0 100644 --- a/source/strings/utils.cpp +++ b/source/strings/utils.cpp @@ -40,7 +40,7 @@ vector do_split(const string &str, const string &sep, int max_split) return result; } -bool check_str(const std::string &str, int (*pred)(int)) +bool check_str(const string &str, int (*pred)(int)) { for(string::const_iterator i=str.begin(); i!=str.end(); ++i) if(!pred(*i)) @@ -144,7 +144,7 @@ string join(const string &str1, const string &sep, const string &str2) return append(result, sep, str2); } -string c_unescape(const std::string &str) +string c_unescape(const string &str) { bool escape = false; unsigned numeric_type = 0;