From 09f7c07a4da2be5dd709ea08868e28d5add504b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 5 Dec 2008 18:25:08 +0000 Subject: [PATCH] tokenize: Minor refactorings --- tokenize.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tokenize.cpp b/tokenize.cpp index d5120a2dc..d0d92eec5 100644 --- a/tokenize.cpp +++ b/tokenize.cpp @@ -901,7 +901,7 @@ void Tokenizer::simplifyTokenList() if (tok2) { - if (tok2->aaaa0() == ',') + if (tok2->str() == ",") { tok2->setstr(";"); InsertTokens(tok2, type0, typelen); @@ -1008,8 +1008,7 @@ bool Tokenizer::simplifyConditions() // Reduce "(%num% == %num%)" => "(true)"/"(false)" if ( (TOKEN::Match(tok, "&&") || TOKEN::Match(tok, "||") || TOKEN::Match(tok, "(")) && - TOKEN::Match(tok->tokAt(1), "%num%") && - TOKEN::Match(tok->tokAt(3), "%num%") && + TOKEN::Match(tok->tokAt(1), "%num% %any% %num%") && (TOKEN::Match(tok->tokAt(4), "&&") || TOKEN::Match(tok->tokAt(4), "||") || TOKEN::Match(tok->tokAt(4), ")")) ) { double op1 = (strstr(tok->strAt(1), "0x")) ? strtol(tok->strAt(1),0,16) : atof( tok->strAt(1) );