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
This commit is contained in:
Zhongyi Xie 2018-04-19 18:51:35 -07:00 committed by Facebook Github Bot
parent 69faddb32e
commit 8a9c7f71c9

View File

@ -2595,7 +2595,7 @@ class StressTest {
// after a crash, rollback to commit recovered transactions // after a crash, rollback to commit recovered transactions
std::vector<Transaction*> trans; std::vector<Transaction*> trans;
txn_db_->GetAllPreparedTransactions(&trans); txn_db_->GetAllPreparedTransactions(&trans);
Random rand(FLAGS_seed); Random rand(static_cast<uint32_t>(FLAGS_seed));
for (auto txn : trans) { for (auto txn : trans) {
if (rand.OneIn(2)) { if (rand.OneIn(2)) {
s = txn->Commit(); s = txn->Commit();