Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Aug 20, 2023
1 parent 9a83720 commit 61a8d5a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
13 changes: 0 additions & 13 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,19 +1468,6 @@ static bool astIsBoolLike(const Token* tok)
return astIsBool(tok) || isUsedAsBool(tok);
}

bool isBooleanFuncArg(const Token* tok) {
if (tok->variable() && tok->variable()->valueType() && tok->variable()->valueType()->type == ValueType::BOOL) // skip trivial case: bool passed as bool
return false;
int argn{};
const Token* ftok = getTokenArgumentFunction(tok, argn);
if (!ftok)
return false;
std::vector<const Variable*> argvars = getArgumentVars(ftok, argn);
if (argvars.size() != 1)
return false;
return !argvars[0]->isReference() && argvars[0]->valueType() && argvars[0]->valueType()->type == ValueType::BOOL;
}

bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2, const Library& library, bool pure, bool followVar, ErrorPath* errors)
{
if (tok1 == nullptr && tok2 == nullptr)
Expand Down
5 changes: 0 additions & 5 deletions lib/astutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ const Token* isInLoopCondition(const Token* tok);
*/
CPPCHECKLIB bool isUsedAsBool(const Token * const tok);

/**
* Is token passed to a function taking a bool argument
*/
CPPCHECKLIB bool isBooleanFuncArg(const Token* tok);

/**
* Are two conditions opposite
* @param isNot do you want to know if cond1 is !cond2 or if cond1 and cond2 are non-overlapping. true: cond1==!cond2 false: cond1==true => cond2==false
Expand Down

0 comments on commit 61a8d5a

Please sign in to comment.