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

Function getMinMaxValues

lib/valueflow.cpp:7014–7028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7012}
7013
7014static bool getMinMaxValues(const std::string& typestr,
7015 const Settings& settings,
7016 bool cpp,
7017 MathLib::bigint& minvalue,
7018 MathLib::bigint& maxvalue)
7019{
7020 TokenList typeTokens(settings, cpp ? Standards::Language::CPP : Standards::Language::C);
7021 const std::string str(typestr + ";");
7022 if (!typeTokens.createTokensFromBuffer(str.data(), str.size()))
7023 return false;
7024 typeTokens.simplifyPlatformTypes();
7025 typeTokens.simplifyStdType();
7026 const ValueType& vt = ValueType::parseDecl(typeTokens.front(), settings);
7027 return ValueFlow::getMinMaxValues(&vt, settings.platform, minvalue, maxvalue);
7028}
7029
7030static void valueFlowSafeFunctions(const TokenList& tokenlist, const SymbolDatabase& symboldatabase, ErrorLogger& errorLogger, const Settings& settings)
7031{

Callers 2

valueFlowSafeFunctionsFunction · 0.70

Calls 6

frontMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
simplifyPlatformTypesMethod · 0.45
simplifyStdTypeMethod · 0.45

Tested by

no test coverage detected