Mercurial > hg > early-roguelike
diff arogue7/weapons.c @ 219:f9ef86cf22b2
Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
author | John "Elwin" Edwards |
---|---|
date | Fri, 19 Feb 2016 21:02:28 -0500 |
parents | b786053d2f37 |
children | 28e22fb35989 |
line wrap: on
line diff
--- a/arogue7/weapons.c Sun Feb 07 14:39:21 2016 -0500 +++ b/arogue7/weapons.c Fri Feb 19 21:02:28 2016 -0500 @@ -22,10 +22,8 @@ #include <string.h> #include "rogue.h" -boomerang(ydelta, xdelta, item, tp) -int ydelta, xdelta; -register struct linked_list *item; -register struct thing *tp; +void +boomerang(int ydelta, int xdelta, struct linked_list *item, struct thing *tp) { register struct object *obj; struct thing midpoint; @@ -56,10 +54,8 @@ * across the room. Note that we should not look at any field in * tp other than t_pos unless we change boomerang(). */ -do_motion(obj, ydelta, xdelta, tp) -register struct object *obj; -register int ydelta, xdelta; -register struct thing *tp; +void +do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp) { /* @@ -115,9 +111,8 @@ * Drop an item someplace around here. */ -fall(item, pr) -register struct linked_list *item; -bool pr; +void +fall(struct linked_list *item, bool pr) { register struct object *obj; register struct room *rp; @@ -170,10 +165,8 @@ * Does the missile hit the monster */ -hit_monster(y, x, obj, tp) -register int y, x; -struct object *obj; -register struct thing *tp; +bool +hit_monster(int y, int x, struct object *obj, struct thing *tp) { static coord mp; @@ -203,9 +196,8 @@ * Set up the initial goodies for a weapon */ -init_weapon(weap, type) -register struct object *weap; -char type; +void +init_weapon(struct object *weap, char type) { register struct init_weps *iwp; @@ -228,10 +220,8 @@ * Fire a missile in a given direction */ -missile(ydelta, xdelta, item, tp) -int ydelta, xdelta; -register struct linked_list *item; -register struct thing *tp; +void +missile(int ydelta, int xdelta, struct linked_list *item, struct thing *tp) { register struct object *obj; register struct linked_list *nitem; @@ -303,8 +293,7 @@ */ char * -num(n1, n2) -register int n1, n2; +num(int n1, int n2) { static char numbuf[LINELEN]; @@ -324,7 +313,8 @@ * Pull out a certain weapon */ -wield() +void +wield(void) { register struct linked_list *item; register struct object *obj, *oweapon;