From 56747e4af9fd6f32c23da3618ff4a42fcc336009 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Mon, 16 Feb 2015 12:11:13 +0300 Subject: [PATCH] Reorder checks --- lib/checkother.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 124eedc50..6922612c4 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1643,18 +1643,18 @@ void CheckOther::checkCharVariable() } else if (Token::Match(tok, "[&|^]")) { + // Don't care about address-of operator + if (!tok->astOperand2()) + continue; + const Token *tok2; if (tok->astOperand1() && astIsSignedChar(tok->astOperand1())) tok2 = tok->astOperand2(); - else if (tok->astOperand2() && astIsSignedChar(tok->astOperand2())) + else if (astIsSignedChar(tok->astOperand2())) tok2 = tok->astOperand1(); else continue; - // Don't care about address-of operator - if (!tok->astOperand2()) - continue; - // it's ok with a bitwise and where the other operand is 0xff or less.. if (tok->str() == "&" && tok2 && tok2->isNumber() && MathLib::isGreater("0x100", tok2->str())) continue;