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

@ -47,11 +47,17 @@ static char *lockfile = LOCKFILE;
#endif
#endif
int too_much(void);
bool author(void);
void checkout(int s);
void chmsg(char *fmt, int arg);
/*
* init_check:
* Check out too see if it is proper to play the game now
*/
init_check()
void
init_check(void)
{
if (too_much())
{
@ -70,7 +76,8 @@ init_check()
* Open up the score file for future use, and then
* setuid(getuid()) in case we are running setuid.
*/
open_score()
void
open_score(void)
{
#ifdef SCOREFILE
fd = open(SCOREFILE, O_RDWR | O_CREAT, 0666 );
@ -82,7 +89,8 @@ open_score()
return;
}
void open_log(void)
void
open_log(void)
{
#ifdef LOGFILE
lfd = open(LOGFILE, O_WRONLY | O_APPEND | O_CREAT, 0666);
@ -96,12 +104,10 @@ void open_log(void)
* setup:
* Get starting setup for all games
*/
setup()
void
setup(void)
{
void auto_save(), quit(), endit(), tstp();
#ifdef CHECKTIME
int checkout();
#endif
/*
* make sure that large terminals don't overflow the bounds
@ -158,7 +164,8 @@ setup()
* start_score:
* Start the scoring sequence
*/
start_score()
void
start_score(void)
{
#ifdef SIGALRM
signal(SIGALRM, SIG_IGN);
@ -169,8 +176,8 @@ start_score()
* issymlink:
* See if the file has a symbolic link
*/
issymlink(sp)
char *sp;
bool
issymlink(char *sp)
{
#ifdef S_IFLNK
struct stat sbuf2;
@ -188,7 +195,8 @@ char *sp;
* too_much:
* See if the system is being used too much for this game
*/
too_much()
int
too_much(void)
{
#ifdef MAXLOAD
double avec[3];
@ -208,7 +216,8 @@ too_much()
* author:
* See if a user is an author of the program
*/
author()
bool
author(void)
{
#ifdef WIZARD
if (wizard)
@ -246,7 +255,7 @@ checkout(int s)
if (author())
{
num_checks = 1;
chmsg("The load is rather high, O exaulted one");
chmsg("The load is rather high, O exaulted one", 0);
}
else if (num_checks++ == 3)
fatal("Sorry. You took to long. You are dead\n");
@ -265,7 +274,7 @@ checkout(int s)
if (num_checks)
{
num_checks = 0;
chmsg("The load has dropped back down. You have a reprieve");
chmsg("The load has dropped back down. You have a reprieve", 0);
}
#ifdef CHECKTIME
#ifdef SIGALRM
@ -280,9 +289,8 @@ checkout(int s)
* checkout()'s version of msg. If we are in the middle of a
* shell, do a printf instead of a msg to avoid the refresh.
*/
chmsg(fmt, arg)
char *fmt;
int arg;
void
chmsg(char *fmt, int arg)
{
if (in_shell)
{
@ -299,7 +307,8 @@ int arg;
* lock the score file. If it takes too long, ask the user if
* they care to wait. Return TRUE if the lock is successful.
*/
lock_sc()
bool
lock_sc(void)
{
#ifdef SCOREFILE
#ifdef LOCKFILE
@ -361,7 +370,8 @@ over:
* unlock_sc:
* Unlock the score file
*/
unlock_sc()
void
unlock_sc(void)
{
#ifdef SCOREFILE
#ifdef LOCKFILE
@ -374,7 +384,8 @@ unlock_sc()
* flush_type:
* Flush typeahead for traps, etc.
*/
flush_type()
void
flush_type(void)
{
flushinp();
}