From e5ea40ea3a29db7551752d74465130414b0f542e Mon Sep 17 00:00:00 2001 From: Yang Chi Date: Fri, 4 Mar 2016 08:54:08 -0800 Subject: [PATCH] fix liger contbuild: cast offset_bytes to unsigned Summary: Apparently I don't know what I'm doing. But given lock_ is 8bit and the assert, I suppose cast offset_bytes to unsigned is safe. Reviewed By: dcolascione Differential Revision: D3010732 fb-gh-sync-id: 1f3440a72d2f0b2fb145ab36966f0382a3009e0c shipit-source-id: 1f3440a72d2f0b2fb145ab36966f0382a3009e0c --- folly/MicroLock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/MicroLock.h b/folly/MicroLock.h index d5529af0..18efaa9b 100644 --- a/folly/MicroLock.h +++ b/folly/MicroLock.h @@ -17,7 +17,7 @@ #pragma once #include -#include +#include #include #include #include @@ -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; } -- 2.34.1