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:
John "Elwin" Edwards 2016-02-07 14:39:21 -05:00
parent 59f448e92e
commit f38b2223c8
37 changed files with 977 additions and 733 deletions

View file

@ -18,6 +18,9 @@
#include <stdarg.h>
#include "rogue.h"
void doadd(char *fmt, va_list ap);
void ministat(void);
/*
* msg:
* Display a message at the top of the screen.
@ -27,6 +30,7 @@ static char msgbuf[BUFSIZ];
static int newpos = 0;
/*VARARGS1*/
void
msg(char *fmt, ...)
{
va_list ap;
@ -54,6 +58,7 @@ msg(char *fmt, ...)
/*
* add things to the current message
*/
void
addmsg(char *fmt, ...)
{
va_list ap;
@ -66,7 +71,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)
{
strncpy(huh, msgbuf, sizeof(huh));
@ -96,6 +102,7 @@ endmsg()
draw(msgw);
}
void
doadd(char *fmt, va_list ap)
{
/*
@ -113,9 +120,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;
@ -156,7 +162,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)
{
@ -177,7 +184,8 @@ shoot_ok(ch)
* getchar.
*/
readchar()
int
readchar(void)
{
int ch;
@ -195,10 +203,11 @@ readchar()
/*
* status:
* Display the important stats line. Keep the cursor where it was.
* If display is 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 = 0, ox = 0, temp;
@ -327,7 +336,8 @@ line_two:
wmove(cw, oy, ox);
}
ministat()
void
ministat(void)
{
register int oy, ox, temp;
static char buf[LINELEN];
@ -367,9 +377,8 @@ ministat()
* Sit around until the guy types the right key
*/
wait_for(win,ch)
WINDOW *win;
register char ch;
void
wait_for(WINDOW *win, char ch)
{
register char c;
@ -386,9 +395,8 @@ register char ch;
* 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);
@ -403,9 +411,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);
@ -417,8 +424,8 @@ char *message;
* restscr:
* Restores the screen to the terminal
*/
restscr(scr)
WINDOW *scr;
void
restscr(WINDOW *scr)
{
clearok(scr,TRUE);
touchwin(scr);
@ -431,10 +438,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 */
@ -469,12 +473,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 */