diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2012-12-16 17:47:51 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2012-12-24 10:02:00 -0800 |
commit | b52127bcbf817ff8285b36d22198b275327e16bb (patch) | |
tree | 7bc596289c011e719168bef846b8cf63bf5d4947 /src/common/mt_rand.cpp | |
parent | 4bd7eeec09629d3c0f900d42c899fe23c69e07b6 (diff) | |
download | tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.gz tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.bz2 tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.xz tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.zip |
Cleanup headers and remove all uses of va_list except logging
Diffstat (limited to 'src/common/mt_rand.cpp')
-rw-r--r-- | src/common/mt_rand.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common/mt_rand.cpp b/src/common/mt_rand.cpp index 91ae2e4..651620a 100644 --- a/src/common/mt_rand.cpp +++ b/src/common/mt_rand.cpp @@ -45,9 +45,10 @@ // */ -#include <time.h> #include "mt_rand.hpp" +#include <ctime> + #define N 624 // length of state vector #define M 397 // a period parameter #define K 0x9908B0DFU // a magic constant @@ -57,9 +58,12 @@ #define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u #define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v -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 +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) { |