Skip to content

Commit 63e567e

Browse files
Remove simplifyKnownVariables() (danmar#4232)
* Remove simplifyKnownVariables() * Add some test cases back * Remove unused functions * Format
1 parent 11860cc commit 63e567e

9 files changed

Lines changed: 50 additions & 1464 deletions

lib/mathlib.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,23 +1037,6 @@ std::string MathLib::subtract(const std::string &first, const std::string &secon
10371037
#endif
10381038
}
10391039

1040-
std::string MathLib::incdec(const std::string & var, const std::string & op)
1041-
{
1042-
#ifdef TEST_MATHLIB_VALUE
1043-
if (op == "++")
1044-
return value(var).add(1).str();
1045-
else if (op == "--")
1046-
return value(var).add(-1).str();
1047-
#else
1048-
if (op == "++")
1049-
return MathLib::add(var, "1");
1050-
else if (op == "--")
1051-
return MathLib::subtract(var, "1");
1052-
#endif
1053-
1054-
throw InternalError(nullptr, std::string("Unexpected operation '") + op + "' in MathLib::incdec(). Please report this to Cppcheck developers.");
1055-
}
1056-
10571040
std::string MathLib::divide(const std::string &first, const std::string &second)
10581041
{
10591042
#ifdef TEST_MATHLIB_VALUE

lib/mathlib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class CPPCHECKLIB MathLib {
106106
static std::string multiply(const std::string & first, const std::string & second);
107107
static std::string divide(const std::string & first, const std::string & second);
108108
static std::string mod(const std::string & first, const std::string & second);
109-
static std::string incdec(const std::string & var, const std::string & op);
110109
static std::string calculate(const std::string & first, const std::string & second, char action);
111110

112111
static std::string sin(const std::string & tok);

0 commit comments

Comments
 (0)