fix some warnings

This commit is contained in:
Stefan Bühler 2017-06-12 12:47:01 +02:00
parent e567abcc93
commit ed516154d8
6 changed files with 27 additions and 28 deletions

View File

@ -279,7 +279,7 @@ int searchgames(void) {
avahi_threaded_poll_lock(threaded_poll); 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))); fprintf(stderr, "Failed to create service browser: %s\n", avahi_strerror(avahi_client_errno(client)));
avahi_threaded_poll_unlock(threaded_poll); avahi_threaded_poll_unlock(threaded_poll);
return 0; return 0;

13
game.c
View File

@ -468,11 +468,12 @@ static void drawbombs(void) {
static void drawflames(void) { static void drawflames(void) {
flame *fl; flame *fl;
int xpos,ypos; int xpos,ypos;
int color; /* no player specific flame sprites yet */
/* int color; */
int fig; int fig;
list_for_each_entry(fl, &activeflames, list) { list_for_each_entry(fl, &activeflames, list) {
color=fl->owner->color; /* color=fl->owner->color; */
xpos=tovideox(fl->xpos); xpos=tovideox(fl->xpos);
ypos=tovideoy(fl->ypos); ypos=tovideoy(fl->ypos);
fig=(fl->timer*10)/FLAMELIFE; fig=(fl->timer*10)/FLAMELIFE;
@ -747,9 +748,9 @@ static void applybonus(player *pl,bonustile *bonus) {
} }
static void doplayer(player *pl) { static void doplayer(player *pl) {
int last; /* int last; */
int color; int color;
int speed; /* int speed; */
int px,py; int px,py;
int there; int there;
int flags; int flags;
@ -763,9 +764,9 @@ static void doplayer(player *pl) {
flags=pl->flags; flags=pl->flags;
if(flags&FLG_DEAD) return; if(flags&FLG_DEAD) return;
color=pl->color; color=pl->color;
last=pl->doing; /* last=pl->doing; */
pl->doing=what; pl->doing=what;
speed=pl->speed; /* speed=pl->speed; */
px=screentoarrayx(pl->xpos); px=screentoarrayx(pl->xpos);
py=screentoarrayy(pl->ypos); py=screentoarrayy(pl->ypos);
there=field[py][px]; there=field[py][px];

8
gfx.c
View File

@ -158,12 +158,12 @@ static void gfxfetchsingle(figure *fig,gfxset *gs,int sourcex,int sourcey,int si
{ {
uchar *p,*p2; uchar *p,*p2;
int dx,dy; int dx,dy;
uchar *map1; /* uchar *map1; */
int gswidth; int gswidth;
int minx,miny,maxx,maxy; int minx,miny,maxx,maxy;
int tx,ty; int tx,ty;
map1=gs->gs_inout; /* map1=gs->gs_inout; */
gswidth=gs->gs_xsize; gswidth=gs->gs_xsize;
p=gs->gs_pic+sourcex+gswidth*sourcey; p=gs->gs_pic+sourcex+gswidth*sourcey;
minx=miny=maxx=maxy=-1; minx=miny=maxx=maxy=-1;
@ -480,7 +480,7 @@ int checkbuttondown(int button)
return buttondown & (1<<button); return buttondown & (1<<button);
} }
int anydown() int anydown(void)
{ {
return numdown; return numdown;
} }
@ -498,7 +498,7 @@ int res=0;
} }
return res; return res;
} }
int firstdown(vopid) int firstdown(void)
{ {
return *downcodes; return *downcodes;
} }

26
gfx.h
View File

@ -28,38 +28,38 @@ void closegfx(void);
void greyrect(int x,int y,int xsize,int ysize); void greyrect(int x,int y,int xsize,int ysize);
void clearrect(int x,int y,int xsize,int ysize); void clearrect(int x,int y,int xsize,int ysize);
void solidfetch(gfxset *gs,solid *dest); void solidfetch(gfxset *gs,solid *dest);
extern void dumpgfx(); extern void dumpgfx(void);
extern void createinout(struct gfxset *); extern void createinout(struct gfxset *);
extern void getcolors(); extern void getcolors(void);
extern void gfxfetch(struct gfxset *,struct figure *,int); extern void gfxfetch(struct gfxset *,struct figure *,int);
extern void puttile(int destx,int desty,int source); extern void puttile(int destx,int desty,int source);
extern void store(int x,int y,int which); extern void store(int x,int y,int which);
extern void restore(int x,int y,int which); extern void restore(int x,int y,int which);
extern void copyup(); extern void copyup(void);
extern void copyupxy(int x,int y); extern void copyupxy(int x,int y);
extern void copyupxysize(int x,int y,int xsize,int ysize); extern void copyupxysize(int x,int y,int xsize,int ysize);
extern void getfigures(); extern void getfigures(void);
extern unsigned long getcolor(char *name); /* unsigned long */ extern unsigned long getcolor(char *name); /* unsigned long */
extern int checkpressed(int code); extern int checkpressed(int code);
extern int checkdown(int code); extern int checkdown(int code);
extern int checkbutton(int button); extern int checkbutton(int button);
extern int checkbuttondown(int button); extern int checkbuttondown(int button);
extern int anydown(); extern int anydown(void);
extern int firstdown(); extern int firstdown(void);
extern void scaninput(); extern void scaninput(void);
extern void fontinit(); extern void fontinit(void);
extern void writechar(int x,int y,uchar ch); extern void writechar(int x,int y,uchar ch);
extern void clear(); extern void clear(void);
extern void drawbox(int x,int y,int size,int color); extern void drawbox(int x,int y,int size,int color);
extern void drawbox2(int x,int y,int sizex,int sizey,int color); extern void drawbox2(int x,int y,int sizex,int sizey,int color);
extern void drawfillrect(int x,int y,int size,int color); extern void drawfillrect(int x,int y,int size,int color);
extern void bigpixel(int x,int y,int color); extern void bigpixel(int x,int y,int color);
extern void invert(int x,int y); extern void invert(int x,int y);
extern int getmousex(); extern int getmousex(void);
extern int getmousey(); extern int getmousey(void);
extern void drawsquare(int x,int y,uchar *source); extern void drawsquare(int x,int y,uchar *source);
extern void colormapon(); extern void colormapon(void);
extern void colormapoff(); extern void colormapoff(void);
extern void palette(uchar *pal); extern void palette(uchar *pal);
extern void drawfigure(int x,int y,figure *fig); extern void drawfigure(int x,int y,figure *fig);
extern void drawfigureany(int x,int y,figure *fig,solid *dest); extern void drawfigureany(int x,int y,figure *fig,solid *dest);

2
list.c
View File

@ -21,8 +21,6 @@ static genericlistitem *free_things;
static int count_used = 0; static int count_used = 0;
static const int num = MAXTHINGS;
void alloc_things(void) { void alloc_things(void) {
int i; int i;

View File

@ -149,7 +149,7 @@ void soundclose(void) {
int readsound(int num) { int readsound(int num) {
char name[256],*p1,*p2,ch; char name[256],*p1,*p2,ch;
int i,file,size,len; int file,size,len;
p1=dirlist; p1=dirlist;
for(;;) for(;;)
{ {
@ -173,7 +173,7 @@ int i,file,size,len;
p1=samples[num].data=malloc(len); p1=samples[num].data=malloc(len);
if(p1) if(p1)
{ {
i=read(file,p1,size); read(file,p1,size);
if(len-size) memset(p1+size,0,len-size); if(len-size) memset(p1+size,0,len-size);
while(size--) *p1++ ^= 0x80; while(size--) *p1++ ^= 0x80;
} else } else