diff arogue7/sticks.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 e1cd27c5464f
line wrap: on
line diff
--- a/arogue7/sticks.c	Sun Feb 07 14:39:21 2016 -0500
+++ b/arogue7/sticks.c	Fri Feb 19 21:02:28 2016 -0500
@@ -22,16 +22,14 @@
 #include <string.h>
 #include "rogue.h"
 
+void drain(int ymin, int ymax, int xmin, int xmax);
 
 /*
  * zap a stick and see what happens
  */
-do_zap(zapper, obj, direction, which, flags)
-struct thing *zapper;
-struct object *obj;
-coord *direction;
-int which;
-int flags;
+void
+do_zap(struct thing *zapper, struct object *obj, coord *direction, int which, 
+       int flags)
 {
     register struct linked_list *item = NULL;
     register struct thing *tp;
@@ -499,7 +497,7 @@
 		if (pstats.s_hpt <= 0) {
 		    msg("Your life has been sucked from you -- More --");
 		    wait_for(' ');
-		    death(zapper);
+		    death(zapper->t_index);
 		}
 		else
 		    msg("You feel a great drain on your system");
@@ -625,8 +623,8 @@
  *	Do drain hit points from player shtick
  */
 
-drain(ymin, ymax, xmin, xmax)
-int ymin, ymax, xmin, xmax;
+void
+drain(int ymin, int ymax, int xmin, int xmax)
 {
     register int i, j, count;
     register struct thing *ick;
@@ -698,8 +696,8 @@
 /*
  * initialize a stick
  */
-fix_stick(cur)
-register struct object *cur;
+void
+fix_stick(struct object *cur)
 {
     if (EQUAL(ws_type[cur->o_which], "staff")) {
 	cur->o_weight = 100;
@@ -738,8 +736,8 @@
 /*
  * Use the wand that our monster is wielding.
  */
-m_use_wand(monster)
-register struct thing *monster;
+void
+m_use_wand(struct thing *monster)
 {
     register struct object *obj;
 
@@ -764,14 +762,16 @@
      */
     msg("%s points a %s at you!", prname(monster_name(monster), TRUE),
 	ws_type[obj->o_which]);
-    do_zap(monster, obj, &monster->t_newpos, obj->o_which, NULL);
+    do_zap(monster, obj, &monster->t_newpos, obj->o_which, 0);
     monster->t_wand /= 2; /* chance lowers with each use */
 }
 
+/*
+ * type: type of item, NULL means stick
+ * which: which item
+ */
 bool
-need_dir(type, which)
-int	type,		/* type of item, NULL means stick */
-	which;		/* which item			  */
+need_dir(int type, int which)
 {
     if (type == STICK || type == 0) {
 	switch (which) {
@@ -799,9 +799,8 @@
 /*
  * let the player zap a stick and see what happens
  */
-player_zap(which, flag)
-int which;
-int flag;
+bool
+player_zap(int which, int flag)
 {
     register struct linked_list *item;
     register struct object *obj;
@@ -868,13 +867,9 @@
  * 	      given direction
  */
 
-shoot_bolt(shooter, start, dir, get_points, reason, name, damage)
-struct thing *shooter;
-coord start, dir;
-bool get_points;
-short reason;
-char *name;
-int damage;
+void
+shoot_bolt(struct thing *shooter, coord start, coord dir, bool get_points, 
+           short reason, char *name, int damage)
 {
     register char dirch, ch;
     register bool used, change;