Commit 3cdd3009 authored by REDMOND\agnel's avatar REDMOND\agnel Committed by Facebook GitHub Bot

Fix several C++ warnings (#1565)

Summary:
Fixes warnings about implicit type truncation. By making the conversions explicit, react-native-windows will be able to remove suppressions for several warnings required per SDL.

Pull Request resolved: https://github.com/facebook/folly/pull/1565

Reviewed By: igorsugak

Differential Revision: D27964258

Pulled By: yfeldblum

fbshipit-source-id: b13f8728ecda0b38c2fd661199d6551c5ff87993
parent 903990db
......@@ -297,7 +297,7 @@ std::size_t dynamic::hash() const {
[&](auto acc, auto const& item) { return acc + h(item); });
}
case ARRAY:
return folly::hash::hash_range(begin(), end());
return static_cast<std::size_t>(folly::hash::hash_range(begin(), end()));
case INT64:
return std::hash<int64_t>()(getInt());
case DOUBLE:
......
......@@ -75,7 +75,7 @@ struct to_ascii_array {
data_type_ result{};
Alphabet alpha;
for (size_t i = 0; i < Base; ++i) {
result.data[i] = alpha(i);
result.data[i] = alpha(static_cast<uint8_t>(i));
}
return result;
}
......@@ -224,7 +224,7 @@ FOLLY_ALWAYS_INLINE size_t to_ascii_size_clzll(uint64_t v) {
}
// log2 is approx log<2>(v)
size_t const vlog2 = 64 - to_ascii_port_clzll(v);
size_t const vlog2 = 64 - static_cast<size_t>(to_ascii_port_clzll(v));
// handle directly when Base is power-of-two
if (!(Base & (Base - 1))) {
......
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