Commit 80702b5d authored by Kyle Dent's avatar Kyle Dent Committed by woo

Fixing a -Wshorten-64-32 issues in folly for liger.

Summary: Normally I would use the folly::to<> function, but it would cause a circular dependency, so I just added a static cast

Test Plan: Ran on iOS and ran the folly tests

Reviewed By: seanc@fb.com

Subscribers: lucian, mpawlowski, marcelo, tudorb, aalexandre, seanc, folly-diffs@

FB internal diff: D1806632

Signature: t1:1806632:1422416646:b8104f18f90eb7457f2f358428f2bd800f8f1db5
parent 32fc2d57
......@@ -389,7 +389,13 @@ public:
const size_type osize = o.size();
const size_type msize = std::min(tsize, osize);
int r = traits_type::compare(data(), o.data(), msize);
if (r == 0) r = tsize - osize;
if (r == 0 && tsize != osize) {
// We check the signed bit of the subtraction and bit shift it
// to produce either 0 or 2. The subtraction yields the
// comparison values of either -1 or 1.
r = (static_cast<int>(
(osize - tsize) >> (CHAR_BIT * sizeof(size_t) - 1)) << 1) - 1;
}
return r;
}
......
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