Project

General

Profile

« Previous | Next » 

Revision c0d1e8fe

Added by Hamish Coleman over 16 years ago

  • ID c0d1e8fef8b32848f0156ca6561fa4c48abacdff

Clean up lots of compile warnings.
I have been getting lots of errors while testing under wine, so this
is the start of looking for problems. I have not cleaned up any
of the warnings in process_menu_line since that whole function is
an abortion and all the warnings are either send() signedness mismatch
or printf() format warnings.

View differences:

Makefile
wconsd.exe: wconsd.c
gcc -o wconsd.exe wconsd.c -lws2_32
gcc -Wall -o wconsd.exe wconsd.c -lws2_32
test: wconsd.exe
./wconsd.exe -d
wconsd: wconsd.c
winegcc -mno-cygwin -o wconsd wconsd.c -mwindows -lws2_32
winegcc -Wall -mno-cygwin -mwindows -o wconsd wconsd.c -lws2_32
wine: wconsd
/usr/lib/wine/wine.bin wconsd.exe.so -p 9600
wconsd.c
return 0;
va_start(args,fmt);
i=vsprintf(buf,fmt,args);
i=vsnprintf(buf,sizeof(buf),fmt,args);
va_end(args);
if (debug_mode) {
......
DWORD WINAPI wconsd_net_to_com(LPVOID lpParam)
{
BYTE buf[BUFSIZE];
unsigned char buf[BUFSIZE];
DWORD size,wsize;
unsigned long zero=0;
fd_set s;
......
* around that bug. */
FD_SET(cs,&s);
select(0,&s,NULL,NULL,NULL);
size=recv(cs,buf,BUFSIZE,0);
size=recv(cs,(void*)&buf,BUFSIZE,0);
if (size==0) {
SetEvent(connectionCloseEvent);
return 0;
......
DWORD WINAPI wconsd_com_to_net(LPVOID lpParam)
{
BYTE buf[BUFSIZE];
unsigned char buf[BUFSIZE];
DWORD size;
OVERLAPPED o={0};
......
}
}
if (size>0) {
send(cs,buf,size,0);
send(cs,(void*)&buf,size,0);
}
}
return 0;
......
}
int run_menu() {
/* no comment */
BYTE buf[BUFSIZE], line[MAXLEN];
unsigned char buf[BUFSIZE], line[MAXLEN];
DWORD size, linelen=0;
char *buf2split=0, *cmdsplit=0;
BOOL menu=TRUE;
WORD i;
......
send_help(cs);
send(cs,"> ",2,0);
while (menu) {
size=recv(cs,buf,BUFSIZE,0);
size=recv(cs,(void*)&buf,BUFSIZE,0);
if (size==0) {
SetEvent(connectionCloseEvent);
return 1;
......
if (linelen!=0) {
line[linelen]=0; // ensure string is terminated
menu = process_menu_line(line);
menu = process_menu_line((char*)line);
if (!menu) {
return 0;
}
......
linelen++;
// FIXME - dont echo if the other end is in
// linemode
send(cs,&buf[i],1,0); // echo the char
send(cs,(void*)&buf[i],1,0); // echo the char
} else {
send(cs,"\x07",1,0); // bell
}
......
DWORD o;
SOCKET as;
HANDLE netThread=NULL, comThread=NULL;
long zero;
unsigned long zero=0;
struct sockaddr_in sa;
int salen;
......
ResetEvent(threadTermEvent);
}
cs=as;
zero=0;
ioctlsocket(cs,FIONBIO,&zero);
connection[i].menuThread = CreateThread(NULL,0,thread_new_connection,&connection[i],0,NULL);

Also available in: Unified diff