From 7a96119c379a5495a965d63de2c7be45903df29d Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 23 Oct 2020 23:01:02 -0400 Subject: [PATCH] cleanup compilation warnings with msvc. --- examples/insert_bench.cc | 5 +++-- tests/btree_test.cc | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/insert_bench.cc b/examples/insert_bench.cc index 9d6154b..8881a3a 100644 --- a/examples/insert_bench.cc +++ b/examples/insert_bench.cc @@ -62,10 +62,11 @@ public: uint64_t operator()(uint64_t boundExcluded) noexcept { #ifdef PHMAP_HAS_UMUL128 uint64_t h; - uint64_t l = umul128(operator()(), boundExcluded, &h); + (void)umul128(operator()(), boundExcluded, &h); return h; +#else + return 0; #endif - return 0; } std::array state() const { diff --git a/tests/btree_test.cc b/tests/btree_test.cc index 4ad3903..1dc64cd 100644 --- a/tests/btree_test.cc +++ b/tests/btree_test.cc @@ -34,6 +34,10 @@ #include #include "btree_test.h" +#ifdef _MSC_VER + #pragma warning(disable: 4244 4100 4389) +#endif + namespace phmap { namespace test_internal { int BaseCountedInstance::num_instances_ = 0; @@ -207,7 +211,7 @@ public: int erase(const key_type &key) { int size = tree_.size(); - int res = checker_.erase(key); + int res = (int)checker_.erase(key); EXPECT_EQ(res, tree_.count(key)); EXPECT_EQ(res, tree_.erase(key)); EXPECT_EQ(tree_.count(key), 0);