Skip to content

Commit

Permalink
Remove deprecated symbol absl::kuint128max
Browse files Browse the repository at this point in the history
absl::kuint128max should be replaced with absl::Uint128Max()
PiperOrigin-RevId: 606279299
Change-Id: Ib67b5431f14891f56bb706e62f183d0de75d335f
  • Loading branch information
derekmauro authored and copybara-github committed Feb 12, 2024
1 parent 119e0d3 commit 34604d5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14 deletions.
3 changes: 0 additions & 3 deletions absl/numeric/int128.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
namespace absl {
ABSL_NAMESPACE_BEGIN

ABSL_DLL const uint128 kuint128max = MakeUint128(
std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max());

namespace {

// Returns the 0-based position of the last set bit (i.e., most significant bit)
Expand Down
5 changes: 0 additions & 5 deletions absl/numeric/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,6 @@ class
#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
std::ostream& operator<<(std::ostream& os, uint128 v);

Expand Down
6 changes: 3 additions & 3 deletions absl/numeric/int128_stream_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ TEST(Uint128, OStreamValueTest) {
"2000000000000000000000000000000000000000000"});
CheckUint128Case({absl::MakeUint128(0x8000000000000000, 0), kHex,
/*width = */ 0, "80000000000000000000000000000000"});
CheckUint128Case({absl::kuint128max, kDec, /*width = */ 0,
CheckUint128Case({absl::Uint128Max(), kDec, /*width = */ 0,
"340282366920938463463374607431768211455"});
CheckUint128Case({absl::kuint128max, kOct, /*width = */ 0,
CheckUint128Case({absl::Uint128Max(), kOct, /*width = */ 0,
"3777777777777777777777777777777777777777777"});
CheckUint128Case({absl::kuint128max, kHex, /*width = */ 0,
CheckUint128Case({absl::Uint128Max(), kHex, /*width = */ 0,
"ffffffffffffffffffffffffffffffff"});
}

Expand Down
2 changes: 0 additions & 2 deletions absl/numeric/int128_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ TEST(Uint128, AllTests) {
EXPECT_EQ(two, -((-one) - 1));
EXPECT_EQ(absl::Uint128Max(), -one);
EXPECT_EQ(zero, -zero);

EXPECT_EQ(absl::Uint128Max(), absl::kuint128max);
}

TEST(Int128, RightShiftOfNegativeNumbers) {
Expand Down
2 changes: 1 addition & 1 deletion absl/time/duration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct SafeMultiply {
? static_cast<uint128>(Uint128Low64(a) * Uint128Low64(b))
: a * b;
}
return b == 0 ? b : (a > kuint128max / b) ? kuint128max : a * b;
return b == 0 ? b : (a > Uint128Max() / b) ? Uint128Max() : a * b;
}
};

Expand Down

0 comments on commit 34604d5

Please sign in to comment.