diff arogue5/command.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 a0a57cf42810
children e52a8a7ad4c5
line wrap: on
line diff
--- a/arogue5/command.c	Sun Jan 31 13:45:07 2016 -0500
+++ b/arogue5/command.c	Sun Feb 07 14:39:21 2016 -0500
@@ -21,12 +21,20 @@
 #include "rogue.h"
 #include "mach_dep.h"
 
+void help(void);
+void identify(void);
+void d_level(void);
+void u_level(void);
+void shell(void);
+void call(bool mark);
+
 /*
  * command:
  *	Process the user commands
  */
 
-command()
+void
+command(void)
 {
     register char ch;
     register int ntimes = 1;			/* Number of player moves */
@@ -207,8 +215,8 @@
 		when 'I' : after = FALSE; picky_inven();
 		when 'd' : drop(NULL);
 		when 'P' : grab(hero.y, hero.x);
-		when 'q' : quaff(-1, NULL, TRUE);
-		when 'r' : read_scroll(-1, NULL, TRUE);
+		when 'q' : quaff(-1, 0, TRUE);
+		when 'r' : read_scroll(-1, 0, TRUE);
 		when 'e' : eat();
 		when 'w' : wield();
 		when 'W' : wear();
@@ -228,7 +236,7 @@
 		when 'G' : gsense();
 		when '^' : set_trap(&player, hero.y, hero.x);
 		when 's' : search(FALSE, FALSE);
-		when 'z' : if (!do_zap(TRUE, NULL, FALSE))
+		when 'z' : if (!do_zap(TRUE, 0, FALSE))
 				after=FALSE;
 		when 'p' : pray();
 		when 'C' : cast();
@@ -475,8 +483,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 */
@@ -488,8 +495,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 */
@@ -570,7 +577,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
@@ -664,7 +672,8 @@
  *	Tell the player what a certain thing is.
  */
 
-identify()
+void
+identify(void)
 {
     register char ch;
     const char *str;
@@ -726,7 +735,8 @@
  *	He wants to go down a level
  */
 
-d_level()
+void
+d_level(void)
 {
     bool no_phase=FALSE;
 
@@ -770,7 +780,8 @@
  *	He wants to go up a level
  */
 
-u_level()
+void
+u_level(void)
 {
     bool no_phase = FALSE;
     register struct linked_list *item;
@@ -828,7 +839,8 @@
  * Let him escape for a while
  */
 
-shell()
+void
+shell(void)
 {
     /*
      * Set the terminal back to original mode
@@ -859,8 +871,8 @@
 /*
  * allow a user to call a potion, scroll, or ring something
  */
-call(mark)
-bool mark;
+void
+call(bool mark)
 {
     register struct object *obj;
     register struct linked_list *item;