Commit c31d1330 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

Fix -Wshorten-64-to-32 compile warning treated as error

Summary:
Fix -Wshorten-64-to-32 compile warning treated as error

(Note: this ignores all push blocking failures!)

Reviewed By: nbronson

Differential Revision: D18493255

fbshipit-source-id: 10a2a576c7f587d02a61860285171f2c5f0534ad
parent cd7a67ad
...@@ -1206,9 +1206,10 @@ class VectorContainerPolicy : public BasePolicy< ...@@ -1206,9 +1206,10 @@ class VectorContainerPolicy : public BasePolicy<
template <typename Table, typename... Args> template <typename Table, typename... Args>
void constructValueAtItem(Table&& table, Item* itemAddr, Args&&... args) { void constructValueAtItem(Table&& table, Item* itemAddr, Args&&... args) {
Alloc& a = this->alloc(); Alloc& a = this->alloc();
std::size_t size = table.size(); auto size = static_cast<InternalSizeType>(table.size());
FOLLY_SAFE_DCHECK(size < std::numeric_limits<InternalSizeType>::max(), ""); FOLLY_SAFE_DCHECK(
*itemAddr = static_cast<InternalSizeType>(size); table.size() < std::numeric_limits<InternalSizeType>::max(), "");
*itemAddr = size;
auto dst = std::addressof(values_[size]); auto dst = std::addressof(values_[size]);
// TODO(T31574848): clean up assume-s used to optimize placement new // TODO(T31574848): clean up assume-s used to optimize placement new
assume(dst != nullptr); assume(dst != nullptr);
...@@ -1221,7 +1222,7 @@ class VectorContainerPolicy : public BasePolicy< ...@@ -1221,7 +1222,7 @@ class VectorContainerPolicy : public BasePolicy<
// because the item and tag are already set in the table before // because the item and tag are already set in the table before
// calling constructValueAtItem, so if there is a tag collision // calling constructValueAtItem, so if there is a tag collision
// find may evaluate values_[size] during the search. // find may evaluate values_[size] during the search.
auto i = tlsMinstdRand(size + 1); auto i = static_cast<InternalSizeType>(tlsMinstdRand(size + 1));
if (i != size) { if (i != size) {
auto& lhsItem = *itemAddr; auto& lhsItem = *itemAddr;
auto rhsIter = table.find( auto rhsIter = table.find(
......
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