Allow building with -Wshift-sign-overflow
authorChristopher Dykes <cdykes@fb.com>
Mon, 12 Dec 2016 23:15:27 +0000 (15:15 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Mon, 12 Dec 2016 23:17:55 +0000 (15:17 -0800)
commit344088dc11b56d2f0c300743c4a89c2cafc6a2b5
tree438d2715ef294f3cdddb7d26ce5b3b63c0e1c2a9
parent0d6a706bc02b6fbca58d2f5f711c4505fb2ad38a
Allow building with -Wshift-sign-overflow

Summary: Prior to C++14 these shifts are undefined behavior, but the unsigned version is not, so do the shifts on unsigned values before converting to the final type.

Reviewed By: yfeldblum

Differential Revision: D4309311

fbshipit-source-id: 914b207bac2f77a96c07a8a5df81980c672aa677
folly/test/JsonTest.cpp
folly/test/SmallLocksTest.cpp