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

@ -19,11 +19,13 @@
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
#include "curses.h"
#include "rogue.h"
#define MAXINT INT_MAX
#define MININT INT_MIN
bool straight_shot(int ery, int erx, int eey, int eex, coord *shooting);
/*
* Canblink checks if the monster can teleport (blink). If so, it will
@ -31,8 +33,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 */
@ -127,8 +128,7 @@ register struct thing *tp;
*/
coord *
can_shoot(er, ee)
register coord *er, *ee;
can_shoot(coord *er, coord *ee)
{
static coord shoot_dir;
@ -147,16 +147,14 @@ register coord *er, *ee;
* chase:
* Find the spot for the chaser(er) to move closer to the
* chasee(ee). Rer is the room of the chaser, and ree is the
* room of the creature being chased (chasee).
* room of the creature being chased (chasee). Flee is 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
*/
chase(tp, ee, rer, ree, flee)
register struct thing *tp;
register coord *ee;
register struct room *rer, *ree;
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
*/
void
chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
bool flee)
{
int dist, thisdist, monst_dist = MAXINT;
register coord *er = &tp->t_pos;
@ -494,8 +492,8 @@ bool flee; /* True if destination (ee) is player and monster is running away
* Make one thing chase another.
*/
do_chase(th)
register struct thing *th;
void
do_chase(struct thing *th)
{
register struct room *orig_rer, /* Original room of chaser */
*new_room; /* new room of monster */
@ -803,8 +801,7 @@ register struct thing *th;
*/
struct linked_list *
get_hurl(tp)
register struct thing *tp;
get_hurl(struct thing *tp)
{
struct linked_list *arrow=NULL, *bolt=NULL, *rock=NULL,
*spear = NULL, *dagger=NULL, *dart=NULL, *aklad=NULL;
@ -851,9 +848,8 @@ register struct thing *tp;
* Set a monster running after something
*/
runto(runner, spot)
register struct thing *runner;
coord *spot;
void
runto(struct thing *runner, coord *spot)
{
if (on(*runner, ISSTONE))
return;
@ -881,9 +877,7 @@ coord *spot;
*/
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;