Tokenizer::simplifyIfAddBraces(): change return type to void.
No functional change.
This commit is contained in:
parent
ea45d985c7
commit
a1f40f3c17
|
@ -1794,10 +1794,8 @@ bool Tokenizer::removeReduntantConditions()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tokenizer::simplifyIfAddBraces()
|
void Tokenizer::simplifyIfAddBraces()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
for (Token *tok = _tokens; tok; tok = tok ? tok->next() : NULL)
|
for (Token *tok = _tokens; tok; tok = tok ? tok->next() : NULL)
|
||||||
{
|
{
|
||||||
if (Token::Match(tok, "if|for|while ("))
|
if (Token::Match(tok, "if|for|while ("))
|
||||||
|
@ -1834,7 +1832,7 @@ bool Tokenizer::simplifyIfAddBraces()
|
||||||
|
|
||||||
// If there is no code after he if(), abort
|
// If there is no code after he if(), abort
|
||||||
if (!tok->next())
|
if (!tok->next())
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
|
|
||||||
// insert open brace..
|
// insert open brace..
|
||||||
|
@ -1875,11 +1873,8 @@ bool Tokenizer::simplifyIfAddBraces()
|
||||||
{
|
{
|
||||||
tempToken->insertToken("}");
|
tempToken->insertToken("}");
|
||||||
Token::createMutualLinks(tok, tempToken->next());
|
Token::createMutualLinks(tok, tempToken->next());
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tokenizer::simplifyDoWhileAddBraces()
|
bool Tokenizer::simplifyDoWhileAddBraces()
|
||||||
|
|
|
@ -171,10 +171,8 @@ private:
|
||||||
void simplifyComma();
|
void simplifyComma();
|
||||||
|
|
||||||
/** Add braces to an if-block
|
/** Add braces to an if-block
|
||||||
* @return true if something is modified
|
|
||||||
* false if nothing is done.
|
|
||||||
*/
|
*/
|
||||||
bool simplifyIfAddBraces();
|
void simplifyIfAddBraces();
|
||||||
|
|
||||||
/** Add braces to an do-while block
|
/** Add braces to an do-while block
|
||||||
* @return true if something is modified
|
* @return true if something is modified
|
||||||
|
|
Loading…
Reference in New Issue