@@ -360,7 +360,7 @@ static bool match(const Token *tok, const std::string &rhs)
360
360
{
361
361
if (tok->str () == rhs)
362
362
return true ;
363
- if (!tok->varId () && tok->hasKnownIntValue () && MathLib::toString (tok->values (). front (). intvalue ) == rhs)
363
+ if (!tok->varId () && tok->hasKnownIntValue () && MathLib::toString (tok->getKnownIntValue () ) == rhs)
364
364
return true ;
365
365
return false ;
366
366
}
@@ -1524,7 +1524,7 @@ bool isUsedAsBool(const Token* const tok, const Settings& settings)
1524
1524
if (parent->isUnaryOp (" *" ))
1525
1525
return isUsedAsBool (parent, settings);
1526
1526
if (Token::Match (parent, " ==|!=" ) && (tok->astSibling ()->isNumber () || tok->astSibling ()->isKeyword ()) && tok->astSibling ()->hasKnownIntValue () &&
1527
- tok->astSibling ()->values (). front (). intvalue == 0 )
1527
+ tok->astSibling ()->getKnownIntValue () == 0 )
1528
1528
return true ;
1529
1529
if (parent->str () == " (" && astIsRHS (tok) && Token::Match (parent->astOperand1 (), " if|while" ))
1530
1530
return true ;
@@ -1657,10 +1657,10 @@ bool isSameExpression(bool macro, const Token *tok1, const Token *tok2, const Se
1657
1657
const Token* varTok2 = exprTok;
1658
1658
const ValueFlow::Value* value = nullptr ;
1659
1659
if (condTok->astOperand1 ()->hasKnownIntValue ()) {
1660
- value = & condTok->astOperand1 ()->values (). front ( );
1660
+ value = condTok->astOperand1 ()->getKnownValue (ValueFlow::Value::ValueType::INT );
1661
1661
varTok1 = condTok->astOperand2 ();
1662
1662
} else if (condTok->astOperand2 ()->hasKnownIntValue ()) {
1663
- value = & condTok->astOperand2 ()->values (). front ( );
1663
+ value = condTok->astOperand2 ()->getKnownValue (ValueFlow::Value::ValueType::INT );
1664
1664
varTok1 = condTok->astOperand1 ();
1665
1665
}
1666
1666
const bool exprIsNot = Token::simpleMatch (exprTok, " !" );
0 commit comments