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), ") ; !!}")
&& symbolDatabase->isClassOrStruct(tok->next()->str())
&& (!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();
misusedScopeObjectError(tok, tok->str());
tok = tok->next();

View File

@ -602,7 +602,7 @@ void Tokenizer::simplifyTypedef()
// Skip typedefs inside parentheses (#2453 and #4002)
tok = tok->next();
} 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");
hasClass = true;
className = tok->next()->str();