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

@ -15,6 +15,7 @@
#include "curses.h"
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "rogue.h"
#ifdef PC7300
#include "menu.h"
@ -29,8 +30,8 @@
* Change the player's class to the specified one.
*/
changeclass(newclass)
int newclass;
void
changeclass(int newclass)
{
if (newclass == player.t_ctype) {
msg("You feel more skillful.");
@ -132,8 +133,8 @@ int 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;
@ -161,7 +162,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: {
@ -228,10 +229,11 @@ 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;
@ -256,10 +258,10 @@ 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) {
@ -273,8 +275,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;
@ -395,8 +397,9 @@ register struct linked_list *item;
}
}
do_panic(who)
int who; /* Kind of monster to panic (all if who is NULL) */
/* who: Kind of monster to panic (all if who is NULL) */
void
do_panic(int who)
{
register int x,y;
register struct linked_list *mon, *item;
@ -460,8 +463,7 @@ int who; /* Kind of monster to panic (all if who is NULL) */
* print miscellaneous magic bonuses
*/
char *
misc_name(obj)
register struct object *obj;
misc_name(struct object *obj)
{
static char buf[LINELEN];
char buf1[LINELEN];
@ -523,7 +525,8 @@ register struct object *obj;
return buf;
}
use_emori()
void
use_emori(void)
{
char selection; /* Cloak function */
int state = 0; /* Menu state */
@ -633,8 +636,8 @@ static char Displines[MAXQUILL+1][LINELEN+1]; /* The lines themselves */
/*
* 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,
@ -766,7 +769,7 @@ struct object *obj;
#endif
/* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines / 2) {
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);
}
@ -795,7 +798,7 @@ struct object *obj;
/* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines / 2) {
over_win(cw, hw, MAXQUILL + 5, maxlen + 3,
0, curlen, NULL);
0, curlen, '\0');
}
else draw(hw);
@ -835,8 +838,8 @@ got_scroll:
}
}
use_mm(which)
int which;
void
use_mm(int which)
{
register struct object *obj = NULL;
register struct linked_list *item = NULL;
@ -915,7 +918,7 @@ int which;
when GERYON_HORN:
/* Chase close monsters away */
msg("The horn blasts a shrill tone.");
do_panic(NULL);
do_panic(0);
when HEIL_ANKH:
case YENDOR_AMULET:
case STONEBONES_AMULET:
@ -938,7 +941,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))
@ -1008,7 +1011,7 @@ int which;
break;
}
obj->o_charges--;
do_panic(NULL);
do_panic(0);
/*
* dust of disappearance makes the player invisible for a while
*/
@ -1124,8 +1127,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;