Skip to content

Commit 1a25d3f

Browse files
committed
astyle formatting
[ci skip]
1 parent 0b9e823 commit 1a25d3f

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

lib/valueflow.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ static bool valueFlowForward(Token * const startToken,
22152215
// conditional block of code that assigns variable..
22162216
else if (!tok2->varId() && Token::Match(tok2, "%name% (") && Token::simpleMatch(tok2->linkAt(1), ") {")) {
22172217
// is variable changed in condition?
2218-
for(int i:getIndirections(values)) {
2218+
for (int i:getIndirections(values)) {
22192219
Token* tokChanged = findVariableChanged(tok2->next(), tok2->next()->link(), i, varid, var->isGlobal(), settings, tokenlist->isCPP());
22202220
if (tokChanged != nullptr) {
22212221
// Set the value before bailing
@@ -2226,7 +2226,9 @@ static bool valueFlowForward(Token * const startToken,
22262226
setTokenValue(tokChanged, v, settings);
22272227
}
22282228
}
2229-
values.remove_if([&](const ValueFlow::Value& v) { return v.indirect == i; });
2229+
values.remove_if([&](const ValueFlow::Value& v) {
2230+
return v.indirect == i;
2231+
});
22302232
}
22312233
}
22322234
if (values.empty()) {
@@ -2748,10 +2750,12 @@ static bool valueFlowForward(Token * const startToken,
27482750
}
27492751

27502752
// assigned by subfunction?
2751-
for(int i:getIndirections(values)) {
2753+
for (int i:getIndirections(values)) {
27522754
bool inconclusive = false;
27532755
if (isVariableChangedByFunctionCall(tok2, i, settings, &inconclusive)) {
2754-
values.remove_if([&](const ValueFlow::Value& v) { return v.indirect <= i; });
2756+
values.remove_if([&](const ValueFlow::Value& v) {
2757+
return v.indirect <= i;
2758+
});
27552759
}
27562760
if (inconclusive) {
27572761
for (ValueFlow::Value &v : values) {
@@ -2777,11 +2781,13 @@ static bool valueFlowForward(Token * const startToken,
27772781
}
27782782
}
27792783
// Variable changed
2780-
for(int i:getIndirections(values)) {
2784+
for (int i:getIndirections(values)) {
27812785
// Remove unintialized values if modified
27822786
if (isVariableChanged(tok2, i, settings, tokenlist->isCPP()))
2783-
values.remove_if([&](const ValueFlow::Value& v) { return v.isUninitValue() && v.indirect <= i; });
2784-
}
2787+
values.remove_if([&](const ValueFlow::Value& v) {
2788+
return v.isUninitValue() && v.indirect <= i;
2789+
});
2790+
}
27852791
} else if (isAliasOf(var, tok2, varid, values) && isVariableChanged(tok2, 0, settings, tokenlist->isCPP())) {
27862792
if (settings->debugwarnings)
27872793
bailout(tokenlist, errorLogger, tok2, "Alias variable was modified.");

0 commit comments

Comments
 (0)