Mercurial > hg > early-roguelike
diff xrogue/main.c @ 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:13:26 -0500 |
parents | cadff8f047a1 |
children | 7c1cb43f346e |
line wrap: on
line diff
--- a/xrogue/main.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/main.c Wed Mar 02 21:13:26 2016 -0500 @@ -27,10 +27,13 @@ #include "rogue.h" void open_records(void); +bool too_much(void); +bool author(void); +bool playtime(void); +bool betaover(void); -main(argc, argv, envp) -char **argv; -char **envp; +int +main(int argc, char *argv[], char *envp[]) { register char *env; time_t now; @@ -283,10 +286,8 @@ * Exit the program abnormally. */ -/*UNUSED*/ void -endit(sig) -int sig; +endit(int sig) { NOOP(sig); fatal("Ok, if you want to exit that badly, I'll have to allow it\n"); @@ -297,8 +298,8 @@ * Exit the program, printing a message. */ -fatal(s) -char *s; +void +fatal(char *s) { clear(); move(lines-2, 0); @@ -313,8 +314,8 @@ * Pick a very random number. */ -rnd(range) -register int range; +int +rnd(int range) { return( md_rand(range) ); } @@ -324,8 +325,8 @@ * roll a number of dice */ -roll(number, sides) -register int number, sides; +int +roll(int number, int sides) { register int dtotal = 0; @@ -334,7 +335,8 @@ return dtotal; } -setup() +void +setup(void) { md_setup(); } @@ -345,7 +347,8 @@ * refreshing things and looking at the proper times. */ -playit() +void +playit(void) { register char *opts; @@ -366,7 +369,8 @@ * see if the system is being used too much for this game */ -too_much() +bool +too_much(void) { /* we no longer do load checking or user counts */ return(FALSE); @@ -377,7 +381,8 @@ * See if a user is an author of the program */ -author() +bool +author(void) { switch (md_getuid()) { case 0: /* always OK for root to play */ @@ -392,7 +397,8 @@ * Returns TRUE when it is a good time to play rogue */ -playtime() +bool +playtime(void) { /* we no longer do playtime checking */ @@ -404,14 +410,15 @@ * Returns TRUE if the test period of this version of the game is over */ -betaover() +bool +betaover(void) { return(FALSE); } -exit_game(flag) -int flag; +void +exit_game(int flag) { int i;