Mercurial > hg > early-roguelike
diff rogue4/io.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | 1b73a8641b37 |
children |
line wrap: on
line diff
--- a/rogue4/io.c Fri Feb 26 17:30:30 2016 -0500 +++ b/rogue4/io.c Wed Mar 02 21:28:34 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);