From e04480faed0f0709c5294f41d224cd2585f61aa2 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 6 Jan 2017 14:42:18 -0800 Subject: [PATCH] Fix MS warnings. Use ROCKSDB_Prsz for size_t. Summary: Closes https://github.com/facebook/rocksdb/pull/1737 Differential Revision: D4378852 Pulled By: yiwu-arbug fbshipit-source-id: ba8b02d --- tools/db_bench_tool.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 89272b8ee..a46dc8606 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -3430,11 +3430,11 @@ class Benchmark { continue; } } - writes_ /= open_options_.max_bytes_for_level_multiplier; + writes_ /= static_cast(open_options_.max_bytes_for_level_multiplier); } for (size_t i = 0; i < num_db; i++) { if (sorted_runs[i].size() < num_levels - 1) { - fprintf(stderr, "n is too small to fill %lu levels\n", num_levels); + fprintf(stderr, "n is too small to fill %" ROCKSDB_PRIszt " levels\n", num_levels); exit(1); } } @@ -3481,11 +3481,11 @@ class Benchmark { } num_files_at_level0[i] = meta.levels[0].files.size(); } - writes_ *= static_cast(100) / (ratio + 200); + writes_ = static_cast(writes_* static_cast(100) / (ratio + 200)); } for (size_t i = 0; i < num_db; i++) { if (sorted_runs[i].size() < num_levels) { - fprintf(stderr, "n is too small to fill %lu levels\n", num_levels); + fprintf(stderr, "n is too small to fill %" ROCKSDB_PRIszt " levels\n", num_levels); exit(1); } } @@ -3594,7 +3594,7 @@ class Benchmark { for (size_t k = 0; k < num_db; k++) { auto db = db_list[k]; fprintf(stdout, - "---------------------- DB %lu LSM ---------------------\n", k); + "---------------------- DB %" ROCKSDB_PRIszt " LSM ---------------------\n", k); db->GetColumnFamilyMetaData(&meta); for (auto& levelMeta : meta.levels) { if (levelMeta.files.empty()) {