fix liger contbuild: cast offset_bytes to unsigned
[folly.git] / folly / MicroLock.h
index d5529af0951618951e4061ef8f028c9107da7552..18efaa9b80d7a308ff1379388536e1b196d3e1c8 100644 (file)
@@ -17,7 +17,7 @@
 #pragma once
 
 #include <assert.h>
-#include <limits>
+#include <climits>
 #include <stdint.h>
 #include <folly/detail/Futex.h>
 #include <folly/Portability.h>
@@ -114,7 +114,7 @@ inline unsigned MicroLockCore::baseShift(unsigned slot) const {
   assert(offset_bytes < sizeof(uint32_t));
 
   return kIsLittleEndian
-             ? offset_bytes * CHAR_BIT + slot * 2
+             ? (unsigned)offset_bytes * CHAR_BIT + slot * 2
              : CHAR_BIT * (sizeof(uint32_t) - offset_bytes - 1) + slot * 2;
 }