diff options
author | worktycho <work.tycho@gmail.com> | 2014-03-14 15:34:29 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-03-14 15:34:29 +0100 |
commit | b8cffe569f8bf6e3379f1c45d9e32a986efac25e (patch) | |
tree | 4688783dbca9b7a6f0ef662926d07e4c5edc25d6 /src/MersenneTwister.h | |
parent | cPlugin:BindConsoleCommand can be called statically. (diff) | |
parent | Merge branch 'master' into warnings (diff) | |
download | cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.gz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.bz2 cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.lz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.xz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.zst cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.zip |
Diffstat (limited to 'src/MersenneTwister.h')
-rw-r--r-- | src/MersenneTwister.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MersenneTwister.h b/src/MersenneTwister.h index f4c7b0699..759b8a1ae 100644 --- a/src/MersenneTwister.h +++ b/src/MersenneTwister.h @@ -62,7 +62,7 @@ class MTRand { // Data public: - typedef long uint32; // unsigned integer type, at least 32 bits + typedef UInt32 uint32; // unsigned integer type, at least 32 bits enum { N = 624 }; // length of state vector enum { SAVE = N + 1 }; // length of array for save() @@ -72,7 +72,7 @@ protected: uint32 state[N]; // internal state uint32 *pNext; // next value to get from state - int left; // number of values left before reload needed + uint32 left; // number of values left before reload needed // Methods public: @@ -164,7 +164,7 @@ inline void MTRand::initialize( const uint32 seed ) // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. uint32 *s = state; uint32 *r = state; - int i = 1; + uint32 i = 1; *s++ = seed & 0xffffffffUL; for( ; i < N; ++i ) { @@ -205,9 +205,9 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) // in each element are discarded. // Just call seed() if you want to get array from /dev/urandom initialize(19650218UL); - int i = 1; + uint32 i = 1; uint32 j = 0; - int k = ( (uint32)N > seedLength ? (uint32)N : seedLength ); + uint32 k = ( (uint32)N > seedLength ? (uint32)N : seedLength ); for( ; k; --k ) { state[i] = |