From 5d90c1385188d4632ce9a0f0e6bc5b83d4cf5138 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Wed, 27 Jul 2016 12:21:19 -0700 Subject: [PATCH] Don't shift an int left while assigning it to a size_t Summary: MSVC gives warnings if you shift a 32-bit value left but then assign it to a 64-bit variable. This just makes it a 64-bit shift instead. If we really wanted, this doesn't need to be a size_t to begin with, but it already is, so just leave it alone. Reviewed By: yfeldblum Differential Revision: D3622935 fbshipit-source-id: 25931e6df644df8a2160aa80fd5de21cd9c06159 --- folly/test/HashBenchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/test/HashBenchmark.cpp b/folly/test/HashBenchmark.cpp index f62223ef..fc4398b6 100644 --- a/folly/test/HashBenchmark.cpp +++ b/folly/test/HashBenchmark.cpp @@ -55,7 +55,7 @@ void addHashBenchmark(const std::string& name) { static std::deque names; for (size_t i = 0; i < 16; ++i) { - size_t k = 1 << i; + auto k = size_t(1) << i; names.emplace_back(folly::sformat("{}: k=2^{}",name, i)); folly::addBenchmark(__FILE__, names.back().c_str(), [=] (unsigned iters) { -- 2.34.1