rogue4: fix most GCC5 warnings.

Converting all function definitions to ANSI style accounts for most of
the change.  This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
This commit is contained in:
John "Elwin" Edwards 2016-01-27 19:41:05 -05:00
parent 384386d71c
commit c1d6a6af6a
32 changed files with 625 additions and 394 deletions

View file

@ -18,15 +18,15 @@
#include <signal.h>
#include <limits.h>
#include <string.h>
#include <time.h>
#include "rogue.h"
/*
* main:
* The main program, of course
*/
main(argc, argv, envp)
char **argv;
char **envp;
int
main(int argc, char *argv[], char *envp[])
{
register char *env;
int lowtime;
@ -113,7 +113,7 @@ char **envp;
if (argc == 2 && strcmp(argv[1], "-s") == 0)
{
noscore = TRUE;
score(0, -1);
score(0, -1, 0);
exit(0);
}
init_check(); /* check for legal startup */
@ -227,8 +227,8 @@ endit(int a)
* fatal:
* Exit the program, printing a message.
*/
fatal(s)
char *s;
void
fatal(char *s)
{
clear();
move(LINES-2, 0);
@ -242,8 +242,8 @@ char *s;
* rnd:
* Pick a very random number.
*/
rnd(range)
register int range;
int
rnd(int range)
{
return range == 0 ? 0 : abs((int) RN) % range;
}
@ -252,8 +252,8 @@ register int range;
* roll:
* Roll a number of dice
*/
roll(number, sides)
register int number, sides;
int
roll(int number, int sides)
{
register int dtotal = 0;
@ -299,7 +299,8 @@ tstp(int a)
* The main loop of the program. Loop until the game is over,
* refreshing things and looking at the proper times.
*/
playit()
void
playit(void)
{
register char *opts;
@ -352,7 +353,7 @@ quit(int a)
move(LINES - 1, 0);
refresh();
writelog(purse, 1, 0);
score(purse, 1);
score(purse, 1, 0);
printf("[Press return to exit]\n");
fflush(NULL);
getchar();
@ -391,7 +392,8 @@ leave(int sig)
* shell:
* Let him escape for a while
*/
shell()
void
shell(void)
{
/*
* Set the terminal back to original mode