1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 01:29:10 +00:00

(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them

This commit is contained in:
tron
2005-10-03 21:20:01 +00:00
parent b0a365ee67
commit db3b1228bf
12 changed files with 48 additions and 44 deletions

6
misc.c
View File

@@ -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)