Refactoring; Avoid templates
This commit is contained in:
parent
0e0d88f65e
commit
103ecb0257
12
lib/check.h
12
lib/check.h
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue