Fix up extra whitespaces in match patterns

Detected by new internal check.
This commit is contained in:
Thomas Jarosch 2014-12-30 14:53:41 +01:00
parent 17b47f1ce0
commit 69b31a0743
6 changed files with 7 additions and 7 deletions

View File

@ -2531,7 +2531,7 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
// Struct member is allocated => check if it is also properly deallocated..
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new ", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->declarationId())) {
const unsigned int structid(variable->declarationId());
const unsigned int structmemberid(tok2->tokAt(2)->varId());

View File

@ -1327,8 +1327,8 @@ void CheckStl::checkAutoPointer()
autoPointerError(tok->tokAt(2));
}
}
} else if ((Token::Match(tok, "%var% = new %type% ") && hasArrayEnd(tok)) ||
(Token::Match(tok, "%var% . reset ( new %type% ") && hasArrayEndParen(tok))) {
} else if ((Token::Match(tok, "%var% = new %type%") && hasArrayEnd(tok)) ||
(Token::Match(tok, "%var% . reset ( new %type%") && hasArrayEndParen(tok))) {
std::set<unsigned int>::const_iterator iter = autoPtrVarId.find(tok->varId());
if (iter != autoPtrVarId.end()) {
autoPointerArrayError(tok);

View File

@ -1362,7 +1362,7 @@ void Variable::evaluate()
// type var = {x}
// type var = x; gets simplified to: type var ; var = x ;
Token const * declEnd = declEndToken();
if ((Token::Match(declEnd, "; %var% = ") && declEnd->strAt(1) == _name->str()) ||
if ((Token::Match(declEnd, "; %var% =") && declEnd->strAt(1) == _name->str()) ||
Token::Match(declEnd, "=|{"))
setFlag(fHasDefault, true);
}

View File

@ -2500,7 +2500,7 @@ static void setVarIdClassFunction(const std::string &classname,
continue;
if (Token::Match(tok2->tokAt(-4), "%var% :: %var% ::")) // Currently unsupported
continue;
if (Token::Match(tok2->tokAt(-2), "!!this . "))
if (Token::Match(tok2->tokAt(-2), "!!this ."))
continue;
const std::map<std::string,unsigned int>::const_iterator it = varlist.find(tok2->str());