From f84f56610e8f7edbc22828c3382d8d60855a7e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Tue, 25 Apr 2017 08:47:58 +0200 Subject: [PATCH] Prevent warning: variable 'x' is uninitialized --- src/bench/crypto_hash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp index 69d83c30b..183819dde 100644 --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -51,7 +51,7 @@ static void SHA512(benchmark::State& state) static void FastRandom_32bit(benchmark::State& state) { FastRandomContext rng(true); - uint32_t x; + uint32_t x = 0; while (state.KeepRunning()) { for (int i = 0; i < 1000000; i++) { x += rng.rand32(); @@ -62,7 +62,7 @@ static void FastRandom_32bit(benchmark::State& state) static void FastRandom_1bit(benchmark::State& state) { FastRandomContext rng(true); - uint32_t x; + uint32_t x = 0; while (state.KeepRunning()) { for (int i = 0; i < 1000000; i++) { x += rng.randbool();