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

No functional change.
This commit is contained in:
Slava Semushin 2009-08-30 02:23:39 +07:00
parent 80a305a2ce
commit ea45d985c7
2 changed files with 2 additions and 12 deletions

View File

@ -3556,9 +3556,8 @@ void Tokenizer::syntaxError(const Token *tok, char c)
}
bool Tokenizer::simplifyComma()
void Tokenizer::simplifyComma()
{
bool ret = false;
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (Token::simpleMatch(tok, "for (") ||
@ -3580,7 +3579,6 @@ bool Tokenizer::simplifyComma()
{
// Handle "delete a, delete b;"
tok->str(";");
ret = true;
}
if (tok->previous() && tok->previous()->previous())
@ -3591,7 +3589,6 @@ bool Tokenizer::simplifyComma()
// Handle "delete a, b;"
tok->str(";");
tok->insertToken("delete");
ret = true;
}
else
{
@ -3601,7 +3598,6 @@ bool Tokenizer::simplifyComma()
{
// Handle "a = 0, b = 0;"
tok->str(";");
ret = true;
break;
}
else if (Token::Match(tok2, "delete %var%") ||
@ -3609,7 +3605,6 @@ bool Tokenizer::simplifyComma()
{
// Handle "delete a, a = 0;"
tok->str(";");
ret = true;
break;
}
else if (Token::Match(tok2, "[;,{}()]"))
@ -3705,11 +3700,8 @@ bool Tokenizer::simplifyComma()
startFrom->previous()->deleteThis();
tok = endAt;
ret = true;
}
}
}
return ret;
}

View File

@ -167,10 +167,8 @@ private:
* Example: "delete a, delete b" => "delete a; delete b;"
* Example: "a = 0, b = 0;" => "a = 0; b = 0;"
* Example: "return a(), b;" => "a(); return b;"
* @return true if something is modified
* false if nothing is done.
*/
bool simplifyComma();
void simplifyComma();
/** Add braces to an if-block
* @return true if something is modified