Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Dec 11, 2023
1 parent 990e60d commit a707396
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/programmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ namespace {
static bool updateValue(ValueFlow::Value& v, ValueFlow::Value x)
{
const bool returnValue = !x.isUninitValue() && !x.isImpossible();
if(v.isUninitValue() || returnValue)
if (v.isUninitValue() || returnValue)
v = std::move(x);
return returnValue;
}
Expand Down Expand Up @@ -1671,7 +1671,7 @@ namespace {
if (value.tokvalue->exprId() > 0 && !pm->hasValue(value.tokvalue->exprId()))
continue;
ValueFlow::Value v2 = pm->at(value.tokvalue->exprId());
if(!v2.isIntValue() && value.intvalue != 0)
if (!v2.isIntValue() && value.intvalue != 0)
continue;
v2.intvalue += value.intvalue;
if (updateValue(v, std::move(v2)))
Expand Down
24 changes: 12 additions & 12 deletions test/testvalueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5646,18 +5646,18 @@ class TestValueFlow : public TestFixture {
ASSERT_EQUALS(0, values.size());

code = "void getX(int *p);\n"
"bool do_something();\n"
"void foo() {\n"
" int x;\n"
" bool flag;\n"
" bool success;\n"
" success = do_something();\n"
" flag = success;\n"
" if (success == true) {\n"
" getX(&x);\n"
" }\n"
" for (int i = 0; (flag == true) && (i < x); ++i) {}\n"
"}\n";
"bool do_something();\n"
"void foo() {\n"
" int x;\n"
" bool flag;\n"
" bool success;\n"
" success = do_something();\n"
" flag = success;\n"
" if (success == true) {\n"
" getX(&x);\n"
" }\n"
" for (int i = 0; (flag == true) && (i < x); ++i) {}\n"
"}\n";
values = tokenValues(code, "x ) ; ++ i", ValueFlow::Value::ValueType::UNINIT);
ASSERT_EQUALS(0, values.size());

Expand Down

0 comments on commit a707396

Please sign in to comment.