From 103ecb025718e20cce71f871e9a6f12706004576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 1 Feb 2020 08:52:34 +0100 Subject: [PATCH] Refactoring; Avoid templates --- lib/check.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/check.h b/lib/check.h index ace4c24f1..40306c249 100644 --- a/lib/check.h +++ b/lib/check.h @@ -126,27 +126,23 @@ protected: ErrorLogger * const mErrorLogger; /** report an error */ - template - void reportError(const Token *tok, const Severity::SeverityType severity, const T id, const U msg) { + void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg) { reportError(tok, severity, id, msg, CWE(0U), false); } /** report an error */ - template - void reportError(const Token *tok, const Severity::SeverityType severity, const T id, const U msg, const CWE &cwe, bool inconclusive) { + void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg, const CWE &cwe, bool inconclusive) { const std::list callstack(1, tok); reportError(callstack, severity, id, msg, cwe, inconclusive); } /** report an error */ - template - void reportError(const std::list &callstack, Severity::SeverityType severity, const T id, const U msg) { + void reportError(const std::list &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) { reportError(callstack, severity, id, msg, CWE(0U), false); } /** report an error */ - template - void reportError(const std::list &callstack, Severity::SeverityType severity, const T id, const U msg, const CWE &cwe, bool inconclusive) { + void reportError(const std::list &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg, const CWE &cwe, bool inconclusive) { const ErrorLogger::ErrorMessage errmsg(callstack, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, inconclusive); if (mErrorLogger) mErrorLogger->reportErr(errmsg);