Fix compiler warning. run astyle

This commit is contained in:
Alexander Mai 2014-11-18 19:36:47 +01:00
parent ad8749c0bd
commit 85c02df56c
2 changed files with 5 additions and 2 deletions

View File

@ -851,7 +851,7 @@ void CheckStl::if_find()
else if (Token::Match(decl, "%type% >")) {
decl = decl->tokAt(2);
if (warning && (Token::Match(decl, "* &| %varid%", varid) ||
Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid)))
Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid)))
if_findError(tok, false);
}
@ -862,7 +862,7 @@ void CheckStl::if_find()
else if (performance && var->isStlStringType()) {
decl = decl->next();
if (Token::Match(decl, "* &| %varid%", varid) ||
Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid))
Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid))
if_findError(tok, true);
}
}

View File

@ -2358,6 +2358,9 @@ private:
"void CheckMemoryLeakInFunction::getcode(const Token *tok ) {\n"
" addtoken(&rettail, tok);\n"
"}");
const Token *f = Token::findsimplematch(tokenizer.tokens(), "void addtoken ( Token * *");
ASSERT_EQUALS(true, db && f);
ASSERT_EQUALS(true, db && f && f->function());
}