Revert "Revert "Fix potential uninitialized variable in Tokenizer::simplifyTypedef""

It does not _fix_ any potential uninitialized variable. So I reverted this. However I think that as a refactoring it was ok.

This reverts commit 5b2e4891c4.
This commit is contained in:
Daniel Marjamäki 2016-10-29 19:04:10 +02:00
parent d092631645
commit e76710c906
1 changed files with 4 additions and 4 deletions

View File

@ -1448,13 +1448,13 @@ void Tokenizer::simplifyTypedef()
// Name is not available, and () should not be // Name is not available, and () should not be
// inserted // inserted
const bool castOperator = inOperator && Token::Match(tok2, "%type% ("); const bool castOperator = inOperator && Token::Match(tok2, "%type% (");
Token *tok3; Token *openParenthesis = nullptr;
if (!castOperator) { if (!castOperator) {
tok2->insertToken("("); tok2->insertToken("(");
tok2 = tok2->next(); tok2 = tok2->next();
tok3 = tok2; openParenthesis = tok2;
} }
const Token *tok4 = namespaceStart; const Token *tok4 = namespaceStart;
@ -1470,14 +1470,14 @@ void Tokenizer::simplifyTypedef()
tok2->insertToken("*"); tok2->insertToken("*");
tok2 = tok2->next(); tok2 = tok2->next();
if (!castOperator) { if (openParenthesis) {
// skip over name // skip over name
tok2 = tok2->next(); tok2 = tok2->next();
tok2->insertToken(")"); tok2->insertToken(")");
tok2 = tok2->next(); tok2 = tok2->next();
Token::createMutualLinks(tok2, tok3); Token::createMutualLinks(tok2, openParenthesis);
} }
} }
} else if (typeOf) { } else if (typeOf) {