Mercurial > hg > early-roguelike
diff arogue7/rip.c @ 219:f9ef86cf22b2
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.
author | John "Elwin" Edwards |
---|---|
date | Fri, 19 Feb 2016 21:02:28 -0500 |
parents | 382ff498acdd |
children | d3968e9cb98d |
line wrap: on
line diff
--- a/arogue7/rip.c Sun Feb 07 14:39:21 2016 -0500 +++ b/arogue7/rip.c Fri Feb 19 21:02:28 2016 -0500 @@ -91,15 +91,15 @@ 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 @@ * 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 @@ /* * Restore window characteristics on a hard window terminal (PC7300). */ -endhardwin() +void +endhardwin(void) { register int i; struct utdata labelbuf; @@ -172,8 +173,7 @@ #endif char * -killname(monst) -register short monst; +killname(short monst) { static char mons_name[LINELEN]; int i; @@ -249,9 +249,8 @@ */ /* 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 @@ * 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 @@ * 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 @@ * 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 @@ refresh(); } -total_winner() +void +total_winner(void) { register struct linked_list *item; register struct object *obj; @@ -876,11 +874,10 @@ 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 */