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.
This commit is contained in:
John "Elwin" Edwards 2016-02-19 21:02:28 -05:00
parent f38b2223c8
commit e8e6e604c3
39 changed files with 1181 additions and 889 deletions

View file

@ -32,10 +32,19 @@ extern char oldtext[WTXTNUM][WTXTLEN];
#endif
void open_records(void);
bool too_much(void);
bool author(void);
void chmsg(char *fmt, int arg);
#ifdef MAXPROCESSES
int loadav(void);
#endif
#ifdef MAXUSERS
int ucount(void);
#endif
bool holiday(void);
main(argc, argv, envp)
char **argv;
char **envp;
int
main(int argc, char *argv[], char *envp[])
{
register char *env;
int lowtime;
@ -419,8 +428,7 @@ char **envp;
*/
void
endit(sig)
int sig;
endit(int sig)
{
fatal("Ok, if you want to exit that badly, I'll have to allow it\n");
}
@ -430,8 +438,8 @@ int sig;
* Exit the program, printing a message.
*/
fatal(s)
char *s;
void
fatal(char *s)
{
clear();
move(lines-2, 0);
@ -449,8 +457,8 @@ char *s;
* rnd:
* Pick a very random number.
*/
rnd(range)
register int range;
int
rnd(int range)
{
return(range <= 0 ? 0 : md_rand() % range);
}
@ -460,8 +468,8 @@ register int range;
* roll a number of dice
*/
roll(number, sides)
register int number, sides;
int
roll(int number, int sides)
{
register int dtotal = 0;
@ -474,8 +482,7 @@ register int number, sides;
* handle stop and start signals
*/
void
tstp(sig)
int sig;
tstp(int sig)
{
mvcur(0, cols - 1, lines - 1, 0);
endwin();
@ -493,7 +500,8 @@ int sig;
}
# endif
setup()
void
setup(void)
{
#ifdef CHECKTIME
int checkout();
@ -563,7 +571,8 @@ open_records(void)
* refreshing things and looking at the proper times.
*/
playit()
void
playit(void)
{
register char *opts;
@ -585,7 +594,8 @@ playit()
/*
* see if the system is being used too much for this game
*/
too_much()
bool
too_much(void)
{
#if MAXPROCESSES
if (loadav() > MAXPROCESSES)
@ -602,7 +612,8 @@ too_much()
* author:
* See if a user is an author of the program
*/
author()
bool
author(void)
{
switch (md_getuid()) {
#if AUTHOR
@ -653,9 +664,8 @@ checkout()
* 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) {
printf(fmt, arg);
@ -671,7 +681,8 @@ int arg;
#include <fcntl.h>
loadav()
int
loadav(void)
{
char *sarcmd = "sar -v | cut -c17-20 | tail -2";
char *gettycmd = "grep getty /etc/inittab | wc -l";
@ -724,7 +735,9 @@ loadav()
#include <sys/types.h>
#include <utmp.h>
struct utmp buf;
ucount()
int
ucount(void)
{
reg struct utmp *up;
reg FILE *utmp;
@ -751,7 +764,8 @@ ucount()
* holiday:
* Returns TRUE when it is a good time to play rogue
*/
holiday()
bool
holiday(void)
{
#ifdef CHECKTIME
long now;