From f7669b40badd11404f8930f5d91a15127cf43767 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 2 Sep 2016 14:06:04 -0700 Subject: [PATCH] Fix Windows Build Summary: Fix two Windows build problems. Test Plan: Build on Windows and run all Linux tests. Reviewers: IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: leveldb, andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D63189 --- table/block.h | 7 +++++-- util/threadpool_imp.cc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/table/block.h b/table/block.h index 470e52322..c6c03a300 100644 --- a/table/block.h +++ b/table/block.h @@ -49,8 +49,11 @@ class BlockReadAmpBitmap { } // num_bits_needed = ceil(block_size / bytes_per_bit) - size_t num_bits_needed = (block_size >> bytes_per_bit_pow_) + - (block_size % (1 << bytes_per_bit_pow_) != 0); + size_t num_bits_needed = + (block_size >> static_cast(bytes_per_bit_pow_)) + + (block_size % (static_cast(1) + << static_cast(bytes_per_bit_pow_)) != + 0); // bitmap_size = ceil(num_bits_needed / kBitsPerEntry) size_t bitmap_size = (num_bits_needed / kBitsPerEntry) + diff --git a/util/threadpool_imp.cc b/util/threadpool_imp.cc index 1c8153477..128124cb2 100644 --- a/util/threadpool_imp.cc +++ b/util/threadpool_imp.cc @@ -38,7 +38,7 @@ namespace { struct Lock { std::unique_lock ul_; - explicit Lock(const std::mutex& m) : ul_(m, std::defer_lock) {} + explicit Lock(std::mutex& m) : ul_(m, std::defer_lock) {} }; using Condition = std::condition_variable;