From 71032882d3a053f2959dce696ff22ba183396da3 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 3 Jul 2010 02:50:01 +0200 Subject: [PATCH] fast_random(): Truthfully return uint16_t instead of unsigned long --- random.c | 2 +- random.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/random.c b/random.c index 6959e3b..f488f96 100644 --- a/random.c +++ b/random.c @@ -19,7 +19,7 @@ fast_getseed(void) return pmseed; } -unsigned long +uint16_t fast_random(unsigned int max) { unsigned long hi, lo; diff --git a/random.h b/random.h index 0512e39..5d15071 100644 --- a/random.h +++ b/random.h @@ -1,10 +1,12 @@ #ifndef ZZGO_RANDOM_H #define ZZGO_RANDOM_H +#include + void fast_srandom(unsigned long seed); unsigned long fast_getseed(void); /* Note that only 16bit numbers can be returned. */ -unsigned long fast_random(unsigned int max); +uint16_t fast_random(unsigned int max); /* Get random number in [0..1] range. */ float fast_frandom(); -- 2.11.4.GIT