From e92e107fe91fdc1202bfdb6e70dd6980887bd600 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 7 Jul 2015 13:11:16 -0700 Subject: [PATCH] Better casting. --- libdevcore/FixedHash.h | 2 +- libdevcrypto/Common.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libdevcore/FixedHash.h b/libdevcore/FixedHash.h index 09bc3393b..139c0d943 100644 --- a/libdevcore/FixedHash.h +++ b/libdevcore/FixedHash.h @@ -151,7 +151,7 @@ public: { FixedHash ret; for (auto& i: ret.m_data) - i = std::uniform_int_distribution(0, 255)(_eng); + i = std::uniform_int_distribution(0, 255)(_eng); return ret; } diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index e45d1cfb6..e75623799 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -344,9 +344,9 @@ void Nonce::initialiseIfNeeded() { // todo: replace w/entropy from user and system std::mt19937_64 s_eng(time(0) + chrono::high_resolution_clock::now().time_since_epoch().count()); - std::uniform_int_distribution d(0, 255); + std::uniform_int_distribution d(0, 255); for (unsigned i = 0; i < 32; ++i) - m_value[i] = byte(d(s_eng)); + m_value[i] = d(s_eng); } if (!m_value) BOOST_THROW_EXCEPTION(InvalidState());