diff options
author | ayles <ayles@yandex-team.ru> | 2022-02-10 16:46:11 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:11 +0300 |
commit | 480eebba2142866e78db15cd7600bb3f452a2dbc (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/restricted/abseil-cpp/absl/numeric/int128.h | |
parent | d55028e9d9708f94c2d0d35b54ed50d4d7af0456 (diff) | |
download | ydb-480eebba2142866e78db15cd7600bb3f452a2dbc.tar.gz |
Restoring authorship annotation for <ayles@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp/absl/numeric/int128.h')
-rw-r--r-- | contrib/restricted/abseil-cpp/absl/numeric/int128.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/restricted/abseil-cpp/absl/numeric/int128.h b/contrib/restricted/abseil-cpp/absl/numeric/int128.h index 8e047a491b..c7ad96befd 100644 --- a/contrib/restricted/abseil-cpp/absl/numeric/int128.h +++ b/contrib/restricted/abseil-cpp/absl/numeric/int128.h @@ -53,7 +53,7 @@ #endif // defined(_MSC_VER) namespace absl { -ABSL_NAMESPACE_BEGIN +ABSL_NAMESPACE_BEGIN class int128; @@ -238,7 +238,7 @@ class // Prefer to use the constexpr `Uint128Max()`. // // TODO(absl-team) deprecate kuint128max once migration tool is released. -ABSL_DLL extern const uint128 kuint128max; +ABSL_DLL extern const uint128 kuint128max; // allow uint128 to be logged std::ostream& operator<<(std::ostream& os, uint128 v); @@ -250,7 +250,7 @@ constexpr uint128 Uint128Max() { (std::numeric_limits<uint64_t>::max)()); } -ABSL_NAMESPACE_END +ABSL_NAMESPACE_END } // namespace absl // Specialized numeric_limits for uint128. @@ -299,7 +299,7 @@ class numeric_limits<absl::uint128> { } // namespace std namespace absl { -ABSL_NAMESPACE_BEGIN +ABSL_NAMESPACE_BEGIN // int128 // @@ -485,7 +485,7 @@ constexpr int128 Int128Min() { return int128((std::numeric_limits<int64_t>::min)(), 0); } -ABSL_NAMESPACE_END +ABSL_NAMESPACE_END } // namespace absl // Specialized numeric_limits for int128. @@ -537,7 +537,7 @@ class numeric_limits<absl::int128> { // Implementation details follow // -------------------------------------------------------------------------- namespace absl { -ABSL_NAMESPACE_BEGIN +ABSL_NAMESPACE_BEGIN constexpr uint128 MakeUint128(uint64_t high, uint64_t low) { return uint128(high, low); @@ -799,14 +799,14 @@ constexpr bool operator==(uint128 lhs, uint128 rhs) { constexpr bool operator!=(uint128 lhs, uint128 rhs) { return !(lhs == rhs); } constexpr bool operator<(uint128 lhs, uint128 rhs) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 - return static_cast<unsigned __int128>(lhs) < - static_cast<unsigned __int128>(rhs); -#else +#ifdef ABSL_HAVE_INTRINSIC_INT128 + return static_cast<unsigned __int128>(lhs) < + static_cast<unsigned __int128>(rhs); +#else return (Uint128High64(lhs) == Uint128High64(rhs)) ? (Uint128Low64(lhs) < Uint128Low64(rhs)) : (Uint128High64(lhs) < Uint128High64(rhs)); -#endif +#endif } constexpr bool operator>(uint128 lhs, uint128 rhs) { return rhs < lhs; } @@ -901,9 +901,9 @@ inline uint128& uint128::operator^=(uint128 other) { // Arithmetic operators. constexpr uint128 operator<<(uint128 lhs, int amount) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 - return static_cast<unsigned __int128>(lhs) << amount; -#else +#ifdef ABSL_HAVE_INTRINSIC_INT128 + return static_cast<unsigned __int128>(lhs) << amount; +#else // uint64_t shifts of >= 64 are undefined, so we will need some // special-casing. return amount >= 64 ? MakeUint128(Uint128Low64(lhs) << (amount - 64), 0) @@ -911,13 +911,13 @@ constexpr uint128 operator<<(uint128 lhs, int amount) { : MakeUint128((Uint128High64(lhs) << amount) | (Uint128Low64(lhs) >> (64 - amount)), Uint128Low64(lhs) << amount); -#endif +#endif } constexpr uint128 operator>>(uint128 lhs, int amount) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 - return static_cast<unsigned __int128>(lhs) >> amount; -#else +#ifdef ABSL_HAVE_INTRINSIC_INT128 + return static_cast<unsigned __int128>(lhs) >> amount; +#else // uint64_t shifts of >= 64 are undefined, so we will need some // special-casing. return amount >= 64 ? MakeUint128(0, Uint128High64(lhs) >> (amount - 64)) @@ -925,7 +925,7 @@ constexpr uint128 operator>>(uint128 lhs, int amount) { : MakeUint128(Uint128High64(lhs) >> amount, (Uint128Low64(lhs) >> amount) | (Uint128High64(lhs) << (64 - amount))); -#endif +#endif } #if !defined(ABSL_HAVE_INTRINSIC_INT128) @@ -1157,7 +1157,7 @@ constexpr int64_t BitCastToSigned(uint64_t v) { #include "absl/numeric/int128_no_intrinsic.inc" // IWYU pragma: export #endif // ABSL_HAVE_INTRINSIC_INT128 -ABSL_NAMESPACE_END +ABSL_NAMESPACE_END } // namespace absl #undef ABSL_INTERNAL_WCHAR_T |