From 069f39e8a1ebee3e4a4ce8302d0099842876782b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 13 Dec 2012 16:25:50 -0800 Subject: Some formatting fixes before I go insane Also delete the French translation from ladmin. --- src/common/mt_rand.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/common/mt_rand.cpp') diff --git a/src/common/mt_rand.cpp b/src/common/mt_rand.cpp index 676eca1..91ae2e4 100644 --- a/src/common/mt_rand.cpp +++ b/src/common/mt_rand.cpp @@ -61,7 +61,7 @@ static uint32_t state[N+1]; // state vector the +1 is needed due to the coding static uint32_t *next; // next random value is computed from here static int left = -1; // can *next++ this many times before reloading -void mt_seed (uint32_t seed) +void mt_seed(uint32_t seed) { uint32_t x = seed | 1U; uint32_t *s = state; @@ -71,11 +71,11 @@ void mt_seed (uint32_t seed) } static -void mt_reload (void) +void mt_reload(void) { // if mt_seed has never been called if (left < -1) - mt_seed (time (NULL)); + mt_seed(time(NULL)); // conceptually, these are indices into the state that wrap uint32_t *p0 = state; @@ -87,27 +87,27 @@ void mt_reload (void) // regenerate the lower N-M elements of the state for (int j = N-M+1; --j != 0; s0 = s1, s1 = *p2++) - *p0++ = *pM++ ^ (mixBits (s0, s1) >> 1) ^ (loBit (s1) ? K : 0U); + *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); pM = state; // regenerate the next M-1 elements of the state // note that s1 is set to state[N] at the end, but discarded for (int j = M; --j != 0; s0 = s1, s1 = *p2++) - *p0++ = *pM++ ^ (mixBits (s0, s1) >> 1) ^ (loBit (s1) ? K : 0U); + *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); // regenerate the last 1 element of the state s1 = state[0]; - *p0 = *pM ^ (mixBits (s0, s1) >> 1) ^ (loBit (s1) ? K : 0U); + *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U); // ready for the normal mt_random algorithm left = N; next = state; } -uint32_t mt_random (void) +uint32_t mt_random(void) { if (--left < 0) - mt_reload (); + mt_reload(); uint32_t y = *next++; y ^= (y >> 11); -- cgit v1.2.3-70-g09d2