Patch from aaronl to make linux port compile with -Wall
This commit is contained in:
@@ -59,7 +59,7 @@ EXTSYM keyboardhit
|
||||
EXTSYM GUIkeydelay2
|
||||
;EXTSYM _kbhit
|
||||
;EXTSYM _getch
|
||||
EXTSYM _chdrive
|
||||
;EXTSYM _chdrive
|
||||
EXTSYM ZFileMKDir,ZFileCHDir,ZFileRMDir,CHPath,MKPath,RMPath
|
||||
EXTSYM ZFileGetDir,DriveNumber,DirName
|
||||
EXTSYM _getdrive
|
||||
@@ -799,11 +799,11 @@ KeyConvTableS
|
||||
|
||||
NEWSYM Change_Drive
|
||||
; change to drive in dl (0 = A, 1 = B, etc.)
|
||||
and edx,0FFh
|
||||
add edx,1
|
||||
push edx
|
||||
call _chdrive
|
||||
pop edx
|
||||
;and edx,0FFh
|
||||
;add edx,1
|
||||
;push edx
|
||||
;call _chdrive
|
||||
;pop edx
|
||||
; mov ah,0Eh
|
||||
; int 21h
|
||||
ret
|
||||
|
||||
@@ -411,7 +411,6 @@ int ReInitSound(void)
|
||||
BOOL InitJoystickInput(void)
|
||||
{
|
||||
int i;
|
||||
SDL_Event *event;
|
||||
|
||||
// STUB_FUNCTION;
|
||||
|
||||
@@ -498,10 +497,10 @@ int startgame(void)
|
||||
surface = SDL_SetVideoMode(WindowWidth, WindowHeight, BitDepth, flags);
|
||||
if (surface == NULL) {
|
||||
if (BitDepth)
|
||||
fprintf (stderr, "Could not set %dx%dx%d video mode.\n",
|
||||
fprintf (stderr, "Could not set %ld%ld%ld video mode.\n",
|
||||
WindowWidth,WindowHeight,BitDepth);
|
||||
else
|
||||
fprintf (stderr, "Could not set %dx%d video mode.\n",WindowWidth,
|
||||
fprintf (stderr, "Could not set %ldx%ld video mode.\n",WindowWidth,
|
||||
WindowHeight);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1027,7 +1026,6 @@ extern unsigned char newengen;
|
||||
|
||||
void clearwin()
|
||||
{
|
||||
DWORD i,j,color32;
|
||||
DWORD *SURFDW;
|
||||
|
||||
Temp1=LockSurface();
|
||||
@@ -1475,21 +1473,6 @@ void LinuxExit (void)
|
||||
}
|
||||
|
||||
extern char fulladdtab[65536*2];
|
||||
extern WORD vesa2_usbit;
|
||||
extern WORD vesa2_clbit;
|
||||
extern WORD vesa2_rpos;
|
||||
extern WORD vesa2_rfull;
|
||||
extern WORD vesa2_rtrcl;
|
||||
extern WORD vesa2_rtrcla;
|
||||
extern WORD vesa2_gpos;
|
||||
extern WORD vesa2_gfull;
|
||||
extern WORD vesa2_gtrcl;
|
||||
extern WORD vesa2_gtrcla;
|
||||
extern WORD vesa2_bpos;
|
||||
extern WORD vesa2_bfull;
|
||||
extern WORD vesa2_btrcl;
|
||||
extern WORD vesa2_btrcla;
|
||||
extern WORD nojoystickpoll;
|
||||
|
||||
extern void SwitchFullScreen(void);
|
||||
|
||||
@@ -1532,8 +1515,6 @@ void WinUpdateDevices()
|
||||
// keys[1]=keys[16];
|
||||
keys[0]=0;
|
||||
|
||||
// if (nojoystickpoll) return;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
if(JoystickInput[i])
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
@@ -171,7 +173,6 @@ DWORD ZCloseFile()
|
||||
|
||||
DWORD ZFileSeek()
|
||||
{
|
||||
int res = 0;
|
||||
int mode = 0;
|
||||
if (ZFileSeekMode==0)
|
||||
mode = SEEK_SET;
|
||||
@@ -319,7 +320,7 @@ DWORD ZFileFindNext()
|
||||
stat ( globbuf.gl_pathv[globcur], &filetype );
|
||||
|
||||
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
if(((ZFileFindATTRIB&0x10)==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
|
||||
if ( S_ISDIR ( filetype.st_mode ))
|
||||
*(char *)(DTALocPos + 0x15) = 0x10;
|
||||
@@ -362,7 +363,7 @@ DWORD ZFileFindFirst()
|
||||
stat ( globbuf.gl_pathv[globcur], &filetype );
|
||||
|
||||
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
if(((ZFileFindATTRIB&0x10)==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||
|
||||
if ( S_ISDIR ( filetype.st_mode ))
|
||||
*(char *)(DTALocPos + 0x15) = 0x10;
|
||||
@@ -441,14 +442,6 @@ DWORD GetDate()
|
||||
}
|
||||
|
||||
#ifdef __LINUX__
|
||||
int _chdrive( int drive )
|
||||
{
|
||||
// STUB_FUNCTION;
|
||||
}
|
||||
int _getdrive( void )
|
||||
{
|
||||
// STUB_FUNCTION;
|
||||
}
|
||||
|
||||
extern char SRAMDir;
|
||||
extern char InitDir;
|
||||
|
||||
@@ -22,6 +22,8 @@ Initial Linux Command Line Parsing by EvilTypeGuy (drevil@warpcore.org) April 20
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
|
||||
#define DWORD unsigned long
|
||||
@@ -76,8 +78,23 @@ char ucase(char ch){
|
||||
return(ch);
|
||||
}
|
||||
|
||||
int my_atoi(char *nptr) {
|
||||
int p,c;
|
||||
|
||||
c = 0;
|
||||
for(p = 0; nptr[p]; p++) {
|
||||
if ( !isdigit(nptr[p]) ) c += 1;
|
||||
}
|
||||
|
||||
if (c) return -1;
|
||||
|
||||
return atoi(nptr);
|
||||
}
|
||||
|
||||
extern void UnProtectMemory (void);
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
int opt,hasroom,p,pp,arg;
|
||||
int opt,hasroom,p,pp;
|
||||
|
||||
char *fvar;
|
||||
|
||||
@@ -342,22 +359,12 @@ int main (int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
zstart();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int my_atoi(char *nptr) {
|
||||
int p,c;
|
||||
|
||||
c = 0;
|
||||
for(p = 0; nptr[p]; p++) {
|
||||
if ( !isdigit(nptr[p]) ) c += 1;
|
||||
}
|
||||
|
||||
if (c) return -1;
|
||||
|
||||
else
|
||||
|
||||
return atoi(nptr);
|
||||
int pccmdline(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -389,7 +396,3 @@ void ccmdline(void) {
|
||||
printf("cmdline returned %i\n",p);
|
||||
DosExit();
|
||||
}
|
||||
|
||||
int pccmdline(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
// In-game chat will be moved to a separate packet in TCP/IP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#ifdef __LINUX__
|
||||
#include <sys/time.h>
|
||||
@@ -234,7 +235,6 @@ void DeInitTCP()
|
||||
|
||||
void GetUDPStatus() {
|
||||
int retval;
|
||||
char NoSend = 0;
|
||||
|
||||
UDPEnable=UDPConfig;
|
||||
|
||||
@@ -268,7 +268,6 @@ void GetUDPStatus() {
|
||||
|
||||
int isipval(char *name){
|
||||
int i;
|
||||
int tcperr;
|
||||
i=0;
|
||||
while(name[i]!=0){
|
||||
if (!((name[i]=='.') || ((name[i]>='0') && (name[i]<='9'))))
|
||||
@@ -283,7 +282,6 @@ int ConnectServer(char *servername, unsigned int port)
|
||||
char blah[255];
|
||||
int retval,i;
|
||||
LPHOSTENT host1;
|
||||
unsigned long addr1;
|
||||
int yesip;
|
||||
#ifndef __LINUX__
|
||||
WSADATA wsadata;
|
||||
@@ -451,7 +449,7 @@ int WaitForServer(){
|
||||
int i;
|
||||
|
||||
if (UDPEnable){
|
||||
if (i=GetData(1,blah)){
|
||||
if ((i=GetData(1,blah))){
|
||||
if ((i==1) && (blah[0]==1))
|
||||
return(1);
|
||||
}
|
||||
@@ -492,7 +490,7 @@ void Disconnect()
|
||||
|
||||
int StartServerCycle(unsigned short port)
|
||||
{
|
||||
int retval,sizet,i;
|
||||
int retval,i;
|
||||
|
||||
portval = port;
|
||||
packetnum = 0;
|
||||
@@ -621,10 +619,6 @@ int StartServerCycle(unsigned short port)
|
||||
|
||||
int acceptzuser()
|
||||
{
|
||||
int retval,r,i;
|
||||
LPHOSTENT host1;
|
||||
int yesip;
|
||||
|
||||
if (UDPEnable)
|
||||
{
|
||||
return(0);
|
||||
@@ -724,6 +718,32 @@ void StopServer()
|
||||
}
|
||||
|
||||
|
||||
int GetLeftUDP()
|
||||
{
|
||||
#ifdef __LINUX__
|
||||
fd_set zrf;
|
||||
#else
|
||||
FD_SET zrf;
|
||||
#endif
|
||||
struct timeval nto;
|
||||
int r;
|
||||
|
||||
nto.tv_sec=0;
|
||||
nto.tv_usec=0; /* return immediately */
|
||||
|
||||
FD_ZERO(&zrf);
|
||||
FD_SET(userversocket,&zrf);
|
||||
r=select(userversocket+1,&zrf,0,0,&nto);
|
||||
|
||||
if (r == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(userversocket);
|
||||
return(-1);
|
||||
}
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************\
|
||||
* Send data *
|
||||
* - parameters : *
|
||||
@@ -887,7 +907,6 @@ extern void UpdateVFrame(void);
|
||||
int SendData(int dsize,unsigned char *dptr)
|
||||
{
|
||||
int retval;
|
||||
char message1[256];
|
||||
|
||||
if (UDPEnable){
|
||||
/* retval = sendto(ugamesocket,dptr,dsize,0,(struct sockaddr *)&ugameaddress,sizeof(ugameaddress));
|
||||
@@ -1105,32 +1124,6 @@ int GetLeft()
|
||||
return(tempsize);
|
||||
}
|
||||
|
||||
int GetLeftUDP()
|
||||
{
|
||||
#ifdef __LINUX__
|
||||
fd_set zrf;
|
||||
#else
|
||||
FD_SET zrf;
|
||||
#endif
|
||||
struct timeval nto;
|
||||
int r;
|
||||
int tempsize;
|
||||
|
||||
nto.tv_sec=0;
|
||||
nto.tv_usec=0; /* return immediately */
|
||||
|
||||
FD_ZERO(&zrf);
|
||||
FD_SET(userversocket,&zrf);
|
||||
r=select(userversocket+1,&zrf,0,0,&nto);
|
||||
|
||||
if (r == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(userversocket);
|
||||
return(-1);
|
||||
}
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************\
|
||||
* Receive data *
|
||||
|
||||
Reference in New Issue
Block a user