Start fixing implicit truncations
authorChristopher Dykes <cdykes@fb.com>
Wed, 30 Nov 2016 19:17:39 +0000 (11:17 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 30 Nov 2016 19:23:35 +0000 (11:23 -0800)
commit4dd1dd685b0397a36b21a057f588191ac0cfe6c6
tree2f81641f3b1266a5c67508ab545c8c286c184af1
parentea2094274b9d14757595a0677565b011e2b2573d
Start fixing implicit truncations

Summary:
Truncations should be explicit, but for some reason, MSVC seems to be the only compiler that will warn you when you implicitly truncate integer or float values.
This allows Folly to be compiled with warnings 4018, 4242, 4244 and 4305 enabled.
Technically 4018 is a sign mismatch warning, but there was only one place it was being triggered so I included it anyways. The other 3 are warnings for implicit truncation.

There is one other implicit truncation warning that currently triggers in Folly, 4267, but there are a lot more places where that triggers so I'll do that in a separate diff.

Reviewed By: yfeldblum

Differential Revision: D4249471

fbshipit-source-id: e18a93d85856c998576934a6229c9edd1638a54e
folly/Conv.cpp
folly/IPAddress.cpp
folly/SocketAddress.cpp
folly/Uri.cpp
folly/detail/BitsDetail.h
folly/detail/FileUtilDetail.h
folly/experimental/bser/Dump.cpp
folly/experimental/io/HugePages.cpp
folly/io/async/AsyncSocket.cpp
folly/json.cpp