Clarify expressions with parentheses
This commit is contained in:
parent
e356ccca22
commit
8709490903
|
@ -481,9 +481,9 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti
|
||||||
if (!f && !value1->isIntValue() && !value2->isIntValue())
|
if (!f && !value1->isIntValue() && !value2->isIntValue())
|
||||||
break;
|
break;
|
||||||
if (parent->str() == ">")
|
if (parent->str() == ">")
|
||||||
result.intvalue = f ? floatValue1 > floatValue2 : value1->intvalue > value2->intvalue;
|
result.intvalue = f ? (floatValue1 > floatValue2) : (value1->intvalue > value2->intvalue);
|
||||||
else if (parent->str() == ">=")
|
else if (parent->str() == ">=")
|
||||||
result.intvalue = f ? floatValue1 >= floatValue2 : value1->intvalue >= value2->intvalue;
|
result.intvalue = f ? (floatValue1 >= floatValue2) : (value1->intvalue >= value2->intvalue);
|
||||||
else if (!f && parent->str() == ">>" && value1->intvalue >= 0 && value2->intvalue >= 0 && value2->intvalue < 64)
|
else if (!f && parent->str() == ">>" && value1->intvalue >= 0 && value2->intvalue >= 0 && value2->intvalue < 64)
|
||||||
result.intvalue = value1->intvalue >> value2->intvalue;
|
result.intvalue = value1->intvalue >> value2->intvalue;
|
||||||
else
|
else
|
||||||
|
@ -496,9 +496,9 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti
|
||||||
if (!f && !value1->isIntValue() && !value2->isIntValue())
|
if (!f && !value1->isIntValue() && !value2->isIntValue())
|
||||||
break;
|
break;
|
||||||
if (parent->str() == "<")
|
if (parent->str() == "<")
|
||||||
result.intvalue = f ? floatValue1 < floatValue2 : value1->intvalue < value2->intvalue;
|
result.intvalue = f ? (floatValue1 < floatValue2) : (value1->intvalue < value2->intvalue);
|
||||||
else if (parent->str() == "<=")
|
else if (parent->str() == "<=")
|
||||||
result.intvalue = f ? floatValue1 <= floatValue2 : value1->intvalue <= value2->intvalue;
|
result.intvalue = f ? (floatValue1 <= floatValue2) : (value1->intvalue <= value2->intvalue);
|
||||||
else if (!f && parent->str() == "<<" && value1->intvalue >= 0 && value2->intvalue >= 0 && value2->intvalue < 64)
|
else if (!f && parent->str() == "<<" && value1->intvalue >= 0 && value2->intvalue >= 0 && value2->intvalue < 64)
|
||||||
result.intvalue = value1->intvalue << value2->intvalue;
|
result.intvalue = value1->intvalue << value2->intvalue;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue