Fix Cppcheck warnings

[ci skip]
This commit is contained in:
Daniel Marjamäki 2019-01-12 18:29:08 +01:00
parent 8dd641b8be
commit 2b1b8f8fe9
2 changed files with 4 additions and 4 deletions

View File

@ -1046,7 +1046,7 @@ bool isConstVarExpression(const Token *tok)
{
if (!tok)
return false;
if (Token::Match(tok->previous(), "sizeof ("))
if (Token::simpleMatch(tok->previous(), "sizeof ("))
return true;
if (Token::Match(tok->previous(), "%name% (")) {
std::vector<const Token *> args = getArguments(tok);
@ -1223,7 +1223,7 @@ struct FwdAnalysis::Result FwdAnalysis::checkRecursive(const Token *expr, const
}
}
if (Token::Match(tok, ") {")) {
if (Token::simpleMatch(tok, ") {")) {
if (Token::simpleMatch(tok->link()->previous(), "switch ("))
// TODO: parse switch
return Result(Result::Type::BAILOUT);

View File

@ -45,9 +45,9 @@ std::string CTU::getFunctionId(const Tokenizer *tokenizer, const Function *funct
}
CTU::FileInfo::Location::Location(const Tokenizer *tokenizer, const Token *tok)
: fileName(tokenizer->list.file(tok))
, linenr(tok->linenr())
{
fileName = tokenizer->list.file(tok);
linenr = tok->linenr();
}
std::string CTU::FileInfo::toString() const