Refactoring; Avoid templates

This commit is contained in:
Daniel Marjamäki 2020-02-01 08:52:34 +01:00
parent 0e0d88f65e
commit 103ecb0257
1 changed files with 4 additions and 8 deletions

View File

@ -126,27 +126,23 @@ protected:
ErrorLogger * const mErrorLogger; ErrorLogger * const mErrorLogger;
/** report an error */ /** report an error */
template<typename T, typename U> void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg) {
void reportError(const Token *tok, const Severity::SeverityType severity, const T id, const U msg) {
reportError(tok, severity, id, msg, CWE(0U), false); reportError(tok, severity, id, msg, CWE(0U), false);
} }
/** report an error */ /** report an error */
template<typename T, typename U> void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg, const CWE &cwe, bool inconclusive) {
void reportError(const Token *tok, const Severity::SeverityType severity, const T id, const U msg, const CWE &cwe, bool inconclusive) {
const std::list<const Token *> callstack(1, tok); const std::list<const Token *> callstack(1, tok);
reportError(callstack, severity, id, msg, cwe, inconclusive); reportError(callstack, severity, id, msg, cwe, inconclusive);
} }
/** report an error */ /** report an error */
template<typename T, typename U> void reportError(const std::list<const Token *> &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) {
void reportError(const std::list<const Token *> &callstack, Severity::SeverityType severity, const T id, const U msg) {
reportError(callstack, severity, id, msg, CWE(0U), false); reportError(callstack, severity, id, msg, CWE(0U), false);
} }
/** report an error */ /** report an error */
template<typename T, typename U> void reportError(const std::list<const Token *> &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg, const CWE &cwe, bool inconclusive) {
void reportError(const std::list<const Token *> &callstack, Severity::SeverityType severity, const T id, const U msg, const CWE &cwe, bool inconclusive) {
const ErrorLogger::ErrorMessage errmsg(callstack, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, inconclusive); const ErrorLogger::ErrorMessage errmsg(callstack, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, inconclusive);
if (mErrorLogger) if (mErrorLogger)
mErrorLogger->reportErr(errmsg); mErrorLogger->reportErr(errmsg);