Mercurial > hg > early-roguelike
diff srogue/io.c @ 217:94a0d9dd5ce1
Super-Rogue: convert to ANSI-style function declarations.
This fixes most of the build warnings.
author | John "Elwin" Edwards |
---|---|
date | Sun, 31 Jan 2016 13:45:07 -0500 |
parents | 458df24e973d |
children | 70aa5808c782 |
line wrap: on
line diff
--- a/srogue/io.c Thu Jan 28 18:55:47 2016 -0500 +++ b/srogue/io.c Sun Jan 31 13:45:07 2016 -0500 @@ -20,7 +20,7 @@ #include "rogue.h" #include "rogue.ext" -int md_readchar(WINDOW *win); +void doadd(char *fmt, va_list ap); /* * msg: @@ -29,6 +29,7 @@ static char msgbuf[BUFSIZ]; static int newpos = 0; +void msg(char *fmt, ...) { va_list ap; @@ -54,6 +55,7 @@ * addmsg: * Add things to the current message */ +void addmsg(char *fmt, ...) { va_list ap; @@ -68,7 +70,8 @@ * 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) { strcpy(huh, msgbuf); if (mpos > 0) { @@ -88,6 +91,7 @@ * doadd: * Perform a printf into a buffer */ +void doadd(char *fmt, va_list ap) { vsprintf(&msgbuf[newpos], fmt, ap); @@ -98,8 +102,8 @@ * step_ok: * Returns TRUE if it is ok to step on ch */ -step_ok(ch) -unsigned char ch; +bool +step_ok(unsigned char ch) { if (dead_end(ch)) return FALSE; @@ -113,8 +117,8 @@ * dead_end: * Returns TRUE if you cant walk through that character */ -dead_end(ch) -char ch; +bool +dead_end(char ch) { if (ch == '-' || ch == '|' || ch == ' ' || ch == SECRETDOOR) return TRUE; @@ -129,7 +133,8 @@ * getchar. */ -readchar() +int +readchar(void) { char c; @@ -148,8 +153,8 @@ * status: * Display the important stats line. Keep the cursor where it was. */ -status(fromfuse) -int fromfuse; +void +status(int fromfuse) { reg int totwght, carwght; reg struct real *stef, *stre, *stmx; @@ -220,7 +225,8 @@ * dispmax: * Display the hero's maximum status */ -dispmax() +void +dispmax(void) { reg struct real *hmax; @@ -233,8 +239,8 @@ * illeg_ch: * Returns TRUE if a char shouldn't show on the screen */ -illeg_ch(ch) -unsigned char ch; +bool +illeg_ch(unsigned char ch) { if (ch < 32 || ch > 127) return TRUE; @@ -247,9 +253,8 @@ * wait_for: * Sit around until the guy types the right key */ -wait_for(win,ch) -WINDOW *win; -char ch; +void +wait_for(WINDOW *win, char ch) { register char c; @@ -293,9 +298,8 @@ * 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); @@ -307,8 +311,8 @@ * restscr: * Restores the screen to the terminal */ -restscr(scr) -WINDOW *scr; +void +restscr(WINDOW *scr) { clearok(scr,TRUE); touchwin(scr); @@ -318,8 +322,8 @@ * npch: * Get the next char in line for inventories */ -npch(ch) -char ch; +char +npch(char ch) { reg char nch; if (ch >= 'z')