mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-17 07:36:53 +00:00
clang-tidy: rename MantissaScale enums from "3_2_0" to "320"
This commit is contained in:
@@ -130,15 +130,15 @@ struct MantissaRange final
|
||||
Small,
|
||||
// LargeLegacy can be removed when fixCleanup3_2_0 is retired
|
||||
LargeLegacy,
|
||||
// Large3_2_0 can be removed when fixCleanup3_3_0 is retired
|
||||
Large3_2_0,
|
||||
// Large320 can be removed when fixCleanup3_3_0 is retired
|
||||
Large320,
|
||||
Large,
|
||||
};
|
||||
|
||||
// This entire enum can be removed when fixCleanup3_2_0 is retired
|
||||
enum class CuspRoundingFix : std::uint8_t {
|
||||
Disabled = 0,
|
||||
Enabled3_2_0 = 1,
|
||||
Enabled320 = 1,
|
||||
Enabled = 2,
|
||||
};
|
||||
|
||||
@@ -167,7 +167,7 @@ private:
|
||||
case MantissaScale::Small:
|
||||
return 15;
|
||||
case MantissaScale::LargeLegacy:
|
||||
case MantissaScale::Large3_2_0:
|
||||
case MantissaScale::Large320:
|
||||
case MantissaScale::Large:
|
||||
return 18;
|
||||
// LCOV_EXCL_START
|
||||
@@ -197,8 +197,8 @@ private:
|
||||
case MantissaScale::Small:
|
||||
case MantissaScale::LargeLegacy:
|
||||
return CuspRoundingFix::Disabled;
|
||||
case MantissaScale::Large3_2_0:
|
||||
return CuspRoundingFix::Enabled3_2_0;
|
||||
case MantissaScale::Large320:
|
||||
return CuspRoundingFix::Enabled320;
|
||||
case MantissaScale::Large:
|
||||
return CuspRoundingFix::Enabled;
|
||||
default:
|
||||
@@ -883,7 +883,7 @@ to_string(MantissaRange::MantissaScale const& scale)
|
||||
return "Small";
|
||||
case MantissaRange::MantissaScale::LargeLegacy:
|
||||
return "LargeLegacy";
|
||||
case MantissaRange::MantissaScale::Large3_2_0:
|
||||
case MantissaRange::MantissaScale::Large320:
|
||||
return "Large320";
|
||||
case MantissaRange::MantissaScale::Large:
|
||||
return "Large";
|
||||
|
||||
@@ -39,7 +39,7 @@ MantissaRange::getAllScales()
|
||||
static std::set<MantissaRange::MantissaScale> const kScales = {
|
||||
MantissaRange::MantissaScale::Small,
|
||||
MantissaRange::MantissaScale::LargeLegacy,
|
||||
MantissaRange::MantissaScale::Large3_2_0,
|
||||
MantissaRange::MantissaScale::Large320,
|
||||
MantissaRange::MantissaScale::Large,
|
||||
};
|
||||
return kScales;
|
||||
@@ -81,14 +81,14 @@ MantissaRange::getRanges()
|
||||
}
|
||||
{
|
||||
[[maybe_unused]]
|
||||
constexpr static MantissaRange kRange{MantissaRange::MantissaScale::Large3_2_0};
|
||||
constexpr static MantissaRange kRange{MantissaRange::MantissaScale::Large320};
|
||||
static_assert(isPowerOfTen(kRange.min));
|
||||
static_assert(kRange.min == 1'000'000'000'000'000'000ULL);
|
||||
static_assert(kRange.max == rep(9'999'999'999'999'999'999ULL));
|
||||
static_assert(kRange.log == 18);
|
||||
static_assert(kRange.min < Number::kMaxRep);
|
||||
static_assert(kRange.max > Number::kMaxRep);
|
||||
static_assert(kRange.cuspRoundingFix == CuspRoundingFix::Enabled3_2_0);
|
||||
static_assert(kRange.cuspRoundingFix == CuspRoundingFix::Enabled320);
|
||||
}
|
||||
{
|
||||
[[maybe_unused]]
|
||||
|
||||
@@ -62,7 +62,7 @@ setCurrentTransactionRules(std::optional<Rules> r)
|
||||
}
|
||||
if (enableCuspRounding3_2_0)
|
||||
{
|
||||
return MantissaRange::MantissaScale::Large3_2_0;
|
||||
return MantissaRange::MantissaScale::Large320;
|
||||
}
|
||||
return MantissaRange::MantissaScale::LargeLegacy;
|
||||
}
|
||||
|
||||
@@ -1812,7 +1812,7 @@ public:
|
||||
|
||||
switch (scale)
|
||||
{
|
||||
case MantissaRange::MantissaScale::Large3_2_0:
|
||||
case MantissaRange::MantissaScale::Large320:
|
||||
case MantissaRange::MantissaScale::Large:
|
||||
BEAST_EXPECT(signedDifference >= 0);
|
||||
BEAST_EXPECT(signedDifference < pow10<BigInt>(product.exponent()));
|
||||
@@ -1895,7 +1895,7 @@ public:
|
||||
// Upward invariant: stored >= exact. Bug: stored < exact.
|
||||
switch (scale)
|
||||
{
|
||||
case MantissaRange::MantissaScale::Large3_2_0:
|
||||
case MantissaRange::MantissaScale::Large320:
|
||||
case MantissaRange::MantissaScale::Large:
|
||||
BEAST_EXPECT(stored >= exact);
|
||||
BEAST_EXPECT(diff < pow10(quotient.exponent()));
|
||||
@@ -1946,7 +1946,7 @@ public:
|
||||
// invariant: stored <= exact. Bug: stored > exact.
|
||||
switch (scale)
|
||||
{
|
||||
case MantissaRange::MantissaScale::Large3_2_0:
|
||||
case MantissaRange::MantissaScale::Large320:
|
||||
case MantissaRange::MantissaScale::Large:
|
||||
BEAST_EXPECT(stored <= exact);
|
||||
BEAST_EXPECT(diff > -pow10(quotient.exponent()));
|
||||
@@ -2004,7 +2004,7 @@ public:
|
||||
// invariant: stored >= exact. Bug: stored < exact.
|
||||
switch (scale)
|
||||
{
|
||||
case MantissaRange::MantissaScale::Large3_2_0:
|
||||
case MantissaRange::MantissaScale::Large320:
|
||||
case MantissaRange::MantissaScale::Large:
|
||||
BEAST_EXPECT(stored >= exact);
|
||||
BEAST_EXPECT(diff < pow10(quotient.exponent()));
|
||||
@@ -2108,7 +2108,7 @@ public:
|
||||
{
|
||||
case MantissaRange::MantissaScale::Small:
|
||||
case MantissaRange::MantissaScale::LargeLegacy:
|
||||
case MantissaRange::MantissaScale::Large3_2_0: {
|
||||
case MantissaRange::MantissaScale::Large320: {
|
||||
// Without the fix, all the results but one round up
|
||||
if (r == Number::RoundingMode::Downward)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user