Super-Rogue: convert to ANSI-style function declarations.

This fixes most of the build warnings.
This commit is contained in:
John "Elwin" Edwards 2016-01-31 13:45:07 -05:00
parent 0f87d5b4d8
commit 59f448e92e
33 changed files with 783 additions and 518 deletions

View file

@ -14,19 +14,24 @@
* See the file LICENSE.TXT for full copyright and licensing information.
*/
#include <stdlib.h>
#include "rogue.h"
#include "rogue.ext"
#define FARAWAY 32767
#define RDIST(a, b) (DISTANCE((a)->y, (a)->x, (b).y, (b).x))
int do_chase(struct linked_list *mon);
int chase(struct thing *tp, struct coord *ee, bool runaway, bool dofight);
struct coord ch_ret; /* Where chasing takes you */
/*
* runners:
* Make all the running monsters move.
*/
runners()
void
runners(void)
{
reg struct thing *tp;
reg struct linked_list *mon,*nextmon;
@ -54,8 +59,8 @@ runners()
* do_chase:
* Make one thing chase another.
*/
do_chase(mon)
struct linked_list *mon;
int
do_chase(struct linked_list *mon)
{
reg struct thing *th;
reg struct room *rer, *ree, *rxx;
@ -241,10 +246,8 @@ struct linked_list *mon;
* chasee. Returns TRUE if we want to keep on chasing
* later FALSE if we reach the goal.
*/
chase(tp, ee, runaway, dofight)
struct thing *tp;
struct coord *ee;
bool runaway, dofight;
int
chase(struct thing *tp, struct coord *ee, bool runaway, bool dofight)
{
reg int x, y, ch;
reg int dist, thisdist, closest;
@ -385,9 +388,8 @@ bool runaway, dofight;
* runto:
* Set a monster running after something
*/
runto(runner, spot)
struct coord *runner;
struct coord *spot;
void
runto(struct coord *runner, struct coord *spot)
{
reg struct linked_list *item;
reg struct thing *tp;
@ -409,8 +411,7 @@ struct coord *spot;
* NULL means they aren't in any room.
*/
struct room *
roomin(cp)
struct coord *cp;
roomin(struct coord *cp)
{
reg struct room *rp;
@ -428,8 +429,7 @@ struct coord *cp;
* Find the monster from his coordinates
*/
struct linked_list *
find_mons(y, x)
int y, x;
find_mons(int y, int x)
{
reg struct linked_list *item;
reg struct thing *th;
@ -447,8 +447,8 @@ int y, x;
* diag_ok:
* Check to see if the move is legal if it is diagonal
*/
diag_ok(sp, ep)
struct coord *sp, *ep;
bool
diag_ok(struct coord *sp, struct coord *ep)
{
if (ep->x == sp->x || ep->y == sp->y)
return TRUE;
@ -462,8 +462,8 @@ struct coord *sp, *ep;
* cansee:
* returns true if the hero can see a certain coordinate.
*/
cansee(y, x)
int y, x;
bool
cansee(int y, int x)
{
reg struct room *rer;
struct coord tp;