[Bf-blender-cvs] [da4b90a] master: Code cleanup: use uint64_t for BLI_rand
Campbell Barton
noreply at git.blender.org
Wed Apr 2 01:10:52 CEST 2014
Commit: da4b90a331e7b7ca72c510f0c62781427ba77d3e
Author: Campbell Barton
Date: Wed Apr 2 09:57:48 2014 +1100
https://developer.blender.org/rBda4b90a331e7b7ca72c510f0c62781427ba77d3e
Code cleanup: use uint64_t for BLI_rand
===================================================================
M source/blender/blenlib/intern/rand.c
===================================================================
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c
index d8fbb32..75ce860 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)
More information about the Bf-blender-cvs
mailing list