From e9809382109765ce53fcbd95e1fc593d9b19e184 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 1 May 2019 19:57:34 +0000 Subject: fix wide difficulty conversion with some versions of boost --- tests/performance_tests/check_hash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/performance_tests/check_hash.h') diff --git a/tests/performance_tests/check_hash.h b/tests/performance_tests/check_hash.h index d24001903..53746fec4 100644 --- a/tests/performance_tests/check_hash.h +++ b/tests/performance_tests/check_hash.h @@ -44,13 +44,13 @@ public: difficulty = difficulty_high; difficulty = (difficulty << 64) | difficulty_low; boost::multiprecision::uint256_t hash_value = std::numeric_limits::max() / hash_target; - ((uint64_t*)&hash)[0] = (hash_value << 64 >> 64).convert_to(); + ((uint64_t*)&hash)[0] = (hash_value & 0xffffffffffffffff).convert_to(); hash_value >>= 64; - ((uint64_t*)&hash)[1] = (hash_value << 64 >> 64).convert_to(); + ((uint64_t*)&hash)[1] = (hash_value & 0xffffffffffffffff).convert_to(); hash_value >>= 64; - ((uint64_t*)&hash)[2] = (hash_value << 64 >> 64).convert_to(); + ((uint64_t*)&hash)[2] = (hash_value & 0xffffffffffffffff).convert_to(); hash_value >>= 64; - ((uint64_t*)&hash)[3] = (hash_value << 64 >> 64).convert_to(); + ((uint64_t*)&hash)[3] = (hash_value & 0xffffffffffffffff).convert_to(); return true; } -- cgit v1.2.3