From 8a9c7f71c90a3444b590330ff8acd6c24809ca3c Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Thu, 19 Apr 2018 18:51:35 -0700 Subject: [PATCH] fix compilation error: implicit conversion loses integer precision Summary: Fix compilation error with clang: > tools/db_stress.cc:2598:21: error: implicit conversion loses integer precision: 'gflags::uint64' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32] Random rand(FLAGS_seed); ~~~~ ^~~~~~~~~~ Closes https://github.com/facebook/rocksdb/pull/3746 Differential Revision: D7703209 Pulled By: miasantreble fbshipit-source-id: 18c56a5138a2f308e4213594bc82e8e64bc21570 --- tools/db_stress.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 63d18efae..b2d6044cc 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -2595,7 +2595,7 @@ class StressTest { // after a crash, rollback to commit recovered transactions std::vector trans; txn_db_->GetAllPreparedTransactions(&trans); - Random rand(FLAGS_seed); + Random rand(static_cast(FLAGS_seed)); for (auto txn : trans) { if (rand.OneIn(2)) { s = txn->Commit();