Tokenizer::simplifyComma(): change return type to void.
No functional change.
This commit is contained in:
parent
80a305a2ce
commit
ea45d985c7
|
@ -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())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (Token::simpleMatch(tok, "for (") ||
|
if (Token::simpleMatch(tok, "for (") ||
|
||||||
|
@ -3580,7 +3579,6 @@ bool Tokenizer::simplifyComma()
|
||||||
{
|
{
|
||||||
// Handle "delete a, delete b;"
|
// Handle "delete a, delete b;"
|
||||||
tok->str(";");
|
tok->str(";");
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok->previous() && tok->previous()->previous())
|
if (tok->previous() && tok->previous()->previous())
|
||||||
|
@ -3591,7 +3589,6 @@ bool Tokenizer::simplifyComma()
|
||||||
// Handle "delete a, b;"
|
// Handle "delete a, b;"
|
||||||
tok->str(";");
|
tok->str(";");
|
||||||
tok->insertToken("delete");
|
tok->insertToken("delete");
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3601,7 +3598,6 @@ bool Tokenizer::simplifyComma()
|
||||||
{
|
{
|
||||||
// Handle "a = 0, b = 0;"
|
// Handle "a = 0, b = 0;"
|
||||||
tok->str(";");
|
tok->str(";");
|
||||||
ret = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (Token::Match(tok2, "delete %var%") ||
|
else if (Token::Match(tok2, "delete %var%") ||
|
||||||
|
@ -3609,7 +3605,6 @@ bool Tokenizer::simplifyComma()
|
||||||
{
|
{
|
||||||
// Handle "delete a, a = 0;"
|
// Handle "delete a, a = 0;"
|
||||||
tok->str(";");
|
tok->str(";");
|
||||||
ret = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (Token::Match(tok2, "[;,{}()]"))
|
else if (Token::Match(tok2, "[;,{}()]"))
|
||||||
|
@ -3705,11 +3700,8 @@ bool Tokenizer::simplifyComma()
|
||||||
startFrom->previous()->deleteThis();
|
startFrom->previous()->deleteThis();
|
||||||
|
|
||||||
tok = endAt;
|
tok = endAt;
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,10 +167,8 @@ private:
|
||||||
* Example: "delete a, delete b" => "delete a; delete b;"
|
* Example: "delete a, delete b" => "delete a; delete b;"
|
||||||
* Example: "a = 0, b = 0;" => "a = 0; b = 0;"
|
* Example: "a = 0, b = 0;" => "a = 0; b = 0;"
|
||||||
* Example: "return a(), b;" => "a(); return b;"
|
* 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
|
/** Add braces to an if-block
|
||||||
* @return true if something is modified
|
* @return true if something is modified
|
||||||
|
|
Loading…
Reference in New Issue