diff options
author | tron <tron@openttd.org> | 2005-01-23 10:54:32 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-23 10:54:32 +0000 |
commit | 9f60324821192b29cd7fa58f3445af0df0a92784 (patch) | |
tree | d75cd057462346fd214b27d418876324adc76405 | |
parent | fd25a53d1be1d324fab3fb7c1cd7aba96c1e5f96 (diff) | |
download | openttd-9f60324821192b29cd7fa58f3445af0df0a92784.tar.xz |
(svn r1606) Fix some bogus casts
-rw-r--r-- | misc_gui.c | 2 | ||||
-rw-r--r-- | ttd.c | 8 |
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); } @@ -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); |