1
0
Fork 0

fix VS warnings

This commit is contained in:
Jan Steemann 2016-06-28 17:23:49 +02:00
parent 8002607b67
commit eea20e5fa2
1 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ bool Constituent::waitForSync() const {
/// Random sleep times in election process
duration_t Constituent::sleepFor(double min_t, double max_t) {
int32_t left = 1000*min_t, right = 1000*max_t;
int32_t left = static_cast<int32_t>(1000.0 * min_t), right = static_cast<int32_t>(1000.0 * max_t);
return duration_t(
static_cast<long>(RandomGenerator::interval(left, right)));
}
@ -498,7 +498,7 @@ void Constituent::run() {
_cast = false; // New round set not cast vote
}
int32_t left = 1000000*config().minPing, right = 1000000*config().maxPing;
int32_t left = static_cast<int32_t>(1000000.0 * config().minPing), right = static_cast<int32_t>(1000000.0 * config().maxPing);
long rand_wait = static_cast<long>(RandomGenerator::interval(left, right));
{