Mercurial > hg > early-roguelike
diff srogue/options.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 | d71e5e1f49cf |
line wrap: on
line diff
--- a/srogue/options.c Thu Jan 28 18:55:47 2016 -0500 +++ b/srogue/options.c Sun Jan 31 13:45:07 2016 -0500 @@ -30,7 +30,7 @@ typedef struct optstruct OPTION; -int put_str(), get_str(); +int allowchange(OPTION *opt); OPTION optlist[] = { { "name", "Name: ", whoami }, @@ -46,7 +46,8 @@ /* * print and then set options from the terminal */ -option() +void +option(void) { reg OPTION *op; reg int wh; @@ -106,9 +107,8 @@ * Set a string option */ #define CTRLB 2 -get_str(opt, awin) -char *opt; -WINDOW *awin; +int +get_str(char *opt, WINDOW *awin) { reg char *sp; reg int c, oy, ox; @@ -119,7 +119,7 @@ /* * loop reading in the string, and put it in a temporary buffer */ - for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE; + for (sp = buf; (c=readchar()) != '\n' && c != '\r' && c != ESCAPE; wclrtoeol(awin), draw(awin)) { if (sp - buf >= 50) { *sp = '\0'; /* line was too long */ @@ -186,8 +186,8 @@ * or the end of the entire option string. */ -parse_opts(str) -char *str; +void +parse_opts(char *str) { reg char *sp; reg OPTION *op; @@ -231,9 +231,8 @@ /* * copy string using unctrl for things */ -strucpy(s1, s2, len) -char *s1, *s2; -int len; +void +strucpy(char *s1, char *s2, int len) { reg char *sp;