MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / valueFlowNumber

Function valueFlowNumber

lib/valueflow.cpp:425–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425static void valueFlowNumber(TokenList &tokenlist, const Settings& settings)
426{
427 for (Token *tok = tokenlist.front(); tok;) {
428 tok = ValueFlow::valueFlowSetConstantValue(tok, settings);
429 }
430
431 if (tokenlist.isCPP() || settings.standards.c >= Standards::C23) {
432 for (Token *tok = tokenlist.front(); tok; tok = tok->next()) {
433 if (Token::Match(tok, "[(,] NULL [,)]")) {
434 // NULL function parameters are not simplified in the
435 // normal tokenlist
436 ValueFlow::Value value(0);
437 if (!tok->isTemplateArg())
438 value.setKnown();
439 setTokenValue(tok->next(), std::move(value), settings);
440 }
441 }
442 }
443}
444
445static void valueFlowString(TokenList& tokenlist, const Settings& settings)
446{

Callers 1

setValuesMethod · 0.85

Calls 5

setTokenValueFunction · 0.85
frontMethod · 0.80
isCPPMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected