From d66c92edc3f4d164be9a89dddbb8f456c8481400 Mon Sep 17 00:00:00 2001 From: Carlo Marcelo Arenas Belon Date: Thu, 4 Oct 2018 23:36:49 -0700 Subject: [PATCH] Remove unused parameters for CheckOther::oppositeExpressionError (#1412) --- lib/checkother.cpp | 4 ++-- lib/checkother.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index d7af3698a..7bf69fb2f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2008,7 +2008,7 @@ void CheckOther::checkDuplicateExpression() isOppositeExpression(mTokenizer->isCPP(), tok->astOperand1(), tok->astOperand2(), mSettings->library, false, true, &errorPath) && !Token::Match(tok, "=|-|-=|/|/=") && isWithoutSideEffects(mTokenizer->isCPP(), tok->astOperand1())) { - oppositeExpressionError(tok->astOperand1(), tok->astOperand2(), tok, errorPath); + oppositeExpressionError(tok, errorPath); } else if (!Token::Match(tok, "[-/%]")) { // These operators are not associative if (styleEnabled && tok->astOperand2() && tok->str() == tok->astOperand1()->str() && isSameExpression(mTokenizer->isCPP(), true, tok->astOperand2(), tok->astOperand1()->astOperand2(), mSettings->library, true, false, &errorPath) && isWithoutSideEffects(mTokenizer->isCPP(), tok->astOperand2())) duplicateExpressionError(tok->astOperand2(), tok->astOperand1()->astOperand2(), tok, errorPath); @@ -2037,7 +2037,7 @@ void CheckOther::checkDuplicateExpression() } } -void CheckOther::oppositeExpressionError(const Token *tok1, const Token *tok2, const Token *opTok, ErrorPath errors) +void CheckOther::oppositeExpressionError(const Token *opTok, ErrorPath errors) { errors.emplace_back(opTok, ""); diff --git a/lib/checkother.h b/lib/checkother.h index b150e53c9..4a0da0958 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -239,7 +239,7 @@ private: void misusedScopeObjectError(const Token *tok, const std::string &varname); void duplicateBranchError(const Token *tok1, const Token *tok2); void duplicateAssignExpressionError(const Token *tok1, const Token *tok2); - void oppositeExpressionError(const Token *tok1, const Token *tok2, const Token *opTok, ErrorPath errors); + void oppositeExpressionError(const Token *opTok, ErrorPath errors); void duplicateExpressionError(const Token *tok1, const Token *tok2, const Token *opTok, ErrorPath errors); void duplicateValueTernaryError(const Token *tok); void duplicateExpressionTernaryError(const Token *tok, ErrorPath errors); @@ -302,7 +302,7 @@ private: c.clarifyCalculationError(nullptr, "+"); c.clarifyStatementError(nullptr); c.duplicateBranchError(nullptr, nullptr); - c.oppositeExpressionError(nullptr, nullptr, nullptr, errorPath); + c.oppositeExpressionError(nullptr, errorPath); c.duplicateExpressionError(nullptr, nullptr, nullptr, errorPath); c.duplicateValueTernaryError(nullptr); c.duplicateExpressionTernaryError(nullptr, errorPath);