diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-02 02:57:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-02 02:58:27 +0400 |
commit | da4b90a331e7b7ca72c510f0c62781427ba77d3e (patch) | |
tree | 69782927027a9989645dca9259d0b0401d44305c /source/blender/blenlib/intern/rand.c | |
parent | e60b18d51d58e327031961970405453becca1653 (diff) |
Code cleanup: use uint64_t for BLI_rand
Diffstat (limited to 'source/blender/blenlib/intern/rand.c')
-rw-r--r-- | source/blender/blenlib/intern/rand.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index d8fbb3260e8..75ce860c8e8 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -42,30 +42,22 @@ #include "BLI_rand.h" #include "BLI_math.h" +#include "BLI_sys_types.h" #include "BLI_strict_flags.h" -#ifdef _MSC_VER -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 ADDEND 0xB - #define LOWSEED 0x330E extern unsigned char hash[]; // noise.c -/***/ - +/** + * Random Number Generator. + */ struct RNG { - r_uint64 X; + uint64_t X; }; RNG *BLI_rng_new(unsigned int seed) @@ -93,7 +85,7 @@ void BLI_rng_free(RNG *rng) void BLI_rng_seed(RNG *rng, unsigned int seed) { - rng->X = (((r_uint64) seed) << 16) | LOWSEED; + rng->X = (((uint64_t) seed) << 16) | LOWSEED; } void BLI_rng_srandom(RNG *rng, unsigned int seed) |