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:
parent
f38b2223c8
commit
e8e6e604c3
39 changed files with 1181 additions and 889 deletions
108
arogue7/util.c
108
arogue7/util.c
|
|
@ -35,8 +35,7 @@ extern struct uwdata wdata;
|
|||
* this routine computes the players current AC without dex bonus's
|
||||
*/
|
||||
int
|
||||
ac_compute(ignoremetal)
|
||||
bool ignoremetal;
|
||||
ac_compute(bool ignoremetal)
|
||||
{
|
||||
register int ac;
|
||||
|
||||
|
|
@ -69,8 +68,8 @@ bool ignoremetal;
|
|||
* aggravate all the monsters on this level
|
||||
*/
|
||||
|
||||
aggravate(do_uniques, do_good)
|
||||
bool do_uniques, do_good;
|
||||
void
|
||||
aggravate(bool do_uniques, bool do_good)
|
||||
{
|
||||
register struct linked_list *mi;
|
||||
register struct thing *thingptr;
|
||||
|
|
@ -87,8 +86,8 @@ bool do_uniques, do_good;
|
|||
* 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;
|
||||
|
|
@ -134,7 +133,7 @@ register int y, x;
|
|||
* further levels
|
||||
*/
|
||||
long
|
||||
check_level()
|
||||
check_level(void)
|
||||
{
|
||||
register int i, j, add = 0;
|
||||
register unsigned long exp;
|
||||
|
|
@ -178,8 +177,8 @@ check_level()
|
|||
* 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 */
|
||||
|
|
@ -201,7 +200,8 @@ register int amt;
|
|||
/*
|
||||
* let's confuse the player
|
||||
*/
|
||||
confus_player()
|
||||
void
|
||||
confus_player(void)
|
||||
{
|
||||
if (off(player, ISCLEAR))
|
||||
{
|
||||
|
|
@ -218,7 +218,8 @@ confus_player()
|
|||
/*
|
||||
* 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) {
|
||||
|
|
@ -236,9 +237,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;
|
||||
|
||||
|
|
@ -258,10 +258,7 @@ struct thing *flgptr;
|
|||
* 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;
|
||||
|
|
@ -339,8 +336,8 @@ int range;
|
|||
* Find the index into the monster table of a monster given its name.
|
||||
*/
|
||||
|
||||
findmindex(name)
|
||||
char *name;
|
||||
int
|
||||
findmindex(char *name)
|
||||
{
|
||||
int which;
|
||||
|
||||
|
|
@ -361,9 +358,7 @@ char *name;
|
|||
*/
|
||||
|
||||
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;
|
||||
|
|
@ -383,9 +378,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;
|
||||
|
|
@ -403,7 +396,7 @@ register int x;
|
|||
* get coordinates from the player using the cursor keys (or mouse)
|
||||
*/
|
||||
coord
|
||||
get_coordinates()
|
||||
get_coordinates(void)
|
||||
{
|
||||
register int which;
|
||||
coord c;
|
||||
|
|
@ -550,8 +543,7 @@ get_coordinates()
|
|||
* set up the direction co_ordinate for use in various "prefix" commands
|
||||
*/
|
||||
bool
|
||||
get_dir(direction)
|
||||
coord *direction;
|
||||
get_dir(coord *direction)
|
||||
{
|
||||
register char *prompt;
|
||||
register bool gotit;
|
||||
|
|
@ -610,8 +602,8 @@ coord *direction;
|
|||
/*
|
||||
* 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;
|
||||
|
|
@ -650,11 +642,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;
|
||||
|
|
@ -938,8 +931,8 @@ bool runend; /* At end of a run -- for mazes */
|
|||
* Lower a level of experience
|
||||
*/
|
||||
|
||||
lower_level(who)
|
||||
short who;
|
||||
void
|
||||
lower_level(short who)
|
||||
{
|
||||
int fewer, nsides;
|
||||
unsigned int exp;
|
||||
|
|
@ -971,8 +964,7 @@ short who;
|
|||
* print out the name of a monster
|
||||
*/
|
||||
char *
|
||||
monster_name(tp)
|
||||
register struct thing *tp;
|
||||
monster_name(struct thing *tp)
|
||||
{
|
||||
prbuf[0] = '\0';
|
||||
if (on(*tp, ISFLEE) || on(*tp, WASTURNED))
|
||||
|
|
@ -1003,8 +995,7 @@ register struct thing *tp;
|
|||
*/
|
||||
|
||||
bool
|
||||
move_hero(why)
|
||||
int why;
|
||||
move_hero(int why)
|
||||
{
|
||||
char *action = "";
|
||||
char which;
|
||||
|
|
@ -1049,7 +1040,8 @@ int why;
|
|||
* The guy just magically went up a level.
|
||||
*/
|
||||
|
||||
raise_level()
|
||||
void
|
||||
raise_level(void)
|
||||
{
|
||||
unsigned long test; /* Next level -- be sure it is not an overflow */
|
||||
|
||||
|
|
@ -1081,11 +1073,12 @@ static int st_matrix[NUM_CHARTYPES][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, protect;
|
||||
|
||||
|
|
@ -1144,8 +1137,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;
|
||||
|
|
@ -1168,7 +1161,8 @@ register int y, x;
|
|||
/*
|
||||
* 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) {
|
||||
|
|
@ -1184,9 +1178,8 @@ str_compute()
|
|||
/*
|
||||
* 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;
|
||||
|
||||
|
|
@ -1204,8 +1197,7 @@ register int len;
|
|||
*/
|
||||
|
||||
char *
|
||||
tr_name(ch)
|
||||
char ch;
|
||||
tr_name(char ch)
|
||||
{
|
||||
register char *s = "";
|
||||
|
||||
|
|
@ -1235,8 +1227,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)
|
||||
{
|
||||
|
|
@ -1254,8 +1245,8 @@ register char *str;
|
|||
/*
|
||||
* wake up a room full (hopefully) of creatures
|
||||
*/
|
||||
wake_room(rp)
|
||||
register struct room *rp;
|
||||
void
|
||||
wake_room(struct room *rp)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp;
|
||||
|
|
@ -1273,7 +1264,8 @@ register struct room *rp;
|
|||
* Do nothing but let other things happen
|
||||
*/
|
||||
|
||||
waste_time()
|
||||
void
|
||||
waste_time(void)
|
||||
{
|
||||
if (inwhgt) /* if from wghtchk then done */
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue