folly: fixup CompressionTest compilation on macos
authorWez Furlong <wez@fb.com>
Sat, 16 Jul 2016 21:13:32 +0000 (14:13 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Sat, 16 Jul 2016 21:23:39 +0000 (14:23 -0700)
Summary:
The compiler on macos is pedantic about the size of the 9UL not
matching the size of the type returned by `oneBasedMsbPos`.  Cast it to
the appropriate size.

Reviewed By: meyering

Differential Revision: D3576183

fbshipit-source-id: 41e9afc78eed2994e34238da119774e9bf6b7cea

folly/io/test/CompressionTest.cpp

index 8fe347f1d9df9431273d7261dd820dd855ac6b70..a1d48b9d6e2e494308cf10aa3ddb50fc5bde7026 100644 (file)
@@ -213,7 +213,8 @@ void CompressionVarintTest::runSimpleTest(const DataHolder& dh) {
   auto compressed = codec_->compress(original.get());
   auto breakPoint =
       1UL +
-      Random::rand64(std::max(9UL, oneBasedMsbPos(uncompressedLength_)) / 9UL);
+      Random::rand64(
+          std::max(uint64_t(9), oneBasedMsbPos(uncompressedLength_)) / 9UL);
   auto tinyBuf = IOBuf::copyBuffer(compressed->data(),
                                    std::min(compressed->length(), breakPoint));
   compressed->trimStart(breakPoint);