Commit 34604d5b by Derek Mauro Committed by Copybara-Service

Remove deprecated symbol absl::kuint128max

absl::kuint128max should be replaced with absl::Uint128Max()
PiperOrigin-RevId: 606279299
Change-Id: Ib67b5431f14891f56bb706e62f183d0de75d335f
parent 119e0d3f
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
ABSL_DLL const uint128 kuint128max = MakeUint128(
std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max());
namespace { namespace {
// Returns the 0-based position of the last set bit (i.e., most significant bit) // Returns the 0-based position of the last set bit (i.e., most significant bit)
......
...@@ -244,11 +244,6 @@ class ...@@ -244,11 +244,6 @@ class
#endif // byte order #endif // byte order
}; };
// Prefer to use the constexpr `Uint128Max()`.
//
// TODO(absl-team) deprecate kuint128max once migration tool is released.
ABSL_DLL extern const uint128 kuint128max;
// allow uint128 to be logged // allow uint128 to be logged
std::ostream& operator<<(std::ostream& os, uint128 v); std::ostream& operator<<(std::ostream& os, uint128 v);
......
...@@ -135,11 +135,11 @@ TEST(Uint128, OStreamValueTest) { ...@@ -135,11 +135,11 @@ TEST(Uint128, OStreamValueTest) {
"2000000000000000000000000000000000000000000"}); "2000000000000000000000000000000000000000000"});
CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kHex, CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kHex,
/*width = */ 0, "80000000000000000000000000000000"}); /*width = */ 0, "80000000000000000000000000000000"});
CheckUint128Case({absl::kuint128max, kDec, /*width = */ 0, CheckUint128Case({absl::Uint128Max(), kDec, /*width = */ 0,
"340282366920938463463374607431768211455"}); "340282366920938463463374607431768211455"});
CheckUint128Case({absl::kuint128max, kOct, /*width = */ 0, CheckUint128Case({absl::Uint128Max(), kOct, /*width = */ 0,
"3777777777777777777777777777777777777777777"}); "3777777777777777777777777777777777777777777"});
CheckUint128Case({absl::kuint128max, kHex, /*width = */ 0, CheckUint128Case({absl::Uint128Max(), kHex, /*width = */ 0,
"ffffffffffffffffffffffffffffffff"}); "ffffffffffffffffffffffffffffffff"});
} }
......
...@@ -231,8 +231,6 @@ TEST(Uint128, AllTests) { ...@@ -231,8 +231,6 @@ TEST(Uint128, AllTests) {
EXPECT_EQ(two, -((-one) - 1)); EXPECT_EQ(two, -((-one) - 1));
EXPECT_EQ(absl::Uint128Max(), -one); EXPECT_EQ(absl::Uint128Max(), -one);
EXPECT_EQ(zero, -zero); EXPECT_EQ(zero, -zero);
EXPECT_EQ(absl::Uint128Max(), absl::kuint128max);
} }
TEST(Int128, RightShiftOfNegativeNumbers) { TEST(Int128, RightShiftOfNegativeNumbers) {
......
...@@ -219,7 +219,7 @@ struct SafeMultiply { ...@@ -219,7 +219,7 @@ struct SafeMultiply {
? static_cast<uint128>(Uint128Low64(a) * Uint128Low64(b)) ? static_cast<uint128>(Uint128Low64(a) * Uint128Low64(b))
: a * b; : a * b;
} }
return b == 0 ? b : (a > kuint128max / b) ? kuint128max : a * b; return b == 0 ? b : (a > Uint128Max() / b) ? Uint128Max() : a * b;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment