Tokenizer::simplifyIfNot(): change return type to void.
No functional change.
This commit is contained in:
parent
b435764083
commit
3f905da9c6
|
@ -2689,9 +2689,8 @@ void Tokenizer::simplifyIfAssign()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Tokenizer::simplifyIfNot()
|
void Tokenizer::simplifyIfNot()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (tok->str() == "(" || tok->str() == "||" || tok->str() == "&&")
|
if (tok->str() == "(" || tok->str() == "||" || tok->str() == "&&")
|
||||||
|
@ -2708,7 +2707,6 @@ bool Tokenizer::simplifyIfNot()
|
||||||
{
|
{
|
||||||
tok->deleteNext();
|
tok->deleteNext();
|
||||||
tok->str("!");
|
tok->str("!");
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Token::Match(tok, "%var% == 0"))
|
else if (Token::Match(tok, "%var% == 0"))
|
||||||
|
@ -2716,7 +2714,6 @@ bool Tokenizer::simplifyIfNot()
|
||||||
tok->deleteNext();
|
tok->deleteNext();
|
||||||
tok->next()->str(tok->str());
|
tok->next()->str(tok->str());
|
||||||
tok->str("!");
|
tok->str("!");
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Token::Match(tok, "%var% .|:: %var% == 0"))
|
else if (Token::Match(tok, "%var% .|:: %var% == 0"))
|
||||||
|
@ -2725,7 +2722,6 @@ bool Tokenizer::simplifyIfNot()
|
||||||
tok->insertToken("!");
|
tok->insertToken("!");
|
||||||
tok = tok->tokAt(4);
|
tok = tok->tokAt(4);
|
||||||
Token::eraseTokens(tok, tok->tokAt(3));
|
Token::eraseTokens(tok, tok->tokAt(3));
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2745,11 +2741,8 @@ bool Tokenizer::simplifyIfNot()
|
||||||
tok->link()->str("!");
|
tok->link()->str("!");
|
||||||
Token::createMutualLinks(tok->link()->next(), tok);
|
Token::createMutualLinks(tok->link()->next(), tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,8 @@ private:
|
||||||
/**
|
/**
|
||||||
* simplify if-not..
|
* simplify if-not..
|
||||||
* Example: "if(0==x);" => "if(!x);"
|
* 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..
|
* simplify if-not NULL..
|
||||||
|
|
Loading…
Reference in New Issue