diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index 088c5e109..bcb3afff1 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -22,13 +22,14 @@ #include #include #include -#include "settings.h" #include "errorlogger.h" #if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__) #define THREADING_MODEL_FORK #endif +class Settings; + /// @addtogroup CLI /// @{ diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 2f3ef3912..c039d20ac 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -865,17 +865,9 @@ void CheckOther::switchCaseFallThrough(const Token *tok) void CheckOther::checkCoutCerrMisusage() { bool firstCout = false; - unsigned int roundbraces = 0; for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { if (tok->str() == "(") - ++roundbraces; - else if (tok->str() == ")") { - if (!roundbraces) - break; - --roundbraces; - } - if (roundbraces) - continue; + tok = tok->link(); if (Token::Match(tok, "std :: cout|cerr")) { if (firstCout && tok->strAt(-1) == "<<" && tok->strAt(3) != ".") { diff --git a/lib/checkother.h b/lib/checkother.h index 668068c37..37964f40f 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -443,24 +443,6 @@ private: "* optimisation: detect post increment/decrement\n"; } - /** - * @brief Used in warningRedundantCode() - * Iterates through the %var% tokens in a fully qualified name and concatenates them. - */ - std::string concatNames(const Token **tok) const { - std::string varname; - while (Token::Match(*tok, "%var% ::|.")) { - varname.append((*tok)->str()); - varname.append((*tok)->next()->str()); - *tok = (*tok)->tokAt(2); - } - - if ((*tok)->isName()) - varname.append((*tok)->str()); - - return varname; - } - void checkExpressionRange(const std::list &constFunctions, const Token *start, const Token *end,