Advanced Rogue 5: convert to ANSI function declarations.

This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
This commit is contained in:
John "Elwin" Edwards 2016-02-07 14:39:21 -05:00
parent 59f448e92e
commit f38b2223c8
37 changed files with 977 additions and 733 deletions

View file

@ -22,7 +22,8 @@
* aggravate all the monsters on this level
*/
aggravate()
void
aggravate(void)
{
register struct linked_list *mi;
@ -35,8 +36,8 @@ aggravate()
* returns true if the hero can see a certain coordinate.
*/
cansee(y, x)
register int y, x;
bool
cansee(int y, int x)
{
register struct room *rer;
register int radius;
@ -93,8 +94,7 @@ static struct {
};
long
check_level(get_spells)
bool get_spells;
check_level(bool get_spells)
{
register int i, j, add = 0;
register unsigned long exp;
@ -148,8 +148,8 @@ bool get_spells;
* it keeps track of the highest it has been, just in case
*/
chg_str(amt)
register int amt;
void
chg_str(int amt)
{
register int ring_str; /* ring strengths */
register struct stats *ptr; /* for speed */
@ -172,7 +172,7 @@ register int amt;
* this routine computes the players current AC without dex bonus's
*/
int
ac_compute()
ac_compute(void)
{
register int ac;
@ -194,7 +194,8 @@ ac_compute()
/*
* this routine computes the players current strength
*/
str_compute()
int
str_compute(void)
{
if (cur_misc[WEAR_GAUNTLET] != NULL &&
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_OGRE) {
@ -210,7 +211,8 @@ str_compute()
/*
* this routine computes the players current dexterity
*/
dex_compute()
int
dex_compute(void)
{
if (cur_misc[WEAR_GAUNTLET] != NULL &&
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_DEXTERITY) {
@ -229,9 +231,8 @@ dex_compute()
* Check to see if the move is legal if it is diagonal
*/
diag_ok(sp, ep, flgptr)
register coord *sp, *ep;
struct thing *flgptr;
bool
diag_ok(coord *sp, coord *ep, struct thing *flgptr)
{
register int numpaths = 0;
@ -252,7 +253,8 @@ struct thing *flgptr;
* He wants to eat something, so let him try
*/
eat()
void
eat(void)
{
register struct linked_list *item;
@ -282,10 +284,7 @@ eat()
* pick a random position around the give (y, x) coordinates
*/
coord *
fallpos(pos, be_clear, range)
register coord *pos;
bool be_clear;
int range;
fallpos(coord *pos, bool be_clear, int range)
{
register int tried, i, j;
register char ch;
@ -364,9 +363,7 @@ int range;
*/
struct linked_list *
find_mons(y, x)
register int y;
register int x;
find_mons(int y, int x)
{
register struct linked_list *item;
register struct thing *th;
@ -386,9 +383,7 @@ register int x;
*/
struct linked_list *
find_obj(y, x)
register int y;
register int x;
find_obj(int y, int x)
{
register struct linked_list *obj;
register struct object *op;
@ -406,7 +401,8 @@ register int x;
/*
* set up the direction co_ordinate for use in varios "prefix" commands
*/
get_dir()
bool
get_dir(void)
{
register char *prompt;
register bool gotit;
@ -446,8 +442,8 @@ get_dir()
/*
* see if the object is one of the currently used items
*/
is_current(obj)
register struct object *obj;
bool
is_current(struct object *obj)
{
if (obj == NULL)
return FALSE;
@ -483,11 +479,12 @@ register struct object *obj;
/*
* Look:
* A quick glance all around the player
* wakeup: Should we wake up monsters
* runend: At end of a run -- for mazes
*/
look(wakeup, runend)
bool wakeup; /* Should we wake up monsters */
bool runend; /* At end of a run -- for mazes */
void
look(bool wakeup, bool runend)
{
register int x, y, radius;
register char ch, och;
@ -738,8 +735,8 @@ bool runend; /* At end of a run -- for mazes */
* The guy just magically went up a level.
*/
raise_level(get_spells)
bool get_spells;
void
raise_level(bool get_spells)
{
unsigned long test; /* Next level -- be sure it is not an overflow */
@ -766,11 +763,12 @@ static int st_matrix[5][5] = {
/*
* save:
* See if a creature saves against something
* which: which type of save
* who: who is saving
* adj: saving throw adjustment
*/
save(which, who, adj)
int which; /* which type of save */
struct thing *who; /* who is saving */
int adj; /* saving throw adjustment */
bool
save(int which, struct thing *who, int adj)
{
register int need, level;
@ -814,8 +812,8 @@ int adj; /* saving throw adjustment */
* Figure out what a secret door looks like.
*/
secretdoor(y, x)
register int y, x;
char
secretdoor(int y, int x)
{
register int i;
register struct room *rp;
@ -838,9 +836,8 @@ register int y, x;
/*
* copy string using unctrl for things
*/
strucpy(s1, s2, len)
register char *s1, *s2;
register int len;
void
strucpy(char *s1, char *s2, int len)
{
register char *sp;
@ -859,8 +856,7 @@ register int len;
*/
char *
tr_name(ch)
char ch;
tr_name(char ch)
{
register char *s = NULL;
@ -890,8 +886,7 @@ char ch;
* for printfs: if string starts with a vowel, return "n" for an "an"
*/
char *
vowelstr(str)
register char *str;
vowelstr(char *str)
{
switch (*str)
{
@ -911,7 +906,8 @@ register char *str;
* Do nothing but let other things happen
*/
waste_time()
void
waste_time(void)
{
if (inwhgt) /* if from wghtchk then done */
return;