Simplified a few Token::Match calls

This commit is contained in:
PKEuS 2015-09-14 08:57:23 +02:00
parent 2ddd4c7197
commit 6647976d80
1 changed files with 3 additions and 3 deletions

View File

@ -3082,7 +3082,7 @@ bool Tokenizer::simplifySizeof()
} }
// sizeof('x') // sizeof('x')
if (Token::Match(tok, "sizeof ( %char% )")) { if (Token::Match(tok->next(), "( %char% )")) {
tok->deleteNext(); tok->deleteNext();
tok->deleteThis(); tok->deleteThis();
tok->deleteNext(); tok->deleteNext();
@ -3130,7 +3130,7 @@ bool Tokenizer::simplifySizeof()
} }
} }
else if (Token::Match(tok, "sizeof ( %type% )")) { else if (Token::Match(tok->next(), "( %type% )")) {
const unsigned int size = sizeOfType(tok->tokAt(2)); const unsigned int size = sizeOfType(tok->tokAt(2));
if (size > 0) { if (size > 0) {
tok->str(MathLib::toString(size)); tok->str(MathLib::toString(size));
@ -3139,7 +3139,7 @@ bool Tokenizer::simplifySizeof()
} }
} }
else if (Token::simpleMatch(tok, "sizeof ( *") || Token::Match(tok, "sizeof ( %name% [")) { else if (Token::simpleMatch(tok->next(), "( *") || Token::Match(tok->next(), "( %name% [")) {
// Some default value.. // Some default value..
std::size_t sz = 0; std::size_t sz = 0;