Mercurial > hg > early-roguelike
diff arogue5/monsters.c @ 218:56e748983fa8
Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
author | John "Elwin" Edwards |
---|---|
date | Sun, 07 Feb 2016 14:39:21 -0500 |
parents | 0ed67132cf10 |
children | e52a8a7ad4c5 |
line wrap: on
line diff
--- a/arogue5/monsters.c Sun Jan 31 13:45:07 2016 -0500 +++ b/arogue5/monsters.c Sun Feb 07 14:39:21 2016 -0500 @@ -14,6 +14,7 @@ #include "curses.h" #include "rogue.h" +#include <stdlib.h> #include <ctype.h> #include <string.h> @@ -21,8 +22,8 @@ /* * Check_residue takes care of any effect of the monster */ -check_residue(tp) -register struct thing *tp; +void +check_residue(struct thing *tp) { /* * Take care of special abilities @@ -63,13 +64,11 @@ /* * Creat_mons creates the specified monster -- any if 0 + * person: Where to create next to */ bool -creat_mons(person, monster, report) -struct thing *person; /* Where to create next to */ -short monster; -bool report; +creat_mons(struct thing *person, short monster, bool report) { struct linked_list *nitem; register struct thing *tp; @@ -121,9 +120,7 @@ */ void -genmonsters(least, treas) -register int least; -bool treas; +genmonsters(int least, bool treas) { reg int i; reg struct room *rp = &rooms[0]; @@ -166,8 +163,7 @@ */ short -id_monst(monster) -register char monster; +id_monst(char monster) { register short result; @@ -187,11 +183,8 @@ * Pick a new monster and add it to the list */ -new_monster(item, type, cp, max_monster) -struct linked_list *item; -short type; -register coord *cp; -bool max_monster; +void +new_monster(struct linked_list *item, short type, coord *cp, bool max_monster) { register struct thing *tp; register struct monster *mp; @@ -379,8 +372,7 @@ */ short -randmonster(wander, no_unique) -register bool wander, no_unique; +randmonster(bool wander, bool no_unique) { register int d, cur_level, range, i; @@ -418,8 +410,8 @@ * to purchase something. */ -sell(tp) -register struct thing *tp; +void +sell(struct thing *tp) { register struct linked_list *item; register struct object *obj; @@ -731,8 +723,7 @@ * what to do when the hero steps next to a monster */ struct linked_list * -wake_monster(y, x) -int y, x; +wake_monster(int y, int x) { register struct thing *tp; register struct linked_list *it; @@ -957,7 +948,8 @@ * A wandering monster has awakened and is headed for the player */ -wanderer() +void +wanderer(void) { register int i; register struct room *hr = roomin(&hero);