Skip to content

Commit 5ec8836

Browse files
committed
Prevent warning: variable 'x' is uninitialized
1 parent c73af54 commit 5ec8836

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
@@ -73,7 +73,7 @@ static void SipHash_32b(benchmark::State& state)
7373
static void FastRandom_32bit(benchmark::State& state)
7474
{
7575
FastRandomContext rng(true);
76-
uint32_t x;
76+
uint32_t x = 0;
7777
while (state.KeepRunning()) {
7878
for (int i = 0; i < 1000000; i++) {
7979
x += rng.rand32();
@@ -84,7 +84,7 @@ static void FastRandom_32bit(benchmark::State& state)
8484
static void FastRandom_1bit(benchmark::State& state)
8585
{
8686
FastRandomContext rng(true);
87-
uint32_t x;
87+
uint32_t x = 0;
8888
while (state.KeepRunning()) {
8989
for (int i = 0; i < 1000000; i++) {
9090
x += rng.randbool();

0 commit comments

Comments
 (0)