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

@ -30,7 +30,10 @@
static char msgbuf[BUFSIZ];
static int newpos = 0;
void doadd(char *fmt, va_list ap);
/*VARARGS1*/
void
msg(char *fmt, ...)
{
va_list ap;
@ -58,6 +61,7 @@ msg(char *fmt, ...)
/*
* add things to the current message
*/
void
addmsg(char *fmt, ...)
{
va_list ap;
@ -71,7 +75,8 @@ addmsg(char *fmt, ...)
* Display a new msg (giving him a chance to see the previous one if it
* is up there with the --More--)
*/
endmsg()
void
endmsg(void)
{
/* Needed to track where we are for 5.0 (PC) curses */
register int x, y;
@ -111,6 +116,7 @@ endmsg()
draw(msgw);
}
void
doadd(char *fmt, va_list ap)
{
@ -127,9 +133,8 @@ doadd(char *fmt, va_list ap)
* flgptr will be NULL if we don't know what the monster is yet!
*/
step_ok(y, x, can_on_monst, flgptr)
register int y, x, can_on_monst;
register struct thing *flgptr;
bool
step_ok(int y, int x, int can_on_monst, struct thing *flgptr)
{
/* can_on_monst = MONSTOK if all we care about are physical obstacles */
register struct linked_list *item;
@ -188,7 +193,8 @@ register struct thing *flgptr;
* returns true if it is ok for type to shoot over ch
*/
shoot_ok(ch)
bool
shoot_ok(char ch)
{
switch (ch)
{
@ -209,7 +215,8 @@ shoot_ok(ch)
* getchar.
*/
readchar()
int
readchar(void)
{
int ch;
@ -227,10 +234,11 @@ readchar()
/*
* status:
* Display the important stats line. Keep the cursor where it was.
* display: if TRUE, display unconditionally
*/
status(display)
bool display; /* is TRUE, display unconditionally */
void
status(bool display)
{
register struct stats *stat_ptr, *max_ptr;
register int oy, ox, temp;
@ -358,8 +366,8 @@ line_two:
* wait_for
* Sit around until the guy types the right key
*/
wait_for(ch)
register char ch;
void
wait_for(char ch)
{
register char c;
@ -383,10 +391,9 @@ register char ch;
* typed and then redraw the starting screen.
*/
over_win(oldwin, newin, maxy, maxx, cursory, cursorx, redraw)
WINDOW *oldwin, *newin;
int maxy, maxx, cursory, cursorx;
char redraw;
void
over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory,
int cursorx, char redraw)
{
static char blanks[LINELEN+1];
register int line, i;
@ -436,9 +443,8 @@ char redraw;
* function used to display a window and wait before returning
*/
show_win(scr, message)
register WINDOW *scr;
char *message;
void
show_win(WINDOW *scr, char *message)
{
mvwaddstr(scr, 0, 0, message);
touchwin(scr);
@ -453,9 +459,8 @@ char *message;
* dbotline:
* Displays message on bottom line and waits for a space to return
*/
dbotline(scr,message)
WINDOW *scr;
char *message;
void
dbotline(WINDOW *scr, char *message)
{
mvwaddstr(scr,lines-1,0,message);
draw(scr);
@ -467,8 +472,8 @@ char *message;
* restscr:
* Restores the screen to the terminal
*/
restscr(scr)
WINDOW *scr;
void
restscr(WINDOW *scr)
{
clearok(scr,TRUE);
touchwin(scr);
@ -481,10 +486,7 @@ WINDOW *scr;
*/
unsigned long
netread(error, size, stream)
int *error;
int size;
FILE *stream;
netread(int *error, int size, FILE *stream)
{
unsigned long result = 0L, /* What we read in */
partial; /* Partial value */
@ -519,12 +521,13 @@ FILE *stream;
/*
* netwrite:
* Write out a byte, short, or long machine independently.
* value: What to write
* size: How much to write out
* stream: Where to write it
*/
netwrite(value, size, stream)
unsigned long value; /* What to write */
int size; /* How much to write out */
FILE *stream; /* Where to write it */
int
netwrite(unsigned long value, int size, FILE *stream)
{
int i; /* Goes through value one byte at a time */
char outc; /* The next character to be written */