diff xrogue/misc.c @ 220:f54901b9c39b

XRogue: convert to ANSI-style function declarations.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:13:26 -0500
parents cadff8f047a1
children 7c1cb43f346e
line wrap: on
line diff
--- a/xrogue/misc.c	Fri Feb 19 21:02:28 2016 -0500
+++ b/xrogue/misc.c	Wed Mar 02 21:13:26 2016 -0500
@@ -23,8 +23,8 @@
  *      Change the player's class to the specified one.
  */
 
-changeclass(newclass)
-long *newclass;
+void
+changeclass(long *newclass)
 {
     if (*newclass == player.t_ctype) {
         msg("You feel more skillful.");
@@ -152,8 +152,8 @@
  * Use the relic that our monster is wielding.
  */
 
-m_use_relic(monster)
-register struct thing *monster;
+void
+m_use_relic(struct thing *monster)
 {
     register struct object *obj;
 
@@ -181,7 +181,7 @@
         }
         when EMORI_CLOAK:
             debug("stunning with Emori's cloak");
-            do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, NULL);
+            do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, 0);
             obj->o_charges = 0;
 
         when ASMO_ROD: {
@@ -248,11 +248,12 @@
  
 /*
  * add something to the contents of something else
+ * bag: the holder of the items
+ * item: the item to put inside
  */
 
-put_contents(bag, item)
-register struct object *bag;            /* the holder of the items */
-register struct linked_list *item;      /* the item to put inside  */
+void
+put_contents(struct object *bag, struct linked_list *item)
 {
     register struct linked_list *titem;
     register struct object *tobj;
@@ -277,11 +278,11 @@
 
 /*
  * remove something from something else
+ * bag: the holder of the items
  */
 
-take_contents(bag, item)
-register struct object *bag;            /* the holder of the items */
-register struct linked_list *item;
+void
+take_contents(struct object *bag, struct linked_list *item)
 {
 
     if (bag->o_ac <= 0) {
@@ -295,8 +296,8 @@
 }
 
 
-do_bag(item)
-register struct linked_list *item;
+void
+do_bag(struct linked_list *item)
 {
 
     register struct linked_list *titem = NULL;
@@ -417,9 +418,10 @@
     }
 }
 
-do_panic(who)
-int who;        /* Kind of monster to panic (all if who is NULL) */
+void
+do_panic(int who)
 {
+    /* who: kind of monster to panic (all if who is 0) */
     register int x,y;
     register struct linked_list *mon, *item;
     register struct thing *th;
@@ -485,9 +487,7 @@
  */
 
 int
-misc_name(str,obj)
-char *str;
-register struct object *obj;
+misc_name(char *str, struct object *obj)
 {
     char buf1[LINELEN];
 
@@ -565,7 +565,8 @@
     return(0);
 }
 
-use_emori()
+void
+use_emori(void)
 {
     char selection;     /* Cloak function */
     int state = 0;      /* Menu state */
@@ -669,8 +670,8 @@
  * try to write a scroll with the quill of Nagrom
  */
 
-use_quill(obj)
-struct object *obj;
+void
+use_quill(struct object *obj)
 {
     struct linked_list  *item;
     register int        i,
@@ -761,7 +762,7 @@
 
         /* Should we overlay? */
         if (menu_overlay && MAXQUILL + 3 < lines - 3) {
-            over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, NULL);
+            over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, '\0');
         }
         else draw(hw);
     }
@@ -789,7 +790,7 @@
             /* Should we overlay? */
             if (menu_overlay && MAXQUILL + 3 < lines - 3) {
                 over_win(cw, hw, MAXQUILL + 5, maxlen + 3,
-                            0, curlen, NULL);
+                            0, curlen, '\0');
             }
             else draw(hw);
 
@@ -830,8 +831,8 @@
  * Use something
  */
 
-use_mm(which)
-int which;
+void
+use_mm(int which)
 {
     register struct object *obj = NULL;
     register struct linked_list *item = NULL;
@@ -907,7 +908,7 @@
             when GERYON_HORN:
                 /* Chase close monsters away */
                 msg("The horn blasts a shrill tone.");
-                do_panic(NULL);
+                do_panic(0);
             when EYE_VECNA:
                 msg("The pain slowly subsides.. ");
             when HEIL_ANKH:
@@ -934,7 +935,7 @@
                 msg("The jug is empty");
                 break;
             }
-            quaff (obj->o_ac, NULL, NULL, FALSE);
+            quaff (obj->o_ac, 0, 0, FALSE);
             obj->o_ac = JUG_EMPTY;
             fuse (alchemy, obj, ALCHEMYTIME, AFTER);
             if (!(obj->o_flags & ISKNOW))
@@ -1012,7 +1013,7 @@
                 break;
             }
             obj->o_charges--;
-            do_panic(NULL);
+            do_panic(0);
         return;
         /*
          * dust of disappearance makes the player invisible for a while
@@ -1140,7 +1141,7 @@
             str = "vibrates softly";
         msg("You rub the crystal and it %s...  ", str);
           /* cure him */
-        read_scroll(S_CURING, NULL, FALSE);
+        read_scroll(S_CURING, 0, FALSE);
           /* give him weird hands */
                 turn_on(player, CANHUH);
         msg("Your fingertips turn blue.  ");
@@ -1218,8 +1219,7 @@
  */
 
 int
-usage_time(item)
-struct linked_list *item;
+usage_time(struct linked_list *item)
 {
     register struct object *obj;
     register int units = -1;