diff arogue7/maze.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 adfa37e67084
children 0250220d8cdd
line wrap: on
line diff
--- a/arogue7/maze.c	Sun Feb 07 14:39:21 2016 -0500
+++ b/arogue7/maze.c	Fri Feb 19 21:02:28 2016 -0500
@@ -30,15 +30,20 @@
 		*bits;
 static int	maze_lines, 
 		maze_cols;
-char		*moffset(), 
-		*foffset();
+
+void draw_maze(void);
+int findcells(int y, int x);
+char *foffset(int y, int x);
+char *moffset(int y, int x);
+void rmwall(int newy, int newx, int oldy, int oldx);
 
 
 /*
  * crankout:
  *	Does actual drawing of maze to window
  */
-crankout()
+void
+crankout(void)
 {
 	reg int x, y;
 
@@ -71,7 +76,8 @@
  * domaze:
  *	Draw the maze on this level.
  */
-do_maze()
+void
+do_maze(void)
 {
 	reg int least;
 	reg struct room *rp;
@@ -95,7 +101,7 @@
 	/*
 	 * add some gold to make it worth looking for 
 	 */
-	item = spec_item(GOLD, NULL, NULL, NULL);
+	item = spec_item(GOLD, 0, 0, 0);
 	obj = OBJPTR(item);
 	obj->o_count *= (rnd(5) + 5);		/* add in one large hunk */
 	attach(lvl_obj, item);
@@ -108,7 +114,7 @@
 	/*
 	 * add in some food to make sure he has enough
 	 */
-	item = spec_item(FOOD, NULL, NULL, NULL);
+	item = spec_item(FOOD, 0, 0, 0);
 	obj = OBJPTR(item);
 	attach(lvl_obj, item);
 	do {
@@ -133,7 +139,8 @@
  * draw_maze:
  *	Generate and draw the maze on the screen
  */
-draw_maze()
+void
+draw_maze(void)
 {
 	reg int i, j, more;
 	reg char *ptr;
@@ -169,8 +176,8 @@
  * findcells:
  *	Figure out cells to open up 
  */
-findcells(y,x)
-reg int x, y;
+int
+findcells(int y, int x)
 {
 	reg int rtpos, i;
 
@@ -221,8 +228,7 @@
  *	Calculate memory address for frontier
  */
 char *
-foffset(y, x)
-int y, x;
+foffset(int y, int x)
 {
 
 	return (frontier + (y * maze_cols) + x);
@@ -236,8 +242,7 @@
  */
 
 bool
-maze_view(y, x)
-int y, x;
+maze_view(int y, int x)
 {
     register int start, goal, delta, ycheck, xcheck, absy, absx, see_radius;
     register bool row;
@@ -341,8 +346,7 @@
  *	Calculate memory address for bits
  */
 char *
-moffset(y, x)
-int y, x;
+moffset(int y, int x)
 {
 
 	return (bits + (y * (cols - 1)) + x);
@@ -355,8 +359,8 @@
  * rmwall:
  *	Removes appropriate walls from the maze
  */
-rmwall(newy, newx, oldy, oldx)
-int newy, newx, oldy, oldx;
+void
+rmwall(int newy, int newx, int oldy, int oldx)
 {
 	reg int xdif,ydif;