From 447f61e9c7912626d45fa7ef5320030066c676f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 9 Apr 2011 18:30:47 +0200 Subject: [PATCH] Refactoring: Use %op% --- lib/tokenize.cpp | 2 +- test/testsimplifytokens.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ac250b0fc..3a985df92 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7223,7 +7223,7 @@ bool Tokenizer::simplifyCalculations() // keep parentheses here: operator new [] (size_t); // keep parentheses here: Functor()(a ... ) // keep parentheses here: ) ( var ) ; - if (Token::Match(tok->next(), "( %var% ) [;),+-*/><]]") && + if (Token::Match(tok->next(), "( %var% ) ;|)|,|]|%op%") && !tok->isName() && tok->str() != ">" && tok->str() != "]" && diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 53cdf121f..329fa0276 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -381,7 +381,7 @@ private: void simplifyTokenList1() { // #1717 : The simplifyErrNoInWhile needs to be used before simplifyIfAssign.. - ASSERT_EQUALS("; x = f ( ) ; while ( ( x ) == -1 ) { x = f ( ) ; }", + ASSERT_EQUALS("; x = f ( ) ; while ( x == -1 ) { x = f ( ) ; }", tok(";while((x=f())==-1 && errno==EINTR){}",true)); }