diff --git a/Makefile b/Makefile index d28716d..82e02c3 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ override CFLAGS += -D_REENTRANT $(shell sdl-config --cflags) $(DBG) $(WARNFLAGS) all: sdlbomber sdlbomber: announce.o bomber.o draw.o game.o gfx.o sound.o list.o network.o menu.o utils.o - gcc -o $@ $^ $(shell sdl-config --libs) -lavahi-common -lavahi-client $(DBG) + gcc $(LDFLAGS) -o $@ $^ $(shell sdl-config --libs) -lavahi-common -lavahi-client $(DBG) matcher: matcher.c diff --git a/announce.c b/announce.c index 12c353d..ce3e63b 100644 --- a/announce.c +++ b/announce.c @@ -279,7 +279,7 @@ int searchgames(void) { avahi_threaded_poll_lock(threaded_poll); - if (NULL == (browser = avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, NULL, 0, browse_callback, &gameversion))) { + if (NULL == (browser = avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, NULL, 0, browse_callback, NULL))) { fprintf(stderr, "Failed to create service browser: %s\n", avahi_strerror(avahi_client_errno(client))); avahi_threaded_poll_unlock(threaded_poll); return 0; diff --git a/draw.c b/draw.c index a625051..055b89d 100644 --- a/draw.c +++ b/draw.c @@ -97,11 +97,11 @@ static int dopcxreal(char *name,gfxset *gs) { memset(gs,0,sizeof(gfxset)); ileft=0; - sprintf(tname,DATADIR "/%s",name); + snprintf(tname,sizeof(tname),DATADIR "/%s",name); ihand=open(tname,O_RDONLY); if(ihand<0) { - char tname2[256]; - sprintf(tname2,"%s.pcx",tname); + char tname2[260]; + snprintf(tname2,sizeof(tname2),"%s.pcx",tname); ihand=open(tname2,O_RDONLY); if(ihand<0) return 1; @@ -258,7 +258,7 @@ static void bigscrprintf(char *str,...) { va_list ap; va_start(ap, str); - vsprintf(output,str,ap); + vsnprintf(output,sizeof(output),str,ap); p=output; for(;;) { p2=p; @@ -386,7 +386,7 @@ void loadgfx() { gfxset *colorgs; int err; int i; - char name[256]; + char name[267]; strcpy(walkingname,"walk"); strcpy(colorsetname,"pal"); @@ -407,7 +407,7 @@ void loadgfx() { colorgs=gs+1; for(i=0;iowner->color; + /* color=fl->owner->color; */ xpos=tovideox(fl->xpos); ypos=tovideoy(fl->ypos); fig=(fl->timer*10)/FLAMELIFE; @@ -747,9 +748,9 @@ static void applybonus(player *pl,bonustile *bonus) { } static void doplayer(player *pl) { - int last; + /* int last; */ int color; - int speed; + /* int speed; */ int px,py; int there; int flags; @@ -763,9 +764,9 @@ static void doplayer(player *pl) { flags=pl->flags; if(flags&FLG_DEAD) return; color=pl->color; - last=pl->doing; + /* last=pl->doing; */ pl->doing=what; - speed=pl->speed; + /* speed=pl->speed; */ px=screentoarrayx(pl->xpos); py=screentoarrayy(pl->ypos); there=field[py][px]; diff --git a/gfx.c b/gfx.c index 42d8d6c..3eb0c14 100644 --- a/gfx.c +++ b/gfx.c @@ -158,12 +158,12 @@ static void gfxfetchsingle(figure *fig,gfxset *gs,int sourcex,int sourcey,int si { uchar *p,*p2; int dx,dy; -uchar *map1; +/* uchar *map1; */ int gswidth; int minx,miny,maxx,maxy; int tx,ty; - map1=gs->gs_inout; + /* map1=gs->gs_inout; */ gswidth=gs->gs_xsize; p=gs->gs_pic+sourcex+gswidth*sourcey; minx=miny=maxx=maxy=-1; @@ -480,7 +480,7 @@ int checkbuttondown(int button) return buttondown & (1<