Mercurial > hg > early-roguelike
diff xrogue/io.c @ 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:13:26 -0500 |
parents | ce0cf824c192 |
children | e52a8a7ad4c5 |
line wrap: on
line diff
--- a/xrogue/io.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/io.c Wed Mar 02 21:13:26 2016 -0500 @@ -22,6 +22,8 @@ #include <string.h> #include "rogue.h" +void doadd(char *fmt, va_list ap); + /* * msg: * Display a message at the top of the screen. @@ -77,7 +79,8 @@ * player with the --More-- string. Then erase the message. */ -rmmsg() +void +rmmsg(void) { if (mpos) { wclear(msgw); @@ -96,7 +99,8 @@ * is up there with the --More--) */ -endmsg() +void +endmsg(void) { /* Needed to track where we are for 5.0 (PC) curses */ register int x, y; @@ -141,6 +145,7 @@ draw(msgw); } +void doadd(char *fmt, va_list ap) { vsprintf((char *) &msgbuf[newpos], fmt, ap); @@ -153,9 +158,8 @@ * 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; @@ -222,6 +226,7 @@ * returns true if it is ok for type to shoot over ch */ +bool shoot_ok(int ch) { switch (ch) @@ -240,10 +245,11 @@ /* * status: * Display the important stats line. Keep the cursor where it was. + * 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; @@ -377,8 +383,8 @@ * Sit around until the guy types the right key */ -wait_for(ch) -register char ch; +void +wait_for(char ch) { register char c; @@ -407,10 +413,9 @@ * typed and then redraw the starting screen. */ -over_win(oldwin, newin, maxy, maxx, cursory, cursorx, redraw) -WINDOW *oldwin, *newin; -int maxy, maxx, cursory, cursorx; -char redraw; +void +over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory, + int cursorx, char redraw) { char blanks[LINELEN+1]; register int line, i; @@ -460,9 +465,8 @@ * 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); @@ -477,9 +481,8 @@ * 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); @@ -491,8 +494,8 @@ * Restores the screen to the terminal */ -restscr(scr) -WINDOW *scr; +void +restscr(WINDOW *scr) { clearok(scr,TRUE); touchwin(scr); @@ -506,10 +509,7 @@ */ 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 */ @@ -542,12 +542,13 @@ /* * 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 */