(svn r1606) Fix some bogus casts

This commit is contained in:
tron 2005-01-23 10:54:32 +00:00
parent fd25a53d1b
commit 9f60324821
2 changed files with 5 additions and 5 deletions

View File

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

8
ttd.c
View File

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