Skip to content

Commit f6c5d58

Browse files
laanwjPastaPastaPasta
authored andcommitted
Merge bitcoin#10272: [Tests] Prevent warning: variable 'x' is uninitialized
5ec8836 Prevent warning: variable 'x' is uninitialized (Pavel Janík) Tree-SHA512: 54e39d4b85303db033bd08c52ff2fa093ec9a1b1b9550911bb2123be60fa471cba81f36859681170695dfafb3a8a4c154122917c05b5a23837cf97c25907afc1
1 parent 198558a commit f6c5d58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bench/crypto_hash.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void HASH_SipHash_0032b(benchmark::State& state)
9292
static void FastRandom_32bit(benchmark::State& state)
9393
{
9494
FastRandomContext rng(true);
95-
uint32_t x;
95+
uint32_t x = 0;
9696
while (state.KeepRunning()) {
9797
for (int i = 0; i < 1000000; i++) {
9898
x += rng.rand32();
@@ -103,7 +103,7 @@ static void FastRandom_32bit(benchmark::State& state)
103103
static void FastRandom_1bit(benchmark::State& state)
104104
{
105105
FastRandomContext rng(true);
106-
uint32_t x;
106+
uint32_t x = 0;
107107
while (state.KeepRunning()) {
108108
for (int i = 0; i < 1000000; i++) {
109109
x += rng.randbool();

0 commit comments

Comments
 (0)