Tokenizer::simplifyCasts(): change return type to void.
No functional change.
This commit is contained in:
parent
6f93182580
commit
1cb1709d7c
|
@ -2158,9 +2158,8 @@ bool Tokenizer::simplifyQuestionMark()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tokenizer::simplifyCasts()
|
void Tokenizer::simplifyCasts()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (Token::Match(tok->next(), "( %type% *| )") || Token::Match(tok->next(), "( %type% %type% *| )"))
|
if (Token::Match(tok->next(), "( %type% *| )") || Token::Match(tok->next(), "( %type% %type% *| )"))
|
||||||
|
@ -2177,8 +2176,6 @@ bool Tokenizer::simplifyCasts()
|
||||||
|
|
||||||
// Remove cast..
|
// Remove cast..
|
||||||
Token::eraseTokens(tok, tok->next()->link()->next());
|
Token::eraseTokens(tok, tok->next()->link()->next());
|
||||||
|
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Token::Match(tok->next(), "dynamic_cast|reinterpret_cast|const_cast|static_cast <"))
|
else if (Token::Match(tok->next(), "dynamic_cast|reinterpret_cast|const_cast|static_cast <"))
|
||||||
|
@ -2213,13 +2210,9 @@ bool Tokenizer::simplifyCasts()
|
||||||
}
|
}
|
||||||
if (tok2->next())
|
if (tok2->next())
|
||||||
tok2->deleteNext();
|
tok2->deleteNext();
|
||||||
|
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -192,11 +192,10 @@ private:
|
||||||
*/
|
*/
|
||||||
bool simplifyDoWhileAddBraces();
|
bool simplifyDoWhileAddBraces();
|
||||||
|
|
||||||
/** Simplify casts
|
/**
|
||||||
* @return true if something is modified
|
* Simplify casts
|
||||||
* false if nothing is done.
|
|
||||||
*/
|
*/
|
||||||
bool simplifyCasts();
|
void simplifyCasts();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simplify function that replaces a variable with its value in cases
|
* A simplify function that replaces a variable with its value in cases
|
||||||
|
|
Loading…
Reference in New Issue