Fixed signs and utter stupidity. GCC 4 happy.

This commit is contained in:
n-a-c-h
2005-07-19 20:13:18 +00:00
parent 5ce108e3dc
commit f3e1930ac5

View File

@@ -41,9 +41,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <io.h> #include <io.h>
#endif #endif
#define DWORD unsigned int
#define BYTE unsigned char
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
#define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid()) #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
#endif #endif
@@ -51,68 +48,68 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
FILE *FILEHANDLE[16]; FILE *FILEHANDLE[16];
DWORD CurrentHandle=0; unsigned int CurrentHandle=0;
// ZFileSystemInit // ZFileSystemInit
// return 0 // return 0
// ZOpenFile info : // ZOpenFile info :
BYTE * ZOpenFileName; char * ZOpenFileName;
DWORD ZOpenMode; unsigned int ZOpenMode;
// Open modes : 0 read/write in // Open modes : 0 read/write in
// 1 write (create file, overwrite) // 1 write (create file, overwrite)
// return file handle if success, 0xFFFFFFFF if error // return file handle if success, 0xFFFFFFFF if error
// ZCloseFile info : // ZCloseFile info :
DWORD ZCloseFileHandle; unsigned int ZCloseFileHandle;
// return 0 // return 0
// ZFileSeek info : // ZFileSeek info :
DWORD ZFileSeekHandle; unsigned int ZFileSeekHandle;
DWORD ZFileSeekPos; unsigned int ZFileSeekPos;
DWORD ZFileSeekMode; // 0 start, 1 end unsigned int ZFileSeekMode; // 0 start, 1 end
// return 0 // return 0
// ZFileReadBlock info : // ZFileReadBlock info :
BYTE * ZFileReadBlock; char * ZFileReadBlock;
DWORD ZFileReadSize; unsigned int ZFileReadSize;
DWORD ZFileReadHandle; unsigned int ZFileReadHandle;
// return 0 // return 0
// ZFileWriteBlock info : // ZFileWriteBlock info :
BYTE * ZFileWriteBlock; char * ZFileWriteBlock;
DWORD ZFileWriteSize; unsigned int ZFileWriteSize;
DWORD ZFileWriteHandle; unsigned int ZFileWriteHandle;
// return 0 // return 0
// ZFileTell // ZFileTell
DWORD ZFileTellHandle; unsigned int ZFileTellHandle;
// ZFileGetftime // ZFileGetftime
BYTE * ZFFTimeFName; char * ZFFTimeFName;
DWORD ZFTimeHandle; unsigned int ZFTimeHandle;
DWORD ZFDate; unsigned int ZFDate;
DWORD ZFTime; unsigned int ZFTime;
// MKDir/CHDir // MKDir/CHDir
BYTE * MKPath; char * MKPath;
BYTE * CHPath; char * CHPath;
BYTE * RMPath; char * RMPath;
//Indicate whether the file must be opened using //Indicate whether the file must be opened using
//zlib or not (used for gzip support) //zlib or not (used for gzip support)
BYTE TextFile; char TextFile;
// GetDir // GetDir
BYTE * DirName; char * DirName;
DWORD DriveNumber; unsigned int DriveNumber;
// ZFileDelete // ZFileDelete
BYTE * ZFileDelFName; char * ZFileDelFName;
// return current position // return current position
DWORD ZFileSystemInit() unsigned int ZFileSystemInit()
{ {
#ifdef __GZIP__ #ifdef __GZIP__
TextFile = 0; TextFile = 0;
@@ -123,7 +120,7 @@ DWORD ZFileSystemInit()
return(0); return(0);
} }
DWORD ZOpenFile() unsigned int ZOpenFile()
{ {
if(ZOpenMode==0) if(ZOpenMode==0)
{ {
@@ -167,7 +164,7 @@ DWORD ZOpenFile()
return(0xFFFFFFFF); return(0xFFFFFFFF);
} }
DWORD ZCloseFile() unsigned int ZCloseFile()
{ {
if (TextFile) if (TextFile)
fclose(FILEHANDLE[ZCloseFileHandle]); fclose(FILEHANDLE[ZCloseFileHandle]);
@@ -177,7 +174,7 @@ DWORD ZCloseFile()
return(0); return(0);
} }
DWORD ZFileSeek() unsigned int ZFileSeek()
{ {
int mode = 0; int mode = 0;
if (ZFileSeekMode==0) if (ZFileSeekMode==0)
@@ -198,7 +195,7 @@ DWORD ZFileSeek()
return(0xFFFFFFFF); return(0xFFFFFFFF);
} }
DWORD ZFileRead() unsigned int ZFileRead()
{ {
if (TextFile) if (TextFile)
return(fread(ZFileReadBlock, return(fread(ZFileReadBlock,
@@ -212,9 +209,9 @@ DWORD ZFileRead()
} }
DWORD ZFileWrite() unsigned int ZFileWrite()
{ {
DWORD res=0; unsigned int res=0;
if (TextFile) if (TextFile)
res = fwrite(ZFileWriteBlock, res = fwrite(ZFileWriteBlock,
1, 1,
@@ -231,7 +228,7 @@ DWORD ZFileWrite()
return(0); return(0);
} }
DWORD ZFileTell() unsigned int ZFileTell()
{ {
int res = 0; int res = 0;
if (TextFile) { if (TextFile) {
@@ -241,12 +238,12 @@ DWORD ZFileTell()
} else return gztell(FILEHANDLE[ZFileTellHandle]); } else return gztell(FILEHANDLE[ZFileTellHandle]);
} }
DWORD ZFileDelete() unsigned int ZFileDelete()
{ {
return(remove(ZFileDelFName)); return(remove(ZFileDelFName));
} }
DWORD ZFileGetFTime() unsigned int ZFileGetFTime()
{ {
struct stat filestat; struct stat filestat;
@@ -258,7 +255,7 @@ DWORD ZFileGetFTime()
return(0); return(0);
} }
DWORD ZFileMKDir() unsigned int ZFileMKDir()
{ {
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
return(mkdir(MKPath, (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH))); return(mkdir(MKPath, (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)));
@@ -268,12 +265,12 @@ DWORD ZFileMKDir()
} }
DWORD ZFileCHDir() unsigned int ZFileCHDir()
{ {
return(chdir(CHPath)); return(chdir(CHPath));
} }
DWORD ZFileRMDir() unsigned int ZFileRMDir()
{ {
return(rmdir(RMPath)); return(rmdir(RMPath));
} }
@@ -283,9 +280,9 @@ char *ZFileGetDir()
return(getcwd(DirName,128)); return(getcwd(DirName,128));
} }
BYTE * ZFileFindPATH; char * ZFileFindPATH;
DWORD ZFileFindATTRIB; unsigned int ZFileFindATTRIB;
DWORD DTALocPos; unsigned int DTALocPos;
//struct _find_t { //struct _find_t {
// char reserved[21] __attribute__((packed)); // char reserved[21] __attribute__((packed));
@@ -307,7 +304,7 @@ glob_t globbuf;
int globcur; int globcur;
#endif #endif
DWORD ZFileFindNext() unsigned int ZFileFindNext()
{ {
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
//STUB_FUNCTION; //STUB_FUNCTION;
@@ -355,7 +352,7 @@ DWORD ZFileFindNext()
return(0); return(0);
} }
DWORD ZFileFindFirst() unsigned int ZFileFindFirst()
{ {
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
//STUB_FUNCTION; //STUB_FUNCTION;
@@ -403,7 +400,7 @@ DWORD ZFileFindFirst()
} }
DWORD ZFileFindEnd() // for compatibility with windows later unsigned int ZFileFindEnd() // for compatibility with windows later
{ {
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
//STUB_FUNCTION; //STUB_FUNCTION;
@@ -418,17 +415,17 @@ DWORD ZFileFindEnd() // for compatibility with windows later
} }
//BYTE * DirName; //char * DirName;
//DWORD DriveNumber; //unsigned int DriveNumber;
//unsigned int _dos_findfirst(char *_name, unsigned int _attr, struct _find_t *_result); //unsigned int _dos_findfirst(char *_name, unsigned int _attr, struct _find_t *_result);
//unsigned int _dos_findnext(struct _find_t *_result); //unsigned int _dos_findnext(struct _find_t *_result);
DWORD GetTime() unsigned int GetTime()
{ {
DWORD value; unsigned int value;
struct tm *newtime; struct tm *newtime;
time_t long_time; time_t long_time;
@@ -441,10 +438,10 @@ DWORD GetTime()
return(value); return(value);
} }
DWORD GetDate() unsigned int GetDate()
{ {
DWORD value; unsigned int value;
struct tm *newtime; struct tm *newtime;
time_t long_time; time_t long_time;
@@ -503,7 +500,7 @@ void obtaindir()
void GetFilename() void GetFilename()
{ {
extern char fnamest, fnames; extern char fnamest;
extern int statefileloc; extern int statefileloc;
char *tmp = &fnamest; char *tmp = &fnamest;
char size; char size;