Skip to content

Commit

Permalink
Make function static
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Dec 1, 2023
1 parent 89ba709 commit 5bdc750
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/programmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <utility>
#include <vector>

#include <iostream>

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

nonneg int ExprIdToken::getExpressionId() const {
Expand Down Expand Up @@ -1267,7 +1269,7 @@ namespace {
return result;
}

std::vector<const Token*> flattenConditionsSorted(const Token* tok) const
static std::vector<const Token*> flattenConditionsSorted(const Token* tok)
{
std::vector<const Token*> result = astFlatten(tok, tok->str().c_str());
if (std::any_of(result.begin(), result.end(), [](const Token* child) {
Expand Down Expand Up @@ -1307,6 +1309,7 @@ namespace {
if (isTrueOrFalse(v, b))
return v;
}

for (const auto& p : *pm) {
const Token* tok = p.first.tok;
const ValueFlow::Value& value = p.second;
Expand All @@ -1327,6 +1330,8 @@ namespace {
pruneConditions(diffConditions2, b, executeAll(diffConditions2));
if (diffConditions1.size() != diffConditions2.size())
continue;
if(diffConditions1.size() == conditions1.size())
continue;
for (const Token* cond1 : diffConditions1) {
auto it = std::find_if(diffConditions2.begin(), diffConditions2.end(), [&](const Token* cond2) {
return evalSameCondition(*pm, cond2, cond1, settings);
Expand All @@ -1337,6 +1342,7 @@ namespace {
}
if (diffConditions2.empty())
return value;

}
}
return unknown;
Expand Down

0 comments on commit 5bdc750

Please sign in to comment.