From 2d6f5f0903bd97a38056a65431b07bb7baf5039a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Jun 2012 07:41:37 +0000 Subject: Silly RandomCmwc, it was using a static variable somewhere. That's fixed now. --- src/stable/randomcmwc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/stable/randomcmwc.cpp') diff --git a/src/stable/randomcmwc.cpp b/src/stable/randomcmwc.cpp index a4e807e..ccfc4a9 100644 --- a/src/stable/randomcmwc.cpp +++ b/src/stable/randomcmwc.cpp @@ -23,20 +23,19 @@ Bu::RandomCmwc::~RandomCmwc() void Bu::RandomCmwc::seed( int32_t iSeed ) { - int i; + i = 4096; q[0] = iSeed; q[1] = iSeed + PHI; q[2] = iSeed + PHI + PHI; - for (i = 3; i < 4096; i++) - q[i] = q[i - 3] ^ q[i - 2] ^ PHI ^ i; + for (int j = 3; j < 4096; j++) + q[j] = q[j - 3] ^ q[j - 2] ^ PHI ^ j; } int32_t Bu::RandomCmwc::rand() { uint64_t t, a = 18782LL; - static uint32_t i = 4095; uint32_t x, r = 0xfffffffe; i = (i + 1) & 4095; t = a * q[i] + c; -- cgit v1.2.3