diff --git a/lib/check.h b/lib/check.h index 4436d2e3d..7bcb7bcf7 100644 --- a/lib/check.h +++ b/lib/check.h @@ -118,7 +118,7 @@ protected: ErrorLogger * const _errorLogger; /** report an error */ - void reportError(const Token *tok, const Severity::e severity, const std::string &id, const std::string &msg) + void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg) { std::list callstack; if (tok) @@ -127,7 +127,7 @@ protected: } /** report an error */ - void reportError(const std::list &callstack, const Severity::e severity, const std::string &id, std::string msg) + void reportError(const std::list &callstack, const Severity::SeverityType severity, const std::string &id, std::string msg) { // If the verbose flag hasn't been given, don't show verbose information if (!_settings || !_settings->_verbose) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index bc4650e4f..98fe57dfb 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -300,7 +300,7 @@ void CheckMemoryLeak::memoryLeak(const Token *tok, const std::string &varname, A //--------------------------------------------------------------------------- -void CheckMemoryLeak::reportErr(const Token *tok, Severity::e severity, const std::string &id, const std::string &msg) const +void CheckMemoryLeak::reportErr(const Token *tok, Severity::SeverityType severity, const std::string &id, const std::string &msg) const { std::list callstack; @@ -310,7 +310,7 @@ void CheckMemoryLeak::reportErr(const Token *tok, Severity::e severity, const st reportErr(callstack, severity, id, msg); } -void CheckMemoryLeak::reportErr(const std::list &callstack, Severity::e severity, const std::string &id, const std::string &msg) const +void CheckMemoryLeak::reportErr(const std::list &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) const { std::list locations; diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index d152906d9..e9984a27e 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -71,7 +71,7 @@ private: * @param id type of message * @param msg text */ - void reportErr(const Token *location, Severity::e severity, const std::string &id, const std::string &msg) const; + void reportErr(const Token *location, Severity::SeverityType severity, const std::string &id, const std::string &msg) const; /** * Report error. Similar with the function Check::reportError @@ -80,7 +80,7 @@ private: * @param id type of message * @param msg text */ - void reportErr(const std::list &callstack, Severity::e severity, const std::string &id, const std::string &msg) const; + void reportErr(const std::list &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) const; public: CheckMemoryLeak(const Tokenizer *t, ErrorLogger *e) diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 47f9f6266..b276427da 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -29,6 +29,24 @@ class Tokenizer; /// @addtogroup Core /// @{ +/** @brief enum class for severity. Used when reporting errors. */ +class Severity +{ +public: + enum SeverityType { error, style }; + static std::string stringify(SeverityType severity) + { + switch (severity) + { + case error: + return "error"; + case style: + return "style"; + }; + return "???"; + } +}; + /** * @brief This is an interface, which the class responsible of error logging * should implement. @@ -307,24 +325,6 @@ private: void _writemsg(const Tokenizer *tokenizer, const std::list &callstack, const char severity[], const std::string &msg, const std::string &id); }; -/** @brief enum class for severity. Used when reporting errors. */ -class Severity -{ -public: - enum e { error, style }; - static std::string stringify(e severity) - { - switch (severity) - { - case error: - return "error"; - case style: - return "style"; - }; - return "???"; - } -}; - /// @}