XRogue: convert to ANSI-style function declarations.

This commit is contained in:
John "Elwin" Edwards 2016-03-02 21:13:26 -05:00
parent e8e6e604c3
commit 2853120387
41 changed files with 1281 additions and 908 deletions

View file

@ -19,16 +19,18 @@
#include <ctype.h>
#include <curses.h>
#include <limits.h>
#include <stdlib.h>
#include "rogue.h"
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
* try to blink the monster next to the player.
*/
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 */
@ -123,8 +125,7 @@ register struct thing *tp;
*/
int
can_shoot(er, ee, shoot_dir)
register coord *er, *ee, *shoot_dir;
can_shoot(coord *er, coord *ee, coord *shoot_dir)
{
/*
* They must be in the same room or very close (at door)
@ -150,15 +151,13 @@ register coord *er, *ee, *shoot_dir;
* 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).
* 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
*/
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 = INT_MAX;
register coord *er = &tp->t_pos;
@ -495,8 +494,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 */
@ -812,8 +811,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;
@ -860,9 +858,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;
@ -888,9 +885,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 */
unsigned char ch;