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

@ -18,12 +18,21 @@
#include "rogue.h"
#define MAXINT INT_MAX
#define MININT INT_MIN
void m_breathe(struct thing *tp);
void m_select(struct thing *th, bool flee);
void m_sonic(struct thing *tp);
void m_spell(struct thing *tp);
void m_summon(struct thing *tp);
bool m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree);
bool m_use_pack(struct thing *monster, coord *monst_pos, coord *defend_pos,
int dist, coord *shoot_dir);
/*
* Did we disrupt a spell?
*/
dsrpt_monster(tp, always, see_him)
register struct thing *tp;
bool always, see_him;
void
dsrpt_monster(struct thing *tp, bool always, bool see_him)
{
switch (tp->t_action) {
case A_SUMMON:
@ -52,7 +61,8 @@ bool always, see_him;
}
}
dsrpt_player()
void
dsrpt_player(void)
{
int which, action;
struct linked_list *item;
@ -81,7 +91,7 @@ dsrpt_player()
if (purse > 0) {
msg("Your gold goes flying everywhere!");
do {
item = spec_item(GOLD, NULL, NULL, NULL);
item = spec_item(GOLD, 0, 0, 0);
obj = OBJPTR(item);
obj->o_count = min(purse, rnd(10)+1);
purse -= obj->o_count;
@ -120,8 +130,8 @@ dsrpt_player()
* Otherwise, let it perform its chosen action.
*/
m_act(tp)
register struct thing *tp;
void
m_act(struct thing *tp)
{
struct object *obj;
bool flee; /* Are we scared? */
@ -235,8 +245,8 @@ register struct thing *tp;
* Breathe in the chosen direction.
*/
m_breathe(tp)
register struct thing *tp;
void
m_breathe(struct thing *tp)
{
register int damage;
register char *breath = "";
@ -344,11 +354,11 @@ register struct thing *tp;
/*
* m_select:
* Select an action for the monster.
* flee: True if running away or player is inaccessible in wall
*/
m_select(th, flee)
register struct thing *th;
register bool flee; /* True if running away or player is inaccessible in wall */
void
m_select(struct thing *th, bool flee)
{
register struct room *rer, *ree; /* room of chaser, room of chasee */
int dist = MININT;
@ -486,8 +496,8 @@ register bool flee; /* True if running away or player is inaccessible in wall */
* The monster is sounding a sonic blast.
*/
m_sonic(tp)
register struct thing *tp;
void
m_sonic(struct thing *tp)
{
register int damage;
static struct object blast =
@ -515,8 +525,8 @@ register struct thing *tp;
* The monster casts a spell. Currently this is limited to
* magic missile.
*/
m_spell(tp)
register struct thing *tp;
void
m_spell(struct thing *tp)
{
static struct object missile =
{
@ -538,8 +548,8 @@ register struct thing *tp;
* Summon aid.
*/
m_summon(tp)
register struct thing *tp;
void
m_summon(struct thing *tp)
{
register char *helpname, *mname;
int fail, numsum;
@ -612,10 +622,7 @@ register struct thing *tp;
*/
bool
m_use_it(tp, flee, rer, ree)
register struct thing *tp;
bool flee;
register struct room *rer, *ree;
m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree)
{
int dist;
register coord *ee = tp->t_dest, *er = &tp->t_pos;
@ -777,14 +784,15 @@ register struct room *rer, *ree;
/*
* runners:
* Make all the awake monsters try to do something.
* segments: Number of segments since last called
*/
runners(segments)
int segments; /* Number of segments since last called */
int
runners(int segments)
{
register struct linked_list *item;
register struct thing *tp = NULL;
register min_time = 20; /* Minimum time until a monster can act */
register int min_time = 20; /* Minimum time until a monster can act */
/*
* loop thru the list of running (wandering) monsters and see what
@ -870,11 +878,8 @@ int segments; /* Number of segments since last called */
* Only care about relics and wands for now.
*/
bool
m_use_pack(monster, monst_pos, defend_pos, dist, shoot_dir)
register struct thing *monster;
register coord *monst_pos, *defend_pos;
register int dist;
register coord *shoot_dir;
m_use_pack(struct thing *monster, coord *monst_pos, coord *defend_pos,
int dist, coord *shoot_dir)
{
register struct object *obj;
register struct linked_list *pitem, *relic, *stick;