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

@ -23,8 +23,8 @@
* Change the player's class to the specified one.
*/
changeclass(newclass)
long *newclass;
void
changeclass(long *newclass)
{
if (*newclass == player.t_ctype) {
msg("You feel more skillful.");
@ -152,8 +152,8 @@ long *newclass;
* Use the relic that our monster is wielding.
*/
m_use_relic(monster)
register struct thing *monster;
void
m_use_relic(struct thing *monster)
{
register struct object *obj;
@ -181,7 +181,7 @@ register struct thing *monster;
}
when EMORI_CLOAK:
debug("stunning with Emori's cloak");
do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, NULL);
do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, 0);
obj->o_charges = 0;
when ASMO_ROD: {
@ -248,11 +248,12 @@ register struct thing *monster;
/*
* add something to the contents of something else
* bag: the holder of the items
* item: the item to put inside
*/
put_contents(bag, item)
register struct object *bag; /* the holder of the items */
register struct linked_list *item; /* the item to put inside */
void
put_contents(struct object *bag, struct linked_list *item)
{
register struct linked_list *titem;
register struct object *tobj;
@ -277,11 +278,11 @@ register struct linked_list *item; /* the item to put inside */
/*
* remove something from something else
* bag: the holder of the items
*/
take_contents(bag, item)
register struct object *bag; /* the holder of the items */
register struct linked_list *item;
void
take_contents(struct object *bag, struct linked_list *item)
{
if (bag->o_ac <= 0) {
@ -295,8 +296,8 @@ register struct linked_list *item;
}
do_bag(item)
register struct linked_list *item;
void
do_bag(struct linked_list *item)
{
register struct linked_list *titem = NULL;
@ -417,9 +418,10 @@ register struct linked_list *item;
}
}
do_panic(who)
int who; /* Kind of monster to panic (all if who is NULL) */
void
do_panic(int who)
{
/* who: kind of monster to panic (all if who is 0) */
register int x,y;
register struct linked_list *mon, *item;
register struct thing *th;
@ -485,9 +487,7 @@ int who; /* Kind of monster to panic (all if who is NULL) */
*/
int
misc_name(str,obj)
char *str;
register struct object *obj;
misc_name(char *str, struct object *obj)
{
char buf1[LINELEN];
@ -565,7 +565,8 @@ register struct object *obj;
return(0);
}
use_emori()
void
use_emori(void)
{
char selection; /* Cloak function */
int state = 0; /* Menu state */
@ -669,8 +670,8 @@ use_emori()
* try to write a scroll with the quill of Nagrom
*/
use_quill(obj)
struct object *obj;
void
use_quill(struct object *obj)
{
struct linked_list *item;
register int i,
@ -761,7 +762,7 @@ struct object *obj;
/* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines - 3) {
over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, NULL);
over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, '\0');
}
else draw(hw);
}
@ -789,7 +790,7 @@ struct object *obj;
/* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines - 3) {
over_win(cw, hw, MAXQUILL + 5, maxlen + 3,
0, curlen, NULL);
0, curlen, '\0');
}
else draw(hw);
@ -830,8 +831,8 @@ struct object *obj;
* Use something
*/
use_mm(which)
int which;
void
use_mm(int which)
{
register struct object *obj = NULL;
register struct linked_list *item = NULL;
@ -907,7 +908,7 @@ int which;
when GERYON_HORN:
/* Chase close monsters away */
msg("The horn blasts a shrill tone.");
do_panic(NULL);
do_panic(0);
when EYE_VECNA:
msg("The pain slowly subsides.. ");
when HEIL_ANKH:
@ -934,7 +935,7 @@ int which;
msg("The jug is empty");
break;
}
quaff (obj->o_ac, NULL, NULL, FALSE);
quaff (obj->o_ac, 0, 0, FALSE);
obj->o_ac = JUG_EMPTY;
fuse (alchemy, obj, ALCHEMYTIME, AFTER);
if (!(obj->o_flags & ISKNOW))
@ -1012,7 +1013,7 @@ int which;
break;
}
obj->o_charges--;
do_panic(NULL);
do_panic(0);
return;
/*
* dust of disappearance makes the player invisible for a while
@ -1140,7 +1141,7 @@ int which;
str = "vibrates softly";
msg("You rub the crystal and it %s... ", str);
/* cure him */
read_scroll(S_CURING, NULL, FALSE);
read_scroll(S_CURING, 0, FALSE);
/* give him weird hands */
turn_on(player, CANHUH);
msg("Your fingertips turn blue. ");
@ -1218,8 +1219,7 @@ int which;
*/
int
usage_time(item)
struct linked_list *item;
usage_time(struct linked_list *item)
{
register struct object *obj;
register int units = -1;