diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/Configuration/Config.cpp | 8 | ||||
| -rw-r--r-- | src/common/Debugging/Errors.cpp | 2 | ||||
| -rw-r--r-- | src/common/Logging/AppenderConsole.cpp | 3 | ||||
| -rw-r--r-- | src/common/Utilities/Util.cpp | 12 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index ecb24d04dec..57eefb41c4b 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -86,12 +86,12 @@ T ConfigMgr::GetValueDefault(std::string const& name, T def) const { return _config.get<T>(bpt::ptree::path_type(name, '/')); } - catch (bpt::ptree_bad_path) + catch (bpt::ptree_bad_path const&) { TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file", name.c_str(), _filename.c_str(), name.c_str(), std::to_string(def).c_str()); } - catch (bpt::ptree_bad_data) + catch (bpt::ptree_bad_data const&) { TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead", name.c_str(), _filename.c_str(), std::to_string(def).c_str()); @@ -107,12 +107,12 @@ std::string ConfigMgr::GetValueDefault<std::string>(std::string const& name, std { return _config.get<std::string>(bpt::ptree::path_type(name, '/')); } - catch (bpt::ptree_bad_path) + catch (bpt::ptree_bad_path const&) { TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file", name.c_str(), _filename.c_str(), name.c_str(), def.c_str()); } - catch (bpt::ptree_bad_data) + catch (bpt::ptree_bad_data const&) { TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead", name.c_str(), _filename.c_str(), def.c_str()); diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index 6862b07aaff..25c9f06fed4 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -41,7 +41,7 @@ RaiseException(EXCEPTION_ASSERTION_FAILURE, 0, 2, execeptionArgs); #else // should be easily accessible in gdb -extern "C" TC_COMMON_API char const* TrinityAssertionFailedMessage = nullptr; +extern "C" { TC_COMMON_API char const* TrinityAssertionFailedMessage = nullptr; } #define Crash(message) \ TrinityAssertionFailedMessage = strdup(message); \ *((volatile int*)nullptr) = 0; \ diff --git a/src/common/Logging/AppenderConsole.cpp b/src/common/Logging/AppenderConsole.cpp index 9d1dd725401..96eb4a1fe0e 100644 --- a/src/common/Logging/AppenderConsole.cpp +++ b/src/common/Logging/AppenderConsole.cpp @@ -184,7 +184,8 @@ void AppenderConsole::_write(LogMessage const* message) case LOG_LEVEL_FATAL: index = 0; break; - case LOG_LEVEL_ERROR: // No break on purpose + case LOG_LEVEL_ERROR: + /* fallthrough */ default: index = 1; break; diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 3735cca089f..668b1a9dce7 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -221,7 +221,7 @@ size_t utf8length(std::string& utf8str) { return utf8::distance(utf8str.c_str(), utf8str.c_str()+utf8str.size()); } - catch(std::exception) + catch(std::exception const&) { utf8str.clear(); return 0; @@ -243,7 +243,7 @@ void utf8truncate(std::string& utf8str, size_t len) char* oend = utf8::utf16to8(wstr.c_str(), wstr.c_str()+wstr.size(), &utf8str[0]); utf8str.resize(oend-(&utf8str[0])); // remove unused tail } - catch(std::exception) + catch(std::exception const&) { utf8str.clear(); } @@ -258,7 +258,7 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize) wsize -= out.remaining(); // remaining unused space wstr[wsize] = L'\0'; } - catch(std::exception) + catch(std::exception const&) { // Replace the converted string with an error message if there is enough space // Otherwise just return an empty string @@ -290,7 +290,7 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr) { utf8::utf8to16(utf8str.c_str(), utf8str.c_str()+utf8str.size(), std::back_inserter(wstr)); } - catch(std::exception) + catch(std::exception const&) { wstr.clear(); return false; @@ -313,7 +313,7 @@ bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str) } utf8str = utf8str2; } - catch(std::exception) + catch(std::exception const&) { utf8str.clear(); return false; @@ -336,7 +336,7 @@ bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str) } utf8str = utf8str2; } - catch(std::exception) + catch(std::exception const&) { utf8str.clear(); return false; |
