Fix more signed/unsigned comparsions

main
Igor Canadi 11 years ago
parent d0b006ab13
commit 38693d99c4
  1. 2
      Makefile
  2. 2
      db/column_family_test.cc
  3. 6
      db/db_bench.cc
  4. 2
      db/file_indexer_test.cc
  5. 4
      util/benchharness.cc

@ -51,7 +51,7 @@ else
PLATFORM_CCFLAGS += $(JEMALLOC_INCLUDE) -DHAVE_JEMALLOC
endif
WARNING_FLAGS = -Wall -Werror -Wno-sign-compare
WARNING_FLAGS = -Wall -Werror
CFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual

@ -922,7 +922,7 @@ TEST(ColumnFamilyTest, DontRollEmptyLogs) {
Open();
CreateColumnFamiliesAndReopen({"one", "two", "three", "four"});
for (int i = 0; i < handles_.size(); ++i) {
for (size_t i = 0; i < handles_.size(); ++i) {
PutRandomData(i, 10, 100);
}
int num_writable_file_start = env_->GetNumberOfNewWritableFileCalls();

@ -1685,7 +1685,7 @@ class Benchmark {
OpenDb(options, FLAGS_db, &db_);
} else {
multi_dbs_.clear();
for (size_t i = 0; i < FLAGS_num_multi_db; i++) {
for (int i = 0; i < FLAGS_num_multi_db; i++) {
DB* db;
OpenDb(options, GetDbNameForMultiple(FLAGS_db, i), &db);
multi_dbs_.push_back(db);
@ -1910,7 +1910,7 @@ class Benchmark {
ReadOptions options(FLAGS_verify_checksum, true);
std::vector<Slice> keys;
std::vector<std::string> values(entries_per_batch_);
while (keys.size() < entries_per_batch_) {
while (static_cast<int64_t>(keys.size()) < entries_per_batch_) {
keys.push_back(AllocateKey());
}
@ -1922,7 +1922,7 @@ class Benchmark {
FLAGS_num, &keys[i]);
}
std::vector<Status> statuses = db->MultiGet(options, keys, &values);
assert(statuses.size() == entries_per_batch_);
assert(static_cast<int64_t>(statuses.size()) == entries_per_batch_);
read += entries_per_batch_;
for (int64_t i = 0; i < entries_per_batch_; ++i) {

@ -60,7 +60,7 @@ struct FileIndexerTest {
}
void Reset() {
for (int i = 0; i < kNumLevels; ++i) {
for (uint32_t i = 0; i < kNumLevels; ++i) {
for (auto* f : files[i]) {
delete f;
}

@ -305,7 +305,7 @@ static void PrintBenchmarkResultsAsTable(
// Compute the longest benchmark name
size_t longestName = 0;
for (auto i = 1; i < benchmarks.size(); i++) {
for (size_t i = 1; i < benchmarks.size(); i++) {
longestName = max(longestName, strlen(get<1>(benchmarks[i])));
}
@ -379,7 +379,7 @@ void RunBenchmarks() {
auto const globalBaseline = RunBenchmarkGetNSPerIteration(
get<2>(benchmarks.front()), 0);
for (auto i = 1; i < benchmarks.size(); i++) {
for (size_t i = 1; i < benchmarks.size(); i++) {
double elapsed = 0.0;
if (strcmp(get<1>(benchmarks[i]), "-") != 0) { // skip separators
elapsed = RunBenchmarkGetNSPerIteration(get<2>(benchmarks[i]),

Loading…
Cancel
Save