From d5562002645cc741104c2f18bce7a721202ada76 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 26 Mar 2014 17:53:39 -0700 Subject: [PATCH] Some small cleaning up to make some compiling environment happy Summary: Compiler complains some errors when building using our internal build settings. Fix them. Test Plan: rebuild Reviewers: haobo, dhruba, igor, yhchiang, ljin Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D17199 --- db/corruption_test.cc | 2 +- db/merge_operator.cc | 2 +- util/env_test.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/corruption_test.cc b/db/corruption_test.cc index 2e630c11b..f0397b6f5 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -387,7 +387,7 @@ TEST(CorruptionTest, FileSystemStateCorrupted) { DBImpl* dbi = reinterpret_cast(db_); std::vector metadata; dbi->GetLiveFilesMetaData(&metadata); - ASSERT_GT(metadata.size(), 0); + ASSERT_GT(metadata.size(), size_t(0)); std::string filename = dbname_ + metadata[0].name; delete db_; diff --git a/db/merge_operator.cc b/db/merge_operator.cc index a01d389e9..a14df8a87 100644 --- a/db/merge_operator.cc +++ b/db/merge_operator.cc @@ -23,7 +23,7 @@ bool MergeOperator::PartialMergeMulti(const Slice& key, std::string temp_value; Slice temp_slice(operand_list[0]); - for (int i = 1; i < operand_list.size(); ++i) { + for (size_t i = 1; i < operand_list.size(); ++i) { auto& operand = operand_list[i]; if (!PartialMerge(key, temp_slice, operand, &temp_value, logger)) { return false; diff --git a/util/env_test.cc b/util/env_test.cc index b7009bf5d..0a83037c3 100644 --- a/util/env_test.cc +++ b/util/env_test.cc @@ -481,9 +481,9 @@ class TestLogger : public Logger { if (new_format[0] == '[') { // "[DEBUG] " - ASSERT_TRUE(n <= 56 + (512 - sizeof(struct timeval))); + ASSERT_TRUE(n <= 56 + (512 - static_cast(sizeof(struct timeval)))); } else { - ASSERT_TRUE(n <= 48 + (512 - sizeof(struct timeval))); + ASSERT_TRUE(n <= 48 + (512 - static_cast(sizeof(struct timeval)))); } va_end(backup_ap); }