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

@ -91,15 +91,15 @@ static char *rip[] = {
0
};
char *killname();
char *killname(short monst);
void showpack(char *howso);
int update(struct sc_ent top_ten[], unsigned long amount, short quest,
char *whoami, short flags, short level, short monst, short ctype,
char *system, char *login);
void
byebye(sig)
int sig;
byebye(int sig)
{
if (!isendwin()) {
clear();
@ -118,8 +118,8 @@ int sig;
* Do something really fun when he dies
*/
death(monst)
register short monst;
void
death(short monst)
{
register char **dp = rip, *killer;
register struct tm *lt;
@ -154,7 +154,8 @@ register short monst;
/*
* Restore window characteristics on a hard window terminal (PC7300).
*/
endhardwin()
void
endhardwin(void)
{
register int i;
struct utdata labelbuf;
@ -172,8 +173,7 @@ endhardwin()
#endif
char *
killname(monst)
register short monst;
killname(short monst)
{
static char mons_name[LINELEN];
int i;
@ -249,9 +249,8 @@ writelog(unsigned long amount, int flags, short monst)
*/
/* VARARGS2 */
score(amount, flags, monst)
unsigned long amount;
short monst;
void
score(unsigned long amount, int flags, short monst)
{
static struct sc_ent top_ten[NUMSCORE];
register struct sc_ent *scp;
@ -672,11 +671,10 @@ short monst;
* scorein:
* Convert a character string that has been translated from a
* score file by scoreout() back to a score file structure.
* num_bytes: Number of bytes of input that we want to convert
*/
scorein(input, scores, num_bytes)
unsigned char *input;
struct sc_ent scores[];
int num_bytes; /* Number of bytes of input that we want to convert */
void
scorein(unsigned char *input, struct sc_ent scores[], int num_bytes)
{
register int i, j;
unsigned long *lptr;
@ -731,9 +729,8 @@ int num_bytes; /* Number of bytes of input that we want to convert */
* this for compatibility sake since some machines write out fields in
* different orders.
*/
scoreout(scores, output)
struct sc_ent scores[];
unsigned char *output;
void
scoreout(struct sc_ent scores[], unsigned char *output)
{
register int i, j;
unsigned long *lptr;
@ -783,8 +780,8 @@ unsigned char *output;
* showpack:
* Display the contents of the hero's pack
*/
showpack(howso)
char *howso;
void
showpack(char *howso)
{
reg char *iname;
reg int cnt, packnum;
@ -813,7 +810,8 @@ char *howso;
refresh();
}
total_winner()
void
total_winner(void)
{
register struct linked_list *item;
register struct object *obj;
@ -876,11 +874,10 @@ total_winner()
exit(0);
}
update(top_ten, amount, quest, whoami, flags, level, monst, ctype, system, login)
struct sc_ent top_ten[];
unsigned long amount;
short quest, flags, level, monst, ctype;
char *whoami, *system, *login;
int
update(struct sc_ent top_ten[], unsigned long amount, short quest, char *whoami,
short flags, short level, short monst, short ctype, char *system,
char *login)
{
register struct sc_ent *scp, *sc2;
int retval=0; /* 1 if a change, 0 otherwise */