Mercurial > hg > early-roguelike
diff arogue7/command.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 | 1cd604c827a3 |
children | e52a8a7ad4c5 |
line wrap: on
line diff
--- a/arogue7/command.c Sun Feb 07 14:39:21 2016 -0500 +++ b/arogue7/command.c Fri Feb 19 21:02:28 2016 -0500 @@ -29,12 +29,23 @@ extern struct uwdata wdata; #endif +void display(void); +void help(void); +void identify(char ch); +void d_level(void); +void u_level(void); +void shell(void); +void nameit(void); +void namemonst(void); +void count_gold(void); + /* * command: * Process the user commands */ -command() +void +command(void) { unsigned char ch; struct linked_list *item; @@ -267,8 +278,8 @@ after = FALSE; } when C_COUNT : count_gold(); - when C_QUAFF : quaff(-1, NULL, NULL, TRUE); - when C_READ : read_scroll(-1, NULL, TRUE); + when C_QUAFF : quaff(-1, 0, 0, TRUE); + when C_READ : read_scroll(-1, 0, TRUE); when C_EAT : eat(); when C_WIELD : wield(); when C_WEAR : wear(); @@ -280,7 +291,7 @@ when '>' : after = FALSE; d_level(); when '<' : after = FALSE; u_level(); when '?' : after = FALSE; help(); - when '/' : after = FALSE; identify(NULL); + when '/' : after = FALSE; identify(0); when C_USE : use_mm(-1); when CTRL('T') : if (player.t_action == A_NIL) { @@ -315,7 +326,7 @@ search(FALSE, FALSE); player.t_action = A_NIL; } - when C_ZAP : if (!player_zap(NULL, FALSE)) + when C_ZAP : if (!player_zap(0, FALSE)) after=FALSE; when C_PRAY : pray(); when C_CHANT : chant(); @@ -553,7 +564,8 @@ * tell the player what is at a certain coordinates assuming * it can be seen. */ -display() +void +display(void) { coord c; struct linked_list *item; @@ -587,8 +599,7 @@ */ void -quit(sig) -int sig; +quit(int sig) { /* * Reset the signal in case we got here via an interrupt @@ -628,8 +639,7 @@ */ void -bugkill(sig) -int sig; +bugkill(int sig) { signal(sig, quit); /* If we get it again, give up */ death(D_SIGNAL); /* Killed by a bug */ @@ -641,8 +651,8 @@ * Player gropes about him to find hidden things. */ -search(is_thief, door_chime) -register bool is_thief, door_chime; +void +search(bool is_thief, bool door_chime) { register int x, y; register char ch, /* The trap or door character */ @@ -752,7 +762,8 @@ * Give single character help, or the whole mess if he wants it */ -help() +void +help(void) { register struct h_list *strp = helpstr; #ifdef WIZARD @@ -844,8 +855,8 @@ * Tell the player what a certain thing is. */ -identify(ch) -register char ch; +void +identify(char ch) { register char *str; @@ -907,6 +918,7 @@ * He wants to go down a level */ +void d_level() { bool no_phase=FALSE; @@ -958,7 +970,8 @@ * He wants to go up a level */ -u_level() +void +u_level(void) { bool no_phase = FALSE; register struct linked_list *item; @@ -1016,7 +1029,8 @@ * Let him escape for a while */ -shell() +void +shell(void) { register char *sh; @@ -1050,7 +1064,8 @@ /* * see what we want to name -- an item or a monster. */ -nameit() +void +nameit(void) { char answer; @@ -1073,9 +1088,8 @@ /* * allow a user to call a potion, scroll, or ring something */ -nameitem(item, mark) -struct linked_list *item; -bool mark; +void +nameitem(struct linked_list *item, bool mark) { register struct object *obj; register char **guess = NULL, *elsewise = NULL; @@ -1161,7 +1175,8 @@ /* Name a monster */ -namemonst() +void +namemonst(void) { register struct thing *tp; struct linked_list *item; @@ -1206,7 +1221,8 @@ msg("There is no monster there to name."); } -count_gold() +void +count_gold(void) { if (player.t_action != C_COUNT) { msg("You take a break to count your money...");