From 63d5cc72fa515a2d82df3d0909f53c4b95838ca0 Mon Sep 17 00:00:00 2001 From: ZHANG Biao Date: Thu, 7 Aug 2014 17:06:07 +0800 Subject: [PATCH] fix various 'comparison of integers of different signs' compiling errors under macosx --- table/cuckoo_table_builder_test.cc | 4 ++-- table/cuckoo_table_reader_test.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/table/cuckoo_table_builder_test.cc b/table/cuckoo_table_builder_test.cc index f346f45c9..6bcd91f44 100644 --- a/table/cuckoo_table_builder_test.cc +++ b/table/cuckoo_table_builder_test.cc @@ -383,10 +383,10 @@ TEST(CuckooBuilderTest, FailWhenSameKeyInserted) { ASSERT_OK(builder.status()); builder.Add(Slice(GetInternalKey(user_key, false)), Slice("value1")); - ASSERT_EQ(builder.NumEntries(), 1); + ASSERT_EQ(builder.NumEntries(), 1u); ASSERT_OK(builder.status()); builder.Add(Slice(GetInternalKey(user_key, true)), Slice("value2")); - ASSERT_EQ(builder.NumEntries(), 2); + ASSERT_EQ(builder.NumEntries(), 2u); ASSERT_OK(builder.status()); ASSERT_TRUE(builder.Finish().IsNotSupported()); diff --git a/table/cuckoo_table_reader_test.cc b/table/cuckoo_table_reader_test.cc index 214603909..2a79c0403 100644 --- a/table/cuckoo_table_reader_test.cc +++ b/table/cuckoo_table_reader_test.cc @@ -163,7 +163,7 @@ class CuckooReaderTest { ++cnt; it->Next(); } - ASSERT_EQ(cnt, num_items); + ASSERT_EQ(static_cast(cnt), num_items); it->SeekToLast(); cnt = num_items - 1; @@ -186,7 +186,7 @@ class CuckooReaderTest { ++cnt; it->Next(); } - ASSERT_EQ(cnt, num_items); + ASSERT_EQ(static_cast(cnt), num_items); delete it; Arena arena; @@ -404,7 +404,7 @@ void BM_CuckooRead(uint64_t num, uint32_t key_length, uint64_t time_now = env->NowMicros(); reader.NewIterator(ReadOptions(), nullptr); - fprintf(stderr, "Time taken for preparing iterator for %lu items: %lu ms.\n", + fprintf(stderr, "Time taken for preparing iterator for %" PRIu64 " items: %" PRIu64 " ms.\n", num, (env->NowMicros() - time_now)/1000); time_now = env->NowMicros(); for (uint64_t i = 0; i < num_reads; ++i) {