diff --git a/src/rand.c b/src/rand.c index ddc555a..12f623a 100644 --- a/src/rand.c +++ b/src/rand.c @@ -4,7 +4,7 @@ static unsigned long long mcg_state = 0xcafef00dd15ea5e5u; // Must be odd static unsigned long long const multiplier = 6364136223846793005u; // https://en.wikipedia.org/wiki/Permuted_congruential_generator -static unsigned long rand(void) { +static unsigned long fast_rand(void) { unsigned long long x = mcg_state; unsigned count = (unsigned)(x >> 61); @@ -15,9 +15,9 @@ static unsigned long rand(void) { void rand_set_seed(unsigned long long seed) { mcg_state = 2 * seed + 1; - (void)rand(); + (void)fast_rand(); } unsigned int rand_uint(const unsigned int max) { - return max == 0 ? 0 : (unsigned int)(rand() % max); + return max == 0 ? 0 : (unsigned int)(fast_rand() % max); }