diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 5f7e42619..b2affa275 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -302,7 +302,7 @@ static bool for_condition(const Token * const tok2, unsigned int varid, std::str maxMinFlipped = false; max_value = tok2->strAt(2); } - else if (Token::Match(tok2, " %num% < %varid% ;", varid) || + else if (Token::Match(tok2, "%num% < %varid% ;", varid) || Token::Match(tok2, "%num% != %varid% ; ++ %varid%", varid) || Token::Match(tok2, "%num% != %varid% ; %varid% ++", varid)) { diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 0991e795f..2067142f9 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -310,7 +310,7 @@ void CheckClass::initializeVarList(const Function &func, std::list ftok = ftok->next(); // Using the operator= function to initialize all variables.. - if (Token::simpleMatch(ftok->next(), "* this = ")) + if (Token::simpleMatch(ftok->next(), "* this =")) { assignAllVar(usage); break; diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 5313dd611..1b41bb1cd 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -137,7 +137,7 @@ void CheckOther::checkSizeofForArrayParameter() { for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { - if (Token::Match(tok, "sizeof ( %var% )") || Token::Match(tok, "sizeof %var% ")) + if (Token::Match(tok, "sizeof ( %var% )") || Token::Match(tok, "sizeof %var%")) { int tokIdx = 1; if (tok->tokAt(tokIdx)->str() == "(") diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index fc90339bb..87044e4d2 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -445,7 +445,7 @@ void CheckStl::erase() break; } - if (Token::Match(tok2, "%var% = %var% . begin ( ) ; %var% != %var% . end ( ) ") && + if (Token::Match(tok2, "%var% = %var% . begin ( ) ; %var% != %var% . end ( )") && tok2->str() == tok2->tokAt(8)->str() && tok2->tokAt(2)->str() == tok2->tokAt(10)->str()) { diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 51032d44d..cf69b6196 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1213,7 +1213,7 @@ const Token* skipScopeIdentifiers(const Token* tok) { ret = ret->next(); } - while (Token::Match(ret, "%type% :: ")) + while (Token::Match(ret, "%type% ::")) { ret = ret->tokAt(2); } diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 8cc0b6945..aa3707c8e 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7702,7 +7702,7 @@ void Tokenizer::simplifyEnum() lastEnumValueStart = 0; lastEnumValueEnd = 0; } - else if (Token::Match(tok1->previous(), ",|{ %type% = ")) + else if (Token::Match(tok1->previous(), ",|{ %type% =")) { // value is specified expression enumName = tok1;