From a6b719eb109174c830270441b29ec960dcae98bb Mon Sep 17 00:00:00 2001 From: PKEuS Date: Fri, 18 Dec 2015 18:13:13 +0100 Subject: [PATCH] Refactorization: Fixed true positive when self-checking cppcheck --- lib/symboldatabase.cpp | 2 +- lib/tokenize.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 15b66079f..b9ea1d502 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2537,7 +2537,7 @@ static const Type* findVariableTypeIncludingUsedNamespaces(const SymbolDatabase* // look for variable type in any using namespace in this scope or above while (scope) { for (std::list::const_iterator ui = scope->usingList.begin(); - ui != scope->usingList.end(); ++ui) { + ui != scope->usingList.end(); ++ui) { if (ui->scope) { argType = symbolDatabase->findVariableType(ui->scope, typeTok); if (argType) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index a6a3c65bb..7372e564f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2999,12 +2999,10 @@ void Tokenizer::setVarId() if (Token::Match(tok2, funcpattern.c_str())) { // Goto the end parentheses.. tok2 = tok2->tokAt(nestedCount*2); - if (tok2 && tok2->str() == "~") + if (tok2->str() == "~") tok2 = tok2->linkAt(2); else tok2 = tok2->linkAt(1); - if (!tok2) - break; // If this is a function implementation.. add it to funclist Token * start = startOfFunction(tok2);