Tokenizer::simplifyIfAssign(): change return type to void.
No functional change.
This commit is contained in:
parent
030a0c19df
commit
b435764083
|
@ -2579,10 +2579,8 @@ void Tokenizer::unsignedint()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Tokenizer::simplifyIfAssign()
|
void Tokenizer::simplifyIfAssign()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (!Token::Match(tok->next(), "if|while ( !| (| %var% =") &&
|
if (!Token::Match(tok->next(), "if|while ( !| (| %var% =") &&
|
||||||
|
@ -2595,9 +2593,6 @@ bool Tokenizer::simplifyIfAssign()
|
||||||
// delete the "if"
|
// delete the "if"
|
||||||
tok->deleteNext();
|
tok->deleteNext();
|
||||||
|
|
||||||
// The tokenlist has changed
|
|
||||||
ret = true;
|
|
||||||
|
|
||||||
// Remember if there is a "!" or not. And delete it if there are.
|
// Remember if there is a "!" or not. And delete it if there are.
|
||||||
const bool isNot(tok->tokAt(2)->str() == "!");
|
const bool isNot(tok->tokAt(2)->str() == "!");
|
||||||
if (isNot)
|
if (isNot)
|
||||||
|
@ -2690,8 +2685,6 @@ bool Tokenizer::simplifyIfAssign()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -138,10 +138,8 @@ private:
|
||||||
/**
|
/**
|
||||||
* simplify if-assignments..
|
* simplify if-assignments..
|
||||||
* Example: "if(a=b);" => "a=b;if(a);"
|
* Example: "if(a=b);" => "a=b;if(a);"
|
||||||
* @return true if something is modified
|
|
||||||
* false if nothing is done.
|
|
||||||
*/
|
*/
|
||||||
bool simplifyIfAssign();
|
void simplifyIfAssign();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* simplify if-not..
|
* simplify if-not..
|
||||||
|
|
Loading…
Reference in New Issue