Skip to content

Commit

Permalink
Fix c4244 (facebook#49)
Browse files Browse the repository at this point in the history
* (*pedantry alert*)
Right-shifting a 32-bit value by 32 is, strictly, undefined behavior,
although every compiler worth its salt will understand that this is
just a funny way to generate 0. But anyways, this code causes VC++ to
emit warning C4293, which, per Office policy, may not be disabled.

* Fix C4244 warnings in MethodCall.cpp when compiling for x86, caused
by implicitly truncating `int64_t` values to `int` values.
  • Loading branch information
htpiv authored and microsoft-github-bot[bot] committed Apr 16, 2019
1 parent 6d8a280 commit 7042cdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ReactCommon/cxxreact/MethodCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ std::vector<MethodCall> parseMethodCalls(folly::dynamic&& jsonData) {
}

methodCalls.emplace_back(
moduleIds[i].asInt(),
methodIds[i].asInt(),
static_cast<int>(moduleIds[i].asInt()),
static_cast<int>(methodIds[i].asInt()),
std::move(params[i]),
callId);

Expand Down

0 comments on commit 7042cdb

Please sign in to comment.