diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-08-26 20:07:44 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-08-26 20:07:44 +0400 |
commit | 1046dfb136ec8ad488be50c31fa797d97af0b25a (patch) | |
tree | 562468a2dd9fcf83de878967f3f57d6272d4cfcd | |
parent | 8fb7bbacad4e07410893e42a0517844f9998f33a (diff) |
- tsk tsk, ll suffix for constants is not C standard, doesn't
work on msvc
-rw-r--r-- | source/blender/blenlib/intern/rand.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index a8b59fc58f3..526f190f545 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -44,11 +44,16 @@ #if defined(WIN32) && !defined(FREE_WINDOWS) typedef unsigned __int64 r_uint64; + +#define MULTIPLIER 0x5DEECE66Di64 +#define MASK 0x0000FFFFFFFFFFFFi64 #else typedef unsigned long long r_uint64; + +#define MULTIPLIER 0x5DEECE66Dll +#define MASK 0x0000FFFFFFFFFFFFll #endif -#define MULTIPLIER 0x5DEECE66DLL #define ADDEND 0xB #define LOWSEED 0x330E @@ -78,7 +83,7 @@ void rng_seed(RNG *rng, unsigned int seed) { } int rng_getInt(RNG *rng) { - rng->X= (MULTIPLIER*rng->X + ADDEND)&0x0000FFFFFFFFFFFFLL; + rng->X= (MULTIPLIER*rng->X + ADDEND)&MASK; return (int) (rng->X>>17); } |