summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-03 21:20:01 +0000
committertron <tron@openttd.org>2005-10-03 21:20:01 +0000
commitdb3b1228bfad7fb42ce708dc93db21d840b07577 (patch)
tree4379525d1560a92903c1fdc87cdbad70a36ea271 /misc.c
parentb0a365ee676b8b612d88a3df1cac904db73e8bcf (diff)
downloadopenttd-db3b1228bfad7fb42ce708dc93db21d840b07577.tar.xz
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 90fd7228e..9ac16b00f 100644
--- a/misc.c
+++ b/misc.c
@@ -51,12 +51,12 @@ uint32 t;
#if defined(RANDOM_DEBUG) && !defined(MERSENNE_TWISTER)
uint DoRandomRange(uint max, int line, const char *file)
{
- return (uint16)DoRandom(line, file) * max >> 16;
+ return GB(DoRandom(line, file), 0, 16) * max >> 16;
}
#else
uint RandomRange(uint max)
{
- return (uint16)Random() * max >> 16;
+ return GB(Random(), 0, 16) * max >> 16;
}
#endif
@@ -71,7 +71,7 @@ uint32 InteractiveRandom(void)
uint InteractiveRandomRange(uint max)
{
- return (uint16)InteractiveRandom() * max >> 16;
+ return GB(InteractiveRandom(), 0, 16) * max >> 16;
}
void SetDate(uint date)