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.
This commit is contained in:
John "Elwin" Edwards 2016-02-19 21:02:28 -05:00
parent f38b2223c8
commit e8e6e604c3
39 changed files with 1181 additions and 889 deletions

View file

@ -30,15 +30,20 @@ static char *frontier,
*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 @@ crankout()
* domaze:
* Draw the maze on this level.
*/
do_maze()
void
do_maze(void)
{
reg int least;
reg struct room *rp;
@ -95,7 +101,7 @@ do_maze()
/*
* 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 @@ do_maze()
/*
* 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 @@ do_maze()
* 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 @@ draw_maze()
* 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 @@ reg int x, y;
* 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 @@ int y, x;
*/
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 @@ int y, x;
* 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 @@ int y, x;
* 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;