Reorder checks
This commit is contained in:
parent
77a9822a97
commit
56747e4af9
|
@ -1643,18 +1643,18 @@ void CheckOther::checkCharVariable()
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Token::Match(tok, "[&|^]")) {
|
else if (Token::Match(tok, "[&|^]")) {
|
||||||
|
// Don't care about address-of operator
|
||||||
|
if (!tok->astOperand2())
|
||||||
|
continue;
|
||||||
|
|
||||||
const Token *tok2;
|
const Token *tok2;
|
||||||
if (tok->astOperand1() && astIsSignedChar(tok->astOperand1()))
|
if (tok->astOperand1() && astIsSignedChar(tok->astOperand1()))
|
||||||
tok2 = tok->astOperand2();
|
tok2 = tok->astOperand2();
|
||||||
else if (tok->astOperand2() && astIsSignedChar(tok->astOperand2()))
|
else if (astIsSignedChar(tok->astOperand2()))
|
||||||
tok2 = tok->astOperand1();
|
tok2 = tok->astOperand1();
|
||||||
else
|
else
|
||||||
continue;
|
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..
|
// 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()))
|
if (tok->str() == "&" && tok2 && tok2->isNumber() && MathLib::isGreater("0x100", tok2->str()))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue