diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 33505731b..61f76e8e2 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2158,9 +2158,8 @@ bool Tokenizer::simplifyQuestionMark() return ret; } -bool Tokenizer::simplifyCasts() +void Tokenizer::simplifyCasts() { - bool ret = false; for (Token *tok = _tokens; tok; tok = tok->next()) { if (Token::Match(tok->next(), "( %type% *| )") || Token::Match(tok->next(), "( %type% %type% *| )")) @@ -2177,8 +2176,6 @@ bool Tokenizer::simplifyCasts() // Remove cast.. Token::eraseTokens(tok, tok->next()->link()->next()); - - ret = true; } else if (Token::Match(tok->next(), "dynamic_cast|reinterpret_cast|const_cast|static_cast <")) @@ -2213,13 +2210,9 @@ bool Tokenizer::simplifyCasts() } if (tok2->next()) tok2->deleteNext(); - - ret = true; } } } - - return ret; } diff --git a/src/tokenize.h b/src/tokenize.h index a5ba86e82..9356c955f 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -192,11 +192,10 @@ private: */ bool simplifyDoWhileAddBraces(); - /** Simplify casts - * @return true if something is modified - * false if nothing is done. + /** + * Simplify casts */ - bool simplifyCasts(); + void simplifyCasts(); /** * A simplify function that replaces a variable with its value in cases