From e94e3eca828f9dfd31a9ea3535133b7284bc4a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 10 Apr 2011 11:47:49 +0200 Subject: [PATCH] Preprocessor: Use %oror% in multiCompare pattern --- lib/preprocessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index a648e76ea..185224423 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -1478,8 +1478,8 @@ void Preprocessor::simplifyCondition(const std::map &v } } } - else if ((!tok->previous() || tok->strAt(-1) == "||" || tok->strAt(-1) == "&&" || tok->strAt(-1) == "(") && - (!tok->next() || tok->strAt(1) == "||" || tok->strAt(1) == "&&" || tok->strAt(1) == ")")) + else if ((!tok->previous() || Token::Match(tok->previous(), "&&|%oror%|(")) && + (!tok->next() || Token::Match(tok->next(), "&&|%oror%|)"))) tok->str("1"); else tok->deleteThis();