fixed cppcheck warnings

This commit is contained in:
Daniel Marjamäki 2015-06-10 19:07:04 +02:00
parent cae605b1ec
commit 3986c0dc64
2 changed files with 2 additions and 2 deletions

View File

@ -1982,7 +1982,7 @@ void CheckOther::checkMisusedScopedObject()
&& Token::Match(tok->linkAt(2), ") ; !!}") && Token::Match(tok->linkAt(2), ") ; !!}")
&& symbolDatabase->isClassOrStruct(tok->next()->str()) && symbolDatabase->isClassOrStruct(tok->next()->str())
&& (!tok->next()->function() || // is not a function on this scope && (!tok->next()->function() || // is not a function on this scope
(tok->next()->function() && tok->next()->function()->isConstructor()))) { // or is function in this scope and it's a ctor tok->next()->function()->isConstructor())) { // or is function in this scope and it's a ctor
tok = tok->next(); tok = tok->next();
misusedScopeObjectError(tok, tok->str()); misusedScopeObjectError(tok, tok->str());
tok = tok->next(); tok = tok->next();

View File

@ -602,7 +602,7 @@ void Tokenizer::simplifyTypedef()
// Skip typedefs inside parentheses (#2453 and #4002) // Skip typedefs inside parentheses (#2453 and #4002)
tok = tok->next(); tok = tok->next();
} else if (Token::Match(tok, "class|struct|namespace %any%") && } else if (Token::Match(tok, "class|struct|namespace %any%") &&
(!tok->previous() || (tok->previous() && tok->previous()->str() != "enum"))) { (!tok->previous() || tok->previous()->str() != "enum")) {
isNamespace = (tok->str() == "namespace"); isNamespace = (tok->str() == "namespace");
hasClass = true; hasClass = true;
className = tok->next()->str(); className = tok->next()->str();