Refactoring: Use %op%

This commit is contained in:
Daniel Marjamäki 2011-04-09 18:30:47 +02:00
parent 0730fad778
commit 447f61e9c7
2 changed files with 2 additions and 2 deletions

View File

@ -7223,7 +7223,7 @@ bool Tokenizer::simplifyCalculations()
// keep parentheses here: operator new [] (size_t); // keep parentheses here: operator new [] (size_t);
// keep parentheses here: Functor()(a ... ) // keep parentheses here: Functor()(a ... )
// keep parentheses here: ) ( var ) ; // keep parentheses here: ) ( var ) ;
if (Token::Match(tok->next(), "( %var% ) [;),+-*/><]]") && if (Token::Match(tok->next(), "( %var% ) ;|)|,|]|%op%") &&
!tok->isName() && !tok->isName() &&
tok->str() != ">" && tok->str() != ">" &&
tok->str() != "]" && tok->str() != "]" &&

View File

@ -381,7 +381,7 @@ private:
void simplifyTokenList1() void simplifyTokenList1()
{ {
// #1717 : The simplifyErrNoInWhile needs to be used before simplifyIfAssign.. // #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)); tok(";while((x=f())==-1 && errno==EINTR){}",true));
} }