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 <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "settings.h"
|
|
||||||
#include "errorlogger.h"
|
#include "errorlogger.h"
|
||||||
|
|
||||||
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
|
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
|
||||||
#define THREADING_MODEL_FORK
|
#define THREADING_MODEL_FORK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class Settings;
|
||||||
|
|
||||||
/// @addtogroup CLI
|
/// @addtogroup CLI
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
|
@ -865,17 +865,9 @@ void CheckOther::switchCaseFallThrough(const Token *tok)
|
||||||
void CheckOther::checkCoutCerrMisusage()
|
void CheckOther::checkCoutCerrMisusage()
|
||||||
{
|
{
|
||||||
bool firstCout = false;
|
bool firstCout = false;
|
||||||
unsigned int roundbraces = 0;
|
|
||||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
||||||
if (tok->str() == "(")
|
if (tok->str() == "(")
|
||||||
++roundbraces;
|
tok = tok->link();
|
||||||
else if (tok->str() == ")") {
|
|
||||||
if (!roundbraces)
|
|
||||||
break;
|
|
||||||
--roundbraces;
|
|
||||||
}
|
|
||||||
if (roundbraces)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (Token::Match(tok, "std :: cout|cerr")) {
|
if (Token::Match(tok, "std :: cout|cerr")) {
|
||||||
if (firstCout && tok->strAt(-1) == "<<" && tok->strAt(3) != ".") {
|
if (firstCout && tok->strAt(-1) == "<<" && tok->strAt(3) != ".") {
|
||||||
|
|
|
@ -443,24 +443,6 @@ private:
|
||||||
"* optimisation: detect post increment/decrement\n";
|
"* 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,
|
void checkExpressionRange(const std::list<Function> &constFunctions,
|
||||||
const Token *start,
|
const Token *start,
|
||||||
const Token *end,
|
const Token *end,
|
||||||
|
|
Loading…
Reference in New Issue