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

@ -20,6 +20,7 @@
#define EDITSCORE 2 /* Edit the current score file */
#define ADDSCORE 3 /* Add a new score */
#include <stdlib.h>
#include <curses.h>
#include <time.h>
#include <signal.h>
@ -54,14 +55,20 @@ static char *rip[] = {
NULL
};
char *killname();
int rs_read_scorefile(FILE *savef, struct sc_ent *entries, int count);
void rs_write_scorefile(FILE *savef, struct sc_ent *entries, int count);
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);
extern FILE *scorefi, *logfile;
/*UNUSED*/
void
byebye(sig)
int sig;
byebye(int sig)
{
NOOP(sig);
exit_game(EXIT_ENDWIN);
@ -73,8 +80,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;
@ -102,8 +109,7 @@ register short monst;
}
char *
killname(monst)
register short monst;
killname(short monst)
{
static char mons_name[LINELEN/2];
int i;
@ -187,10 +193,8 @@ writelog(unsigned long amount, int flags, short monst)
*/
/* VARARGS2 */
score(amount, flags, monst)
unsigned long amount;
int flags;
short monst;
void
score(unsigned long amount, int flags, short monst)
{
struct sc_ent top_ten[NUMSCORE];
register struct sc_ent *scp;
@ -574,8 +578,8 @@ short monst;
* Display the contents of the hero's pack
*/
showpack(howso)
char *howso;
void
showpack(char *howso)
{
reg char *iname;
reg int cnt, packnum;
@ -604,7 +608,8 @@ char *howso;
refresh();
}
total_winner()
void
total_winner(void)
{
register struct linked_list *item;
register struct object *obj;
@ -665,9 +670,7 @@ total_winner()
void
delete_score(top_ten, idx)
struct sc_ent top_ten[NUMSCORE];
int idx;
delete_score(struct sc_ent top_ten[NUMSCORE], int idx)
{
for(;idx < NUMSCORE-1;idx++)
top_ten[idx] = top_ten[idx+1];
@ -676,9 +679,7 @@ int idx;
}
int
insert_score(top_ten, sc)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
insert_score(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc)
{
int i,j;
@ -699,10 +700,8 @@ struct sc_ent *sc;
/* PCS = player-class-system (used to determines uniqueness of player) */
int
is_pcs_match(sc1,sc2)
struct sc_ent *sc1;
struct sc_ent *sc2;
bool
is_pcs_match(struct sc_ent *sc1, struct sc_ent *sc2)
{
return( (strcmp(sc1->sc_name,sc2->sc_name) == 0) &&
(sc1->sc_ctype == sc2->sc_ctype) &&
@ -710,10 +709,8 @@ struct sc_ent *sc2;
}
int
count_pcs_matches(top_ten,sc,lowest)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
int *lowest;
count_pcs_matches(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc,
int *lowest)
{
int i, matches = 0;
@ -729,10 +726,8 @@ int *lowest;
}
int
find_most_pcs_matches(top_ten,sc,num,idx)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
int *num, *idx;
find_most_pcs_matches(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc,
int *num, int *idx)
{
int i, matches, max_match=0, max_match_idx=-1, lowest;
@ -761,9 +756,7 @@ int *num, *idx;
int
add_score(top_ten,sc)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
add_score(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc)
{
int idx, count;
@ -797,11 +790,10 @@ struct sc_ent *sc;
}
}
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)
{
struct sc_ent sc;