Skip to content

Commit 27282f2

Browse files
committed
Fix
1 parent 32ee464 commit 27282f2

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

lib/vfvalue.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
namespace ValueFlow {
2929
Value::Value(const Token *c, MathLib::bigint val, Bound b)
30-
: valueType(ValueType::INT),
31-
bound(b),
32-
flow(Flow::UNKNOWN),
30+
: bound(b),
3331
safe(false),
3432
conditional(false),
3533
macro(false),

lib/vfvalue.h

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ namespace ValueFlow
4545
enum class Bound : std::uint8_t { Upper, Lower, Point };
4646

4747
explicit Value(MathLib::bigint val = 0, Bound b = Bound::Point) :
48-
valueType(ValueType::INT),
4948
bound(b),
50-
flow(Flow::UNKNOWN),
5149
safe(false),
5250
conditional(false),
5351
macro(false),
@@ -214,7 +212,7 @@ namespace ValueFlow
214212
ITERATOR_START,
215213
ITERATOR_END,
216214
SYMBOLIC
217-
} valueType : 4;
215+
} valueType = ValueType::INT;
218216
bool isIntValue() const {
219217
return valueType == ValueType::INT;
220218
}
@@ -269,19 +267,7 @@ namespace ValueFlow
269267
}
270268

271269
/** The value bound */
272-
Bound bound : 2;
273-
274-
enum class Flow : std::uint8_t {
275-
UNKNOWN,
276-
FORWARD,
277-
REVERSE
278-
} flow : 2;
279-
bool isReverse() const {
280-
return flow == Flow::REVERSE;
281-
}
282-
void setFlow(Flow f) {
283-
flow = f;
284-
}
270+
Bound bound = Bound::Point;
285271

286272
/** value relies on safe checking */
287273
// cppcheck-suppress premium-misra-cpp-2023-12.2.1
@@ -360,7 +346,19 @@ namespace ValueFlow
360346
};
361347
UnknownFunctionReturn unknownFunctionReturn{UnknownFunctionReturn::no};
362348

363-
long long : 24; // padding
349+
enum class Flow : std::uint8_t {
350+
UNKNOWN,
351+
FORWARD,
352+
REVERSE
353+
} flow = Flow::UNKNOWN;
354+
bool isReverse() const {
355+
return flow == Flow::REVERSE;
356+
}
357+
void setFlow(Flow f) {
358+
flow = f;
359+
}
360+
361+
long long : 16; // padding
364362

365363
/** Path id */
366364
MathLib::bigint path{};

0 commit comments

Comments
 (0)