From a1f40f3c1779dcc54cf0140e067fde5fdf6ebc2d Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sun, 30 Aug 2009 02:25:15 +0700 Subject: [PATCH] Tokenizer::simplifyIfAddBraces(): change return type to void. No functional change. --- src/tokenize.cpp | 9 ++------- src/tokenize.h | 4 +--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 8af0bd6f1..3e85ae2ec 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -1794,10 +1794,8 @@ bool Tokenizer::removeReduntantConditions() return ret; } -bool Tokenizer::simplifyIfAddBraces() +void Tokenizer::simplifyIfAddBraces() { - bool ret = false; - for (Token *tok = _tokens; tok; tok = tok ? tok->next() : NULL) { if (Token::Match(tok, "if|for|while (")) @@ -1834,7 +1832,7 @@ bool Tokenizer::simplifyIfAddBraces() // If there is no code after he if(), abort if (!tok->next()) - return false; + return; // insert open brace.. @@ -1875,11 +1873,8 @@ bool Tokenizer::simplifyIfAddBraces() { tempToken->insertToken("}"); Token::createMutualLinks(tok, tempToken->next()); - ret = true; } } - - return ret; } bool Tokenizer::simplifyDoWhileAddBraces() diff --git a/src/tokenize.h b/src/tokenize.h index fc1a43c52..f12089444 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -171,10 +171,8 @@ private: void simplifyComma(); /** Add braces to an if-block - * @return true if something is modified - * false if nothing is done. */ - bool simplifyIfAddBraces(); + void simplifyIfAddBraces(); /** Add braces to an do-while block * @return true if something is modified