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.
This commit is contained in:
John "Elwin" Edwards 2016-02-19 21:02:28 -05:00
parent f38b2223c8
commit e8e6e604c3
39 changed files with 1181 additions and 889 deletions

View file

@ -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 @@ command()
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 @@ command()
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 @@ command()
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 @@ command()
* 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 @@ display()
*/
void
quit(sig)
int sig;
quit(int sig)
{
/*
* Reset the signal in case we got here via an interrupt
@ -628,8 +639,7 @@ int sig;
*/
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 @@ int sig;
* 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 @@ register bool is_thief, door_chime;
* 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 @@ help()
* Tell the player what a certain thing is.
*/
identify(ch)
register char ch;
void
identify(char ch)
{
register char *str;
@ -907,6 +918,7 @@ register char ch;
* He wants to go down a level
*/
void
d_level()
{
bool no_phase=FALSE;
@ -958,7 +970,8 @@ d_level()
* 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 @@ u_level()
* Let him escape for a while
*/
shell()
void
shell(void)
{
register char *sh;
@ -1050,7 +1064,8 @@ shell()
/*
* see what we want to name -- an item or a monster.
*/
nameit()
void
nameit(void)
{
char answer;
@ -1073,9 +1088,8 @@ nameit()
/*
* 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 @@ bool mark;
/* Name a monster */
namemonst()
void
namemonst(void)
{
register struct thing *tp;
struct linked_list *item;
@ -1206,7 +1221,8 @@ namemonst()
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...");