Mercurial > hg > early-roguelike
diff rogue4/misc.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | 1b73a8641b37 |
children | 0990adf580ee |
line wrap: on
line diff
--- a/rogue4/misc.c Fri Feb 26 17:30:30 2016 -0500 +++ b/rogue4/misc.c Wed Mar 02 21:28:34 2016 -0500 @@ -21,8 +21,7 @@ * Print the name of a trap */ char * -tr_name(type) -char type; +tr_name(char type) { switch (type) { @@ -47,8 +46,8 @@ * look: * A quick glance all around the player */ -look(wakeup) -bool wakeup; +void +look(bool wakeup) { register int x, y; register unsigned char ch; @@ -204,8 +203,7 @@ * Find the unclaimed object at y, x */ THING * -find_obj(y, x) -register int y, x; +find_obj(int y, int x) { register THING *op; @@ -225,7 +223,8 @@ * eat: * She wants to eat something, so let her try */ -eat() +void +eat(void) { register THING *obj; @@ -272,8 +271,8 @@ * Used to modify the playes strength. It keeps track of the * highest it has been, just in case */ -chg_str(amt) -register int amt; +void +chg_str(int amt) { str_t comp; @@ -293,9 +292,8 @@ * add_str: * Perform the actual add, checking upper and lower bound limits */ -add_str(sp, amt) -register str_t *sp; -int amt; +void +add_str(str_t *sp, int amt) { if ((*sp += amt) < 3) *sp = 3; @@ -307,8 +305,8 @@ * add_haste: * Add a haste to the player */ -add_haste(potion) -bool potion; +bool +add_haste(bool potion) { if (on(player, ISHASTE)) { @@ -332,7 +330,8 @@ * aggravate: * Aggravate all the monsters on this level */ -aggravate() +void +aggravate(void) { register THING *mi; @@ -346,8 +345,7 @@ * "an". */ char * -vowelstr(str) -register char *str; +vowelstr(char *str) { switch (*str) { @@ -366,8 +364,8 @@ * is_current: * See if the object is one of the currently used items */ -is_current(obj) -register THING *obj; +bool +is_current(THING *obj) { if (obj == NULL) return FALSE; @@ -387,7 +385,8 @@ * Set up the direction co_ordinate for use in varios "prefix" * commands */ -get_dir() +bool +get_dir(void) { register char *prompt; register bool gotit; @@ -430,8 +429,8 @@ * sign: * Return the sign of the number */ -sign(nm) -register int nm; +int +sign(int nm) { if (nm < 0) return -1; @@ -443,8 +442,8 @@ * spread: * Give a spread around a given number (+/- 10%) */ -spread(nm) -register int nm; +int +spread(int nm) { return nm - nm / 10 + rnd(nm / 5); } @@ -453,9 +452,8 @@ * call_it: * Call an object something after use. */ -call_it(know, guess) -register bool know; -register char **guess; +void +call_it(bool know, char **guess) { if (know && *guess) {