Fix warnings

This commit is contained in:
simon.kagstrom 2010-01-30 14:53:54 +00:00
parent 87c10403ad
commit feb9fdfc10

View File

@ -2,12 +2,14 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
/* Ugly kludge to remove warnings. This file should really be fixed instead... */
#define fread(ptr, size, nmemb, stream) do { if (fread(ptr,size,nmemb,stream) != nmemb) printf("fread failed");} while(0)
/********************************************************************************************/ /********************************************************************************************/
static long GetFilePos(int Track, int Sector) static long GetFilePos(int Track, int Sector)
{ {
long pos; long pos;
char buffer[256];
pos = 0; pos = 0;
if (Track >= 1 && Track <= 17) if (Track >= 1 && Track <= 17)
@ -96,16 +98,16 @@ const char **DirD64(const char *FileName) //mode = 0: quiet mode
int cnt = 16; int cnt = 16;
int cur = 0; int cur = 0;
file_list = (const char**)malloc(cnt * sizeof(char*));
file_list[cur] = strdup((char*)"Empty Disc");
file_list[cur + 1] = NULL;
File = fopen(FileName, "rb"); File = fopen(FileName, "rb");
if (!File) if (!File)
{ {
return NULL; return NULL;
} }
file_list = (const char**)malloc(cnt * sizeof(char*));
file_list[cur] = strdup((char*)"Empty Disc");
file_list[cur + 1] = NULL;
pos = GetFilePos(18, 0); pos = GetFilePos(18, 0);
fseek(File, pos, SEEK_SET); fseek(File, pos, SEEK_SET);