diff rogue4/io.c @ 215:1b73a8641b37

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.
author John "Elwin" Edwards
date Wed, 27 Jan 2016 19:41:05 -0500
parents 9535a08ddc39
children
line wrap: on
line diff
--- a/rogue4/io.c	Sat Jan 23 09:35:14 2016 -0500
+++ b/rogue4/io.c	Wed Jan 27 19:41:05 2016 -0500
@@ -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 @@
  *	Add things to the current message
  */
 
+void
 addmsg(char *fmt, ...)
 {
     va_list ap;
@@ -65,7 +69,8 @@
  *	if it is up there with the --More--)
  */
 
-endmsg()
+void
+endmsg(void)
 {
     if (save_msg)
     {
@@ -99,6 +104,7 @@
  *	Perform an add onto the message buffer
  */
 
+void
 doadd(char *fmt, va_list ap)
 {
     vsprintf(&msgbuf[newpos], fmt, ap);
@@ -109,7 +115,8 @@
  * 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 @@
  *	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 @@
     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 @@
  * 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 @@
 
 
 
-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 @@
  * 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);