Tokenizer::simplifyIfNot(): change return type to void.

No functional change.
This commit is contained in:
Slava Semushin 2009-08-30 02:19:45 +07:00
parent b435764083
commit 3f905da9c6
2 changed files with 2 additions and 11 deletions

View File

@ -2689,9 +2689,8 @@ void Tokenizer::simplifyIfAssign()
bool Tokenizer::simplifyIfNot()
void Tokenizer::simplifyIfNot()
{
bool ret = false;
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (tok->str() == "(" || tok->str() == "||" || tok->str() == "&&")
@ -2708,7 +2707,6 @@ bool Tokenizer::simplifyIfNot()
{
tok->deleteNext();
tok->str("!");
ret = true;
}
else if (Token::Match(tok, "%var% == 0"))
@ -2716,7 +2714,6 @@ bool Tokenizer::simplifyIfNot()
tok->deleteNext();
tok->next()->str(tok->str());
tok->str("!");
ret = true;
}
else if (Token::Match(tok, "%var% .|:: %var% == 0"))
@ -2725,7 +2722,6 @@ bool Tokenizer::simplifyIfNot()
tok->insertToken("!");
tok = tok->tokAt(4);
Token::eraseTokens(tok, tok->tokAt(3));
ret = true;
}
}
@ -2745,11 +2741,8 @@ bool Tokenizer::simplifyIfNot()
tok->link()->str("!");
Token::createMutualLinks(tok->link()->next(), tok);
}
ret = true;
}
}
return ret;
}

View File

@ -144,10 +144,8 @@ private:
/**
* simplify if-not..
* Example: "if(0==x);" => "if(!x);"
* @return true if something is modified
* false if nothing is done.
*/
bool simplifyIfNot();
void simplifyIfNot();
/**
* simplify if-not NULL..