summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/mt_rand.c9
-rw-r--r--src/common/mt_rand.h1
-rw-r--r--src/common/utils.h2
3 files changed, 1 insertions, 11 deletions
diff --git a/src/common/mt_rand.c b/src/common/mt_rand.c
index fc9a9ec..ab733ae 100644
--- a/src/common/mt_rand.c
+++ b/src/common/mt_rand.c
@@ -108,12 +108,3 @@ unsigned long mt_random(void)
y ^= (y << 15) & 0xEFC60000U;
return(y ^ (y >> 18));
}
-
-int mt_rand(void) {
- unsigned long r = mt_random();
- while (r >> 16)
- r = (r & 0xFFFF) + (r >> 16);
-
- return(r);
-}
-
diff --git a/src/common/mt_rand.h b/src/common/mt_rand.h
index bda5861..07f6ef0 100644
--- a/src/common/mt_rand.h
+++ b/src/common/mt_rand.h
@@ -4,6 +4,5 @@
void mt_seed(unsigned long seed);
unsigned long mt_reload(void);
unsigned long mt_random(void);
-int mt_rand(void);
#endif /* __mt_rand_h */
diff --git a/src/common/utils.h b/src/common/utils.h
index 3493808..0b006c3 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -38,5 +38,5 @@
* MRAND(10), returns 0-9.
* MPRAND(5,10) returns 5-14.
*/
-#define MRAND(mod) (mt_rand() % mod)
+#define MRAND(mod) (int) (mt_random() % mod)
#define MPRAND(add, mod) add + MRAND(mod)