diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 2efdf737d..1b04d4f84 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -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 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); diff --git a/lib/ctu.cpp b/lib/ctu.cpp index fc6687c2c..75d897073 100644 --- a/lib/ctu.cpp +++ b/lib/ctu.cpp @@ -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