Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly related to the return types of daemons and fuses.
This commit is contained in:
parent
59f448e92e
commit
f38b2223c8
37 changed files with 977 additions and 733 deletions
|
|
@ -43,10 +43,10 @@ static char *funfruit[] = {
|
|||
#define NFRUIT (sizeof(funfruit) / sizeof (char *))
|
||||
|
||||
void open_records(void);
|
||||
bool holiday(void);
|
||||
|
||||
main(argc, argv, envp)
|
||||
char **argv;
|
||||
char **envp;
|
||||
int
|
||||
main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
register char *env;
|
||||
int lowtime;
|
||||
|
|
@ -123,7 +123,6 @@ char **envp;
|
|||
* Check for a network update
|
||||
*/
|
||||
if (argc == 2 && strcmp(argv[1], "-u") == 0) {
|
||||
unsigned long netread();
|
||||
int errcheck, errors = 0;
|
||||
unsigned long amount;
|
||||
short monster;
|
||||
|
|
@ -277,8 +276,8 @@ endit(int sig)
|
|||
* Exit the program, printing a message.
|
||||
*/
|
||||
|
||||
fatal(s)
|
||||
char *s;
|
||||
void
|
||||
fatal(char *s)
|
||||
{
|
||||
clear();
|
||||
move(LINES-2, 0);
|
||||
|
|
@ -294,8 +293,8 @@ char *s;
|
|||
* Pick a very random number.
|
||||
*/
|
||||
|
||||
rnd(range)
|
||||
register int range;
|
||||
int
|
||||
rnd(int range)
|
||||
{
|
||||
return(range == 0 ? 0 : md_rand() % range);
|
||||
}
|
||||
|
|
@ -305,8 +304,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;
|
||||
|
||||
|
|
@ -336,10 +335,11 @@ tstp(int a)
|
|||
}
|
||||
# endif
|
||||
|
||||
setup()
|
||||
void
|
||||
setup(void)
|
||||
{
|
||||
#ifdef CHECKTIME
|
||||
int checkout();
|
||||
void checkout();
|
||||
#endif
|
||||
|
||||
#ifndef DUMP
|
||||
|
|
@ -392,7 +392,8 @@ setup()
|
|||
* refreshing things and looking at the proper times.
|
||||
*/
|
||||
|
||||
playit()
|
||||
void
|
||||
playit(void)
|
||||
{
|
||||
register char *opts;
|
||||
|
||||
|
|
@ -416,7 +417,8 @@ playit()
|
|||
/*
|
||||
* see if the system is being used too much for this game
|
||||
*/
|
||||
too_much()
|
||||
bool
|
||||
too_much(void)
|
||||
{
|
||||
#ifdef MAXLOAD
|
||||
double avec[3];
|
||||
|
|
@ -435,7 +437,8 @@ too_much()
|
|||
* author:
|
||||
* See if a user is an author of the program
|
||||
*/
|
||||
author()
|
||||
bool
|
||||
author(void)
|
||||
{
|
||||
switch (md_getuid()) {
|
||||
#if AUTHOR
|
||||
|
|
@ -450,7 +453,24 @@ author()
|
|||
|
||||
|
||||
#ifdef CHECKTIME
|
||||
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.
|
||||
*/
|
||||
void
|
||||
chmsg(char *fmt, int arg)
|
||||
{
|
||||
if (in_shell) {
|
||||
printf(fmt, arg);
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
}
|
||||
else
|
||||
msg(fmt, arg);
|
||||
}
|
||||
|
||||
void
|
||||
checkout(void)
|
||||
{
|
||||
static char *msgs[] = {
|
||||
"The system is too loaded for games. Please leave in %d minutes",
|
||||
|
|
@ -482,23 +502,6 @@ checkout()
|
|||
alarm(CHECKTIME * 60);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
{
|
||||
if (in_shell) {
|
||||
printf(fmt, arg);
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
}
|
||||
else
|
||||
msg(fmt, arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOADAV
|
||||
|
|
@ -510,8 +513,8 @@ struct nlist avenrun =
|
|||
"_avenrun"
|
||||
};
|
||||
|
||||
loadav(avg)
|
||||
reg double *avg;
|
||||
void
|
||||
loadav(double *avg)
|
||||
{
|
||||
reg int kmem;
|
||||
|
||||
|
|
@ -536,7 +539,8 @@ bad:
|
|||
#include <sys/types.h>
|
||||
#include <utmp.h>
|
||||
struct utmp buf;
|
||||
ucount()
|
||||
int
|
||||
ucount(void)
|
||||
{
|
||||
reg struct utmp *up;
|
||||
reg FILE *utmp;
|
||||
|
|
@ -559,7 +563,8 @@ ucount()
|
|||
* holiday:
|
||||
* Returns TRUE when it is a good time to play rogue
|
||||
*/
|
||||
holiday()
|
||||
bool
|
||||
holiday(void)
|
||||
{
|
||||
time_t now;
|
||||
struct tm *localtime();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue