about summary refs log tree commit diff
path: root/third_party/abseil_cpp/absl/base/internal/bits.h
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-11-21T13·43+0100
committerVincent Ambo <mail@tazj.in>2020-11-21T14·48+0100
commit082c006c04343a78d87b6c6ab3608c25d6213c3f (patch)
tree16e6f04f8d1d1d2d67e8e917d5e7bb48c1b60375 /third_party/abseil_cpp/absl/base/internal/bits.h
parentcc27324d0226953943f408ce3c69ad7d648e005e (diff)
merge(3p/absl): subtree merge of Abseil up to e19260f r/1889
... notably, this includes Abseil's own StatusOr type, which
conflicted with our implementation (that was taken from TensorFlow).

Change-Id: Ie7d6764b64055caaeb8dc7b6b9d066291e6b538f
Diffstat (limited to 'third_party/abseil_cpp/absl/base/internal/bits.h')
-rw-r--r--third_party/abseil_cpp/absl/base/internal/bits.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/abseil_cpp/absl/base/internal/bits.h b/third_party/abseil_cpp/absl/base/internal/bits.h
index 14c51d8b3013..81648e2c3957 100644
--- a/third_party/abseil_cpp/absl/base/internal/bits.h
+++ b/third_party/abseil_cpp/absl/base/internal/bits.h
@@ -83,10 +83,11 @@ ABSL_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64(uint64_t n) {
 #elif defined(_MSC_VER) && !defined(__clang__)
   // MSVC does not have __buitin_clzll. Compose two calls to _BitScanReverse
   unsigned long result = 0;  // NOLINT(runtime/int)
-  if ((n >> 32) && _BitScanReverse(&result, n >> 32)) {
+  if ((n >> 32) &&
+      _BitScanReverse(&result, static_cast<unsigned long>(n >> 32))) {
     return 31 - result;
   }
-  if (_BitScanReverse(&result, n)) {
+  if (_BitScanReverse(&result, static_cast<unsigned long>(n))) {
     return 63 - result;
   }
   return 64;
@@ -170,10 +171,10 @@ ABSL_BASE_INTERNAL_FORCEINLINE int CountTrailingZerosNonZero64(uint64_t n) {
 #elif defined(_MSC_VER) && !defined(__clang__)
   unsigned long result = 0;  // NOLINT(runtime/int)
   if (static_cast<uint32_t>(n) == 0) {
-    _BitScanForward(&result, n >> 32);
+    _BitScanForward(&result, static_cast<unsigned long>(n >> 32));
     return result + 32;
   }
-  _BitScanForward(&result, n);
+  _BitScanForward(&result, static_cast<unsigned long>(n));
   return result;
 #elif defined(__GNUC__) || defined(__clang__)
   static_assert(sizeof(unsigned long long) == sizeof(n),  // NOLINT(runtime/int)