diff arogue5/chase.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 0ed67132cf10
children e52a8a7ad4c5
line wrap: on
line diff
--- a/arogue5/chase.c	Sun Jan 31 13:45:07 2016 -0500
+++ b/arogue5/chase.c	Sun Feb 07 14:39:21 2016 -0500
@@ -12,6 +12,7 @@
  * See the file LICENSE.TXT for full copyright and licensing information.
  */
 
+#include <stdlib.h>
 #include <ctype.h>
 #include <limits.h>
 #include "curses.h"
@@ -21,8 +22,8 @@
 
 coord ch_ret;				/* Where chasing takes you */
 
-
-
+struct linked_list *get_hurl(struct thing *tp);
+bool straight_shot(int ery, int erx, int eey, int eex, coord *shooting);
 
 
 /*
@@ -31,8 +32,7 @@
  */
 
 bool
-can_blink(tp)
-register struct thing *tp;
+can_blink(struct thing *tp)
 {
     register int y, x, index=9;
     coord tryp;	/* To hold the coordinates for use in diag_ok */
@@ -128,8 +128,7 @@
  */
 
 coord *
-can_shoot(er, ee)
-register coord *er, *ee;
+can_shoot(coord *er, coord *ee)
 {
     static coord shoot_dir;
 
@@ -154,13 +153,11 @@
  *	FALSE if we reach the goal.
  */
 
-chase(tp, ee, flee, mdead)
-register struct thing *tp;
-register coord *ee;
-bool flee; /* True if destination (ee) is player and monster is running away
-	    * or the player is in a wall and the monster can't get to it
-	    */
-bool *mdead;
+/* flee: True if destination (ee) is player and monster is running 
+ * away or the player is in a wall and the monster can't get to it
+ */
+bool
+chase(struct thing *tp, coord *ee, bool flee, bool *mdead)
 {
     int damage, dist, thisdist, monst_dist = MAXINT; 
     struct linked_list *weapon;
@@ -530,10 +527,10 @@
  * do_chase:
  *	Make one thing chase another.
  */
+/* flee: True if running away or player is inaccessible in wall */
 
-do_chase(th, flee)
-register struct thing *th;
-register bool flee; /* True if running away or player is inaccessible in wall */
+void
+do_chase(struct thing *th, bool flee)
 {
     register struct room *rer, *ree,	/* room of chaser, room of chasee */
 			 *orig_rer,	/* Original room of chaser */
@@ -830,8 +827,7 @@
  */
 
 struct linked_list *
-get_hurl(tp)
-register struct thing *tp;
+get_hurl(struct thing *tp)
 {
     struct linked_list *arrow, *bolt, *rock;
     register struct linked_list *pitem;
@@ -861,7 +857,8 @@
  *	Make all the running monsters move.
  */
 
-runners()
+void
+runners(void)
 {
     register struct linked_list *item;
     register struct thing *tp = NULL;
@@ -935,9 +932,8 @@
  *	Set a monster running after something
  */
 
-runto(runner, spot)
-register struct thing *runner;
-coord *spot;
+void
+runto(struct thing *runner, coord *spot)
 {
     /*
      * Start the beastie running
@@ -959,9 +955,7 @@
  */
 
 bool
-straight_shot(ery, erx, eey, eex, shooting)
-register int ery, erx, eey, eex;
-register coord *shooting;
+straight_shot(int ery, int erx, int eey, int eex, coord *shooting)
 {
     register int dy, dx;	/* Deltas */
     char ch;