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

@ -16,6 +16,8 @@
#include "rogue.h"
#include <stdarg.h>
void doadd(char *fmt, va_list ap);
/*
* msg:
* Display a message at the top of the screen.
@ -23,6 +25,7 @@
static char msgbuf[BUFSIZ];
static int newpos = 0;
void
msg(char *fmt, ...)
{
va_list ap;
@ -50,6 +53,7 @@ msg(char *fmt, ...)
* Add things to the current message
*/
void
addmsg(char *fmt, ...)
{
va_list ap;
@ -65,7 +69,8 @@ addmsg(char *fmt, ...)
* if it is up there with the --More--)
*/
endmsg()
void
endmsg(void)
{
if (save_msg)
{
@ -99,6 +104,7 @@ endmsg()
* Perform an add onto the message buffer
*/
void
doadd(char *fmt, va_list ap)
{
vsprintf(&msgbuf[newpos], fmt, ap);
@ -109,7 +115,8 @@ doadd(char *fmt, va_list ap)
* step_ok:
* Returns true if it is ok to step on ch
*/
step_ok(ch)
bool
step_ok(char ch)
{
switch (ch)
{
@ -127,8 +134,8 @@ step_ok(ch)
* Flushes stdout so that screen is up to date and then returns
* getchar().
*/
readcharw(win)
WINDOW *win;
int
readcharw(WINDOW *win)
{
int ch;
@ -143,14 +150,14 @@ WINDOW *win;
return(ch);
}
readchar()
int
readchar(void)
{
return( readcharw(stdscr) );
}
char *
unctrol(ch)
char ch;
unctrol(char ch)
{
return( (char *) unctrl(ch) );
}
@ -159,7 +166,8 @@ char ch;
* status:
* Display the important stats line. Keep the cursor where it was.
*/
status()
void
status(void)
{
register int oy, ox, temp;
static int hpwidth = 0, s_hungry;
@ -215,15 +223,14 @@ status()
wait_for(ch)
register char ch;
void
wait_for(char ch)
{
w_wait_for(stdscr, ch);
}
w_wait_for(win,ch)
WINDOW *win;
register char ch;
void
w_wait_for(WINDOW *win, char ch)
{
register char c;
@ -239,9 +246,8 @@ register char ch;
* show_win:
* 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);