Refactorization: Fixed true positive when self-checking cppcheck

This commit is contained in:
PKEuS 2015-12-18 18:13:13 +01:00
parent 8f641aaa76
commit a6b719eb10
2 changed files with 2 additions and 4 deletions

View File

@ -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<Scope::UsingInfo>::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)

View File

@ -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);