Commit e5ea40ea authored by Yang Chi's avatar Yang Chi Committed by Facebook Github Bot 6

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
parent 3edc6278
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment