Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions lib/mathlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,23 +1037,6 @@ std::string MathLib::subtract(const std::string &first, const std::string &secon
#endif
}

std::string MathLib::incdec(const std::string & var, const std::string & op)
{
#ifdef TEST_MATHLIB_VALUE
if (op == "++")
return value(var).add(1).str();
else if (op == "--")
return value(var).add(-1).str();
#else
if (op == "++")
return MathLib::add(var, "1");
else if (op == "--")
return MathLib::subtract(var, "1");
#endif

throw InternalError(nullptr, std::string("Unexpected operation '") + op + "' in MathLib::incdec(). Please report this to Cppcheck developers.");
}

std::string MathLib::divide(const std::string &first, const std::string &second)
{
#ifdef TEST_MATHLIB_VALUE
Expand Down
1 change: 0 additions & 1 deletion lib/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class CPPCHECKLIB MathLib {
static std::string multiply(const std::string & first, const std::string & second);
static std::string divide(const std::string & first, const std::string & second);
static std::string mod(const std::string & first, const std::string & second);
static std::string incdec(const std::string & var, const std::string & op);
static std::string calculate(const std::string & first, const std::string & second, char action);

static std::string sin(const std::string & tok);
Expand Down
Loading