Make most implicit integer truncations and sign conversions explicit
[folly.git] / folly / PicoSpinLock.h
index b73f9f752f7939cfdcfc2758a3a6c35e5d80b2f8..02d7bc924183f8f5d59facaff3062731ba821504 100644 (file)
@@ -94,7 +94,7 @@ struct PicoSpinLock {
    */
   void init(IntType initialValue = 0) {
     CHECK(!(initialValue & kLockBitMask_));
-    lock_ = initialValue;
+    lock_ = UIntType(initialValue);
   }
 
   /*
@@ -118,7 +118,7 @@ struct PicoSpinLock {
    */
   void setData(IntType w) {
     CHECK(!(w & kLockBitMask_));
-    lock_ = (lock_ & kLockBitMask_) | w;
+    lock_ = UIntType((lock_ & kLockBitMask_) | w);
   }
 
   /*