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

Function checkIntRelation

lib/checkcondition.cpp:1014–1022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012
1013template<typename T>
1014static bool checkIntRelation(const std::string &op, const T value1, const T value2)
1015{
1016 return (op == "==" && value1 == value2) ||
1017 (op == "!=" && value1 != value2) ||
1018 (op == ">" && value1 > value2) ||
1019 (op == ">=" && value1 >= value2) ||
1020 (op == "<" && value1 < value2) ||
1021 (op == "<=" && value1 <= value2);
1022}
1023
1024static bool checkFloatRelation(const std::string &op, const double value1, const double value2)
1025{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected