Mercurial > hg > early-roguelike
diff rogue4/weapons.c @ 215:1b73a8641b37
rogue4: fix most GCC5 warnings.
Converting all function definitions to ANSI style accounts for most of
the change. This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
author | John "Elwin" Edwards |
---|---|
date | Wed, 27 Jan 2016 19:41:05 -0500 |
parents | 9535a08ddc39 |
children | 0250220d8cdd |
line wrap: on
line diff
--- a/rogue4/weapons.c Sat Jan 23 09:35:14 2016 -0500 +++ b/rogue4/weapons.c Wed Jan 27 19:41:05 2016 -0500 @@ -39,8 +39,8 @@ * missile: * Fire a missile in a given direction */ -missile(ydelta, xdelta) -int ydelta, xdelta; +void +missile(int ydelta, int xdelta) { register THING *obj, *nitem; @@ -86,9 +86,8 @@ * Do the actual motion on the screen done by an object traveling * across the room */ -do_motion(obj, ydelta, xdelta) -register THING *obj; -register int ydelta, xdelta; +void +do_motion(THING *obj, int ydelta, int xdelta) { /* * Come fly with us ... @@ -129,9 +128,8 @@ * fall: * Drop an item someplace around here. */ -fall(obj, pr) -register THING *obj; -register bool pr; +void +fall(THING *obj, bool pr) { static coord fpos; register int index; @@ -163,9 +161,8 @@ * init_weapon: * Set up the initial goodies for a weapon */ -init_weapon(weap, type) -register THING *weap; -char type; +void +init_weapon(THING *weap, char type) { register struct init_weps *iwp; @@ -187,9 +184,8 @@ * hit_monster: * Does the missile hit the monster? */ -hit_monster(y, x, obj) -register int y, x; -THING *obj; +bool +hit_monster(int y, int x, THING *obj) { static coord mp; @@ -203,9 +199,7 @@ * Figure out the plus number for armor/weapons */ char * -num(n1, n2, type) -register int n1, n2; -register char type; +num(int n1, int n2, char type) { static char numbuf[10]; @@ -219,7 +213,8 @@ * wield: * Pull out a certain weapon */ -wield() +void +wield(void) { register THING *obj, *oweapon; register char *sp; @@ -257,9 +252,8 @@ * fallpos: * Pick a random position around the give (y, x) coordinates */ -fallpos(pos, newpos, pass) -register coord *pos, *newpos; -register bool pass; +bool +fallpos(coord *pos, coord *newpos, bool pass) { register int y, x, cnt, ch;