XRogue: convert to ANSI-style function declarations.
This commit is contained in:
parent
e8e6e604c3
commit
2853120387
41 changed files with 1281 additions and 908 deletions
114
xrogue/util.c
114
xrogue/util.c
|
|
@ -26,8 +26,7 @@
|
|||
*/
|
||||
|
||||
int
|
||||
ac_compute(ignoremetal)
|
||||
bool ignoremetal;
|
||||
ac_compute(bool ignoremetal)
|
||||
{
|
||||
register int ac;
|
||||
|
||||
|
|
@ -60,8 +59,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;
|
||||
|
|
@ -78,8 +77,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;
|
||||
|
|
@ -126,7 +125,7 @@ register int y, x;
|
|||
*/
|
||||
|
||||
long
|
||||
check_level()
|
||||
check_level(void)
|
||||
{
|
||||
register int i, j, add = 0;
|
||||
register unsigned long exp;
|
||||
|
|
@ -170,8 +169,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 */
|
||||
|
|
@ -195,7 +194,8 @@ register int amt;
|
|||
* let's confuse the player
|
||||
*/
|
||||
|
||||
confus_player()
|
||||
void
|
||||
confus_player(void)
|
||||
{
|
||||
if (off(player, ISCLEAR))
|
||||
{
|
||||
|
|
@ -213,7 +213,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) {
|
||||
|
|
@ -231,9 +232,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;
|
||||
|
||||
|
|
@ -254,10 +254,7 @@ struct thing *flgptr;
|
|||
*/
|
||||
|
||||
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;
|
||||
|
|
@ -333,8 +330,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;
|
||||
|
||||
|
|
@ -355,9 +352,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;
|
||||
|
|
@ -377,9 +372,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;
|
||||
|
|
@ -398,7 +391,7 @@ register int x;
|
|||
*/
|
||||
|
||||
coord
|
||||
get_coordinates()
|
||||
get_coordinates(void)
|
||||
{
|
||||
register int which;
|
||||
coord c;
|
||||
|
|
@ -458,8 +451,7 @@ get_coordinates()
|
|||
*/
|
||||
|
||||
bool
|
||||
get_dir(direction)
|
||||
coord *direction;
|
||||
get_dir(coord *direction)
|
||||
{
|
||||
register char *prompt;
|
||||
register bool gotit;
|
||||
|
|
@ -519,8 +511,7 @@ coord *direction;
|
|||
*/
|
||||
|
||||
long
|
||||
get_worth(obj)
|
||||
reg struct object *obj;
|
||||
get_worth(struct object *obj)
|
||||
{
|
||||
reg long worth, wh;
|
||||
|
||||
|
|
@ -591,8 +582,7 @@ reg struct object *obj;
|
|||
*/
|
||||
|
||||
bool
|
||||
invisible(monst)
|
||||
register struct thing *monst;
|
||||
invisible(struct thing *monst)
|
||||
{
|
||||
register bool ret_code;
|
||||
|
||||
|
|
@ -608,8 +598,8 @@ register struct thing *monst;
|
|||
* 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;
|
||||
|
|
@ -648,11 +638,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 unsigned char ch, och;
|
||||
|
|
@ -937,8 +928,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 long exp;
|
||||
|
|
@ -975,8 +966,7 @@ short who;
|
|||
*/
|
||||
|
||||
char *
|
||||
monster_name(tp)
|
||||
register struct thing *tp;
|
||||
monster_name(struct thing *tp)
|
||||
{
|
||||
prbuf[0] = '\0';
|
||||
if (on(*tp, ISFLEE) || on(*tp, WASTURNED))
|
||||
|
|
@ -1007,8 +997,7 @@ register struct thing *tp;
|
|||
*/
|
||||
|
||||
bool
|
||||
move_hero(why)
|
||||
int why;
|
||||
move_hero(int why)
|
||||
{
|
||||
char *action = NULL;
|
||||
unsigned char which;
|
||||
|
|
@ -1053,7 +1042,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 */
|
||||
|
||||
|
|
@ -1105,12 +1095,13 @@ static const char 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;
|
||||
|
||||
|
|
@ -1167,8 +1158,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;
|
||||
|
|
@ -1192,7 +1183,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) {
|
||||
|
|
@ -1209,9 +1201,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;
|
||||
while (len--)
|
||||
|
|
@ -1229,8 +1220,7 @@ register int len;
|
|||
*/
|
||||
|
||||
char *
|
||||
tr_name(ch)
|
||||
char ch;
|
||||
tr_name(char ch)
|
||||
{
|
||||
register char *s = NULL;
|
||||
|
||||
|
|
@ -1263,8 +1253,7 @@ char ch;
|
|||
*/
|
||||
|
||||
char *
|
||||
vowelstr(str)
|
||||
register char *str;
|
||||
vowelstr(char *str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
|
|
@ -1283,8 +1272,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;
|
||||
|
|
@ -1302,7 +1291,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