Mercurial > hg > early-roguelike
diff arogue5/options.c @ 218:56e748983fa8
Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
author | John "Elwin" Edwards |
---|---|
date | Sun, 07 Feb 2016 14:39:21 -0500 |
parents | aac28331e71d |
children | 50b89f165a34 |
line wrap: on
line diff
--- a/arogue5/options.c Sun Jan 31 13:45:07 2016 -0500 +++ b/arogue5/options.c Sun Feb 07 14:39:21 2016 -0500 @@ -35,16 +35,16 @@ typedef struct optstruct OPTION; -int put_bool(), - get_bool(), - put_str(), - get_str(), - get_restr(), - get_score(), - put_abil(), - get_abil(), - get_quest(), - put_quest(); +int get_ro(WINDOW *win, int oy, int ox); +int get_restr(char *optstr, WINDOW *win); +int get_score(char *optstr, WINDOW *win); +void put_abil(int *ability, WINDOW *win); +void get_abil(int *abil, WINDOW *win); +void put_quest(int *quest, WINDOW *win); +void get_quest(int *quest, WINDOW *win); +void put_bool(bool *b, WINDOW *win); +int get_bool(bool *bp, WINDOW *win); +void put_str(char *str, WINDOW *win); OPTION optlist[] = { {"terse", "Terse output: ", @@ -111,9 +111,8 @@ /* * The ability field is read-only */ -get_abil(abil, win) -int *abil; -WINDOW *win; +void +get_abil(int *abil, WINDOW *win) { register int oy, ox; @@ -125,9 +124,8 @@ /* * The quest field is read-only */ -get_quest(quest, win) -int *quest; -WINDOW *win; +void +get_quest(int *quest, WINDOW *win) { register int oy, ox; @@ -141,9 +139,8 @@ * "Get" a read-only value. */ -get_ro(win, oy, ox) -WINDOW *win; -register int oy, ox; +int +get_ro(WINDOW *win, int oy, int ox) { register int ny, nx; register bool op_bad; @@ -180,9 +177,8 @@ * allow changing a boolean option and print it out */ -get_bool(bp, win) -bool *bp; -WINDOW *win; +int +get_bool(bool *bp, WINDOW *win) { register int oy, ox; register bool op_bad; @@ -230,9 +226,8 @@ /* * set a string option */ -get_str(opt, win) -register char *opt; -WINDOW *win; +int +get_str(char *opt, WINDOW *win) { register char *sp; register int c, oy, ox; @@ -306,7 +301,8 @@ /* * print and then set options from the terminal */ -option() +void +option(void) { register OPTION *op; register int retval; @@ -362,8 +358,8 @@ * or the end of the entire option string. */ -parse_opts(str) -register char *str; +void +parse_opts(char *str) { register char *sp; register OPTION *op; @@ -459,9 +455,8 @@ /* * print the character type */ -put_abil(ability, win) -int *ability; -WINDOW *win; +void +put_abil(int *ability, WINDOW *win) { char *abil; @@ -480,9 +475,8 @@ * print out the quest */ -put_quest(quest, win) -int *quest; -WINDOW *win; +void +put_quest(int *quest, WINDOW *win) { waddstr(win, rel_magic[*quest].mi_name); } @@ -491,9 +485,8 @@ /* * put out a boolean */ -put_bool(b, win) -bool *b; -WINDOW *win; +void +put_bool(bool *b, WINDOW *win) { waddstr(win, *b ? "True" : "False"); } @@ -504,9 +497,8 @@ /* * put out a string */ -put_str(str, win) -char *str; -WINDOW *win; +void +put_str(char *str, WINDOW *win) { waddstr(win, str); }