Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-02 02:57:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-02 02:58:27 +0400
commitda4b90a331e7b7ca72c510f0c62781427ba77d3e (patch)
tree69782927027a9989645dca9259d0b0401d44305c /source/blender/blenlib/intern/rand.c
parente60b18d51d58e327031961970405453becca1653 (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.c20
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)