From 54f4e2f18854593daabbb48f9859b6024cac3e8f Mon Sep 17 00:00:00 2001 From: Chilledheart Date: Sun, 20 Jul 2014 22:56:40 +0800 Subject: [PATCH] Fix clang compiler warnings --- db/db_iter_test.cc | 8 ++++---- db/version_set_test.cc | 6 +++--- table/plain_table_reader.h | 2 +- utilities/document/json_document_test.cc | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/db/db_iter_test.cc b/db/db_iter_test.cc index 609573671..4ce79da1b 100644 --- a/db/db_iter_test.cc +++ b/db/db_iter_test.cc @@ -323,23 +323,23 @@ TEST(DBIteratorTest, DBIteratorUseSkipCountSkips) { ASSERT_TRUE(db_iter->Valid()); ASSERT_EQ(db_iter->key().ToString(), "c"); ASSERT_EQ(db_iter->value().ToString(), "c"); - ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 1); + ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 1u); db_iter->Prev(); ASSERT_TRUE(db_iter->Valid()); ASSERT_EQ(db_iter->key().ToString(), "b"); ASSERT_EQ(db_iter->value().ToString(), "b"); - ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 2); + ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 2u); db_iter->Prev(); ASSERT_TRUE(db_iter->Valid()); ASSERT_EQ(db_iter->key().ToString(), "a"); ASSERT_EQ(db_iter->value().ToString(), "a"); - ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3); + ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3u); db_iter->Prev(); ASSERT_TRUE(!db_iter->Valid()); - ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3); + ASSERT_EQ(TestGetTickerCount(options, NUMBER_OF_RESEEKS_IN_ITERATION), 3u); } TEST(DBIteratorTest, DBIteratorUseSkip) { diff --git a/db/version_set_test.cc b/db/version_set_test.cc index 365200610..402762efa 100644 --- a/db/version_set_test.cc +++ b/db/version_set_test.cc @@ -51,14 +51,14 @@ class GenerateFileLevelTest { TEST(GenerateFileLevelTest, Empty) { DoGenerateFileLevel(&file_level_, files_, &arena_); - ASSERT_EQ(0, file_level_.num_files); + ASSERT_EQ(0u, file_level_.num_files); ASSERT_EQ(0, Compare()); } TEST(GenerateFileLevelTest, Single) { Add("p", "q"); DoGenerateFileLevel(&file_level_, files_, &arena_); - ASSERT_EQ(1, file_level_.num_files); + ASSERT_EQ(1u, file_level_.num_files); ASSERT_EQ(0, Compare()); } @@ -69,7 +69,7 @@ TEST(GenerateFileLevelTest, Multiple) { Add("300", "350"); Add("400", "450"); DoGenerateFileLevel(&file_level_, files_, &arena_); - ASSERT_EQ(4, file_level_.num_files); + ASSERT_EQ(4u, file_level_.num_files); ASSERT_EQ(0, Compare()); } diff --git a/table/plain_table_reader.h b/table/plain_table_reader.h index cb1e32f4d..84a2e22c4 100644 --- a/table/plain_table_reader.h +++ b/table/plain_table_reader.h @@ -26,7 +26,7 @@ namespace rocksdb { class Block; -class BlockContents; +struct BlockContents; class BlockHandle; class Footer; struct Options; diff --git a/utilities/document/json_document_test.cc b/utilities/document/json_document_test.cc index 55d550b35..886d1981a 100644 --- a/utilities/document/json_document_test.cc +++ b/utilities/document/json_document_test.cc @@ -54,7 +54,7 @@ class JSONDocumentTest { ASSERT_TRUE(json.Contains("properties")); ASSERT_TRUE(json["properties"].Contains("flags")); ASSERT_TRUE(json["properties"]["flags"].IsArray()); - ASSERT_EQ(3, json["properties"]["flags"].Count()); + ASSERT_EQ(3u, json["properties"]["flags"].Count()); ASSERT_TRUE(json["properties"]["flags"][0].IsInt64()); ASSERT_EQ(10, json["properties"]["flags"][0].GetInt64()); ASSERT_TRUE(json["properties"]["flags"][1].IsString()); @@ -74,7 +74,7 @@ class JSONDocumentTest { ASSERT_EQ(0U, expected.size()); ASSERT_TRUE(json.Contains("latlong")); ASSERT_TRUE(json["latlong"].IsArray()); - ASSERT_EQ(2, json["latlong"].Count()); + ASSERT_EQ(2u, json["latlong"].Count()); ASSERT_TRUE(json["latlong"][0].IsDouble()); ASSERT_EQ(53.25, json["latlong"][0].GetDouble()); ASSERT_TRUE(json["latlong"][1].IsDouble());