diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 61f76e8e2..2c4b90beb 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2356,12 +2356,10 @@ static void incdec(std::string &value, const std::string &op) -bool Tokenizer::simplifyVarDecl() +void Tokenizer::simplifyVarDecl() { // Split up variable declarations.. // "int a=4;" => "int a; a=4;" - bool ret = false; - for (Token *tok = _tokens; tok; tok = tok->next()) { if (tok->previous() && !Token::Match(tok->previous(), "[{};)]")) @@ -2506,8 +2504,6 @@ bool Tokenizer::simplifyVarDecl() if (tok2) { - ret = true; - if (tok2->str() == ",") { tok2->str(";"); @@ -2556,8 +2552,6 @@ bool Tokenizer::simplifyVarDecl() } } } - - return ret; } diff --git a/src/tokenize.h b/src/tokenize.h index 9356c955f..b0c3efb34 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -118,10 +118,8 @@ private: /** * Simplify variable declarations - * @return true if something is modified - * false if nothing is done. */ - bool simplifyVarDecl(); + void simplifyVarDecl(); /** * insert an "int" after "unsigned" if needed: