From cbe02392708fdc64b80344c1b2699bb0b851b86f Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Tue, 22 Jan 2019 22:41:49 -0800 Subject: [PATCH] add cast to avoid loss of precision error (#4906) Summary: this PR address the following error: > tools/db_bench_tool.cc:4776:68: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'unsigned int' [-Werror,-Wshorten-64-to-32] s = db_with_cfh->db->Put(write_options_, key, gen.Generate(value_size)); Pull Request resolved: https://github.com/facebook/rocksdb/pull/4906 Differential Revision: D13780185 Pulled By: miasantreble fbshipit-source-id: 1c83a77d341099518c72f0f4a63e97ab9c4784b3 --- tools/db_bench_tool.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index f35378bf9..7f4d84025 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -4773,7 +4773,9 @@ void VerifyDBFromDB(std::string& truth_db_name) { } else if (value_size > value_max) { value_size = value_size % value_max; } - s = db_with_cfh->db->Put(write_options_, key, gen.Generate(value_size)); + s = db_with_cfh->db->Put( + write_options_, key, + gen.Generate(static_cast(value_size))); if (!s.ok()) { fprintf(stderr, "put error: %s\n", s.ToString().c_str()); exit(1);