Skip to content

Commit 2f95d90

Browse files
committed
Change remaining long long to MathLib::bigint
1 parent 6c02e8d commit 2f95d90

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/infer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ std::vector<ValueFlow::Value> infer(const ValuePtr<InferModel>& model,
321321
} else {
322322
if (!diff.minvalue.empty()) {
323323
int adder(0);
324-
if (std::numeric_limits<long long>::min() < diff.minvalue.front())
324+
if (std::numeric_limits<MathLib::bigint>::min() < diff.minvalue.front())
325325
adder = -1;
326326
ValueFlow::Value value(diff.minvalue.front() + adder);
327327
value.setImpossible();
@@ -331,7 +331,7 @@ std::vector<ValueFlow::Value> infer(const ValuePtr<InferModel>& model,
331331
}
332332
if (!diff.maxvalue.empty()) {
333333
int adder(0);
334-
if (std::numeric_limits<long long>::max() > diff.maxvalue.front())
334+
if (std::numeric_limits<MathLib::bigint>::max() > diff.maxvalue.front())
335335
adder = 1;
336336
ValueFlow::Value value(diff.maxvalue.front() + adder);
337337
value.setImpossible();

lib/token.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,8 +2018,8 @@ static bool isAdjacent(const ValueFlow::Value& x, const ValueFlow::Value& y)
20182018

20192019
// original abs() is not safe against overflows:
20202020
// return std::abs(x.intvalue - y.intvalue) == 1;
2021-
return (y.intvalue != std::numeric_limits<long long>::max() && x.intvalue == y.intvalue + 1) ||
2022-
(y.intvalue != std::numeric_limits<long long>::min() && x.intvalue == y.intvalue - 1);
2021+
return (y.intvalue != std::numeric_limits<MathLib::bigint>::max() && x.intvalue == y.intvalue + 1) ||
2022+
(y.intvalue != std::numeric_limits<MathLib::bigint>::min() && x.intvalue == y.intvalue - 1);
20232023
}
20242024

20252025
static bool removePointValue(std::list<ValueFlow::Value>& values, std::list<ValueFlow::Value>::iterator& x)

lib/vf_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace ValueFlow
103103
return value;
104104

105105
// sizeof(long long) = 8
106-
value_size = std::min(sizeof(long long), value_size);
106+
value_size = std::min(sizeof(MathLib::bigint), value_size);
107107

108108
const MathLib::biguint unsignedMaxValue = std::numeric_limits<MathLib::biguint>::max() >> ((sizeof(unsignedMaxValue) - value_size) * 8);
109109
const MathLib::biguint signBit = 1ULL << (value_size * 8 - 1);

0 commit comments

Comments
 (0)