Refactorizations:
- removed unused function CheckOther::concatNames - Replaced one indendation counter by Token::link() in checkother.cpp - Forward declaration of Settings in threadexecutor.h
This commit is contained in:
parent
5ac7552e4e
commit
92737578ac
|
@ -22,13 +22,14 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include "settings.h"
|
||||
#include "errorlogger.h"
|
||||
|
||||
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
|
||||
#define THREADING_MODEL_FORK
|
||||
#endif
|
||||
|
||||
class Settings;
|
||||
|
||||
/// @addtogroup CLI
|
||||
/// @{
|
||||
|
||||
|
|
|
@ -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) != ".") {
|
||||
|
|
|
@ -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<Function> &constFunctions,
|
||||
const Token *start,
|
||||
const Token *end,
|
||||
|
|
Loading…
Reference in New Issue