Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Nov 25, 2023
1 parent cf9445a commit 1284bc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool astHasVar(const Token * tok, nonneg int varid)
return astHasVar(tok->astOperand1(), varid) || astHasVar(tok->astOperand2(), varid);
}

bool astHasExpr(const Token * tok, nonneg int exprid)
bool astHasExpr(const Token* tok, nonneg int exprid)
{
if (!tok)
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/astutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ nonneg int astCount(const Token* tok, const char* op, int depth = 100);

bool astHasToken(const Token* root, const Token * tok);

bool astHasExpr(const Token * tok, nonneg int exprid);
bool astHasExpr(const Token* tok, nonneg int exprid);
bool astHasVar(const Token * tok, nonneg int varid);

bool astIsPrimitive(const Token* tok);
Expand Down
14 changes: 7 additions & 7 deletions lib/programmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
#include <utility>
#include <vector>



ExprIdToken::ExprIdToken(const Token* tok)
: tok(tok), exprid(tok ? tok->exprId() : 0) {}
ExprIdToken::ExprIdToken(const Token* tok) : tok(tok), exprid(tok ? tok->exprId() : 0) {}

nonneg int ExprIdToken::getExpressionId() const {
return tok ? tok->exprId() : exprid;
Expand Down Expand Up @@ -1331,7 +1328,8 @@ namespace {
std::vector<const Token*> conditions2 = flattenConditionsSorted(tok);
if (conditions2.empty())
continue;
if (std::equal(conditions1.begin(), conditions1.end(), conditions2.begin(), conditions2.end(), &TokenExprIdCompare))
if (std::equal(
conditions1.begin(), conditions1.end(), conditions2.begin(), conditions2.end(), &TokenExprIdCompare))
return value;
std::vector<const Token*> diffConditions1 = setDifference(conditions1, conditions2);
std::vector<const Token*> diffConditions2 = setDifference(conditions2, conditions1);
Expand Down Expand Up @@ -1618,7 +1616,9 @@ namespace {
ValueFlow::Value execute(const Token* expr)
{
depth--;
OnExit onExit{[&] { depth++; }};
OnExit onExit{[&] {
depth++;
}};
if (depth < 0)
return unknown;
ValueFlow::Value v = executeImpl(expr);
Expand Down Expand Up @@ -1685,7 +1685,7 @@ namespace {
return {};
}
};
} // namespace
} // namespace

static ValueFlow::Value execute(const Token* expr, ProgramMemory& pm, const Settings* settings)
{
Expand Down

0 comments on commit 1284bc7

Please sign in to comment.