From b4b4745bd4e56e87ef31f91ba2752a5801ca0e4a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 16 Aug 2021 04:59:10 +0200 Subject: [PATCH] Amend 55211b8d (PRNG seed, use local address) --- libs/pbd/pcg_rand.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/pbd/pcg_rand.cc b/libs/pbd/pcg_rand.cc index 493667aa62..7838694582 100644 --- a/libs/pbd/pcg_rand.cc +++ b/libs/pbd/pcg_rand.cc @@ -25,11 +25,12 @@ using namespace PBD; PCGRand::PCGRand () + : _state (0) + , _foo (0) { - int foo = 0; - uint64_t initseq = (intptr_t)&foo; - _state = 0; + uint64_t initseq = (intptr_t)&_foo; _inc = (initseq << 1) | 1; + rand_u32 (); _state += time (NULL) ^ (intptr_t)this; rand_u32 ();