summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-23 10:54:32 +0000
committertron <tron@openttd.org>2005-01-23 10:54:32 +0000
commit61a3ac68e22c1d621646bbe4e13399491b689980 (patch)
treed75cd057462346fd214b27d418876324adc76405
parent38d6049b8401b7fac9c001a92eccaffe49adc567 (diff)
downloadopenttd-61a3ac68e22c1d621646bbe4e13399491b689980.tar.xz
(svn r1606) Fix some bogus casts
-rw-r--r--misc_gui.c2
-rw-r--r--ttd.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/misc_gui.c b/misc_gui.c
index efa9ffa00..44fc97e78 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1123,7 +1123,7 @@ static void MakeSortedSaveGameList(void)
}
s_amount = _fios_num - sort_start - sort_end;
- if ((bool)s_amount)
+ if (s_amount > 0)
qsort(_fios_list + sort_start, s_amount, sizeof(FiosItem), compare_FiosItems);
}
diff --git a/ttd.c b/ttd.c
index 94bb66272..3ab4676a0 100644
--- a/ttd.c
+++ b/ttd.c
@@ -78,7 +78,7 @@ void CDECL debug(const char *s, ...)
vsprintf(buf, s, va);
va_end(va);
fprintf(stderr, "dbg: %s\n", buf);
- IConsoleDebug((byte *) &buf);
+ IConsoleDebug(buf);
}
void CDECL ShowInfoF(const char *str, ...)
@@ -220,7 +220,7 @@ static char *strecpy(char *dst, const char *src)
byte *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
{
FILE *in;
- void *mem;
+ byte *mem;
size_t len;
in = fopen(filename, "rb");
@@ -230,11 +230,11 @@ byte *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
fseek(in, 0, SEEK_END);
len = ftell(in);
fseek(in, 0, SEEK_SET);
- if (len > maxsize || (mem=(byte*)malloc(len + 1)) == NULL) {
+ if (len > maxsize || (mem = malloc(len + 1)) == NULL) {
fclose(in);
return NULL;
}
- ((byte*)mem)[len] = 0;
+ mem[len] = 0;
if (fread(mem, len, 1, in) != 1) {
fclose(in);
free(mem);