diff arogue5/maze.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 0250220d8cdd
line wrap: on
line diff
--- a/arogue5/maze.c	Sun Jan 31 13:45:07 2016 -0500
+++ b/arogue5/maze.c	Sun Feb 07 14:39:21 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(10) + 1);		/* 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 = 0, xcheck = 0, absy, absx, see_radius;
     register bool row;
@@ -342,8 +347,7 @@
  *	Calculate memory address for bits
  */
 char *
-moffset(y, x)
-int y, x;
+moffset(int y, int x)
 {
 
 	return (bits + (y * (COLS - 1)) + x);
@@ -356,8 +360,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;