From 3e1df1b46347d4b05577cdde4a106dbb4178788d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 13 Mar 2011 12:16:55 +0100 Subject: [PATCH] Clarify condition: re-enabled check --- lib/checkother.cpp | 5 ++++- lib/checkother.h | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 387b247f5..1d293a8ab 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -136,7 +136,10 @@ void CheckOther::clarifyCondition() { if (tok2->str() == "(" || tok2->str() == "[") tok2 = tok2->link(); - else if (tok2->str() == "||" || tok2->str() == "&&" || tok2->str() == "?") + else if (tok2->str() == "||" || + tok2->str() == "&&" || + tok2->str() == "?" || + tok2->str() == ")") break; else if (Token::Match(tok2, "<|<=|==|!=|>|>= %num% )")) { diff --git a/lib/checkother.h b/lib/checkother.h index f845332c3..50d6cc80d 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -65,8 +65,7 @@ public: checkOther.checkSizeofForArrayParameter(); checkOther.checkSelfAssignment(); - // I'll just fix a few false positives and then uncomment - // checkOther.clarifyCondition(); // not simplified because ifAssign + checkOther.clarifyCondition(); // not simplified because ifAssign } /** @brief Run checks against the simplified token list */