Mercurial > hg > early-roguelike
diff arogue7/options.c @ 219:f9ef86cf22b2
Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
author | John "Elwin" Edwards |
---|---|
date | Fri, 19 Feb 2016 21:02:28 -0500 |
parents | a307ff9cd95e |
children | 50b89f165a34 |
line wrap: on
line diff
--- a/arogue7/options.c Sun Feb 07 14:39:21 2016 -0500 +++ b/arogue7/options.c Fri Feb 19 21:02:28 2016 -0500 @@ -40,14 +40,15 @@ typedef struct optstruct OPTION; -int put_bool(), - get_bool(), - put_str(), - get_str(), - put_abil(), - get_abil(), - get_quest(), - put_quest(); +void put_bool(bool *b, WINDOW *win); +int get_bool(bool *bp, WINDOW *win); +void put_str(char *str, WINDOW *win); +int get_str(char *opt, 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); +int get_ro(WINDOW *win, int oy, int ox); int get_str_prot(char *opt, WINDOW *win); int get_score(char *opt, WINDOW *win); @@ -83,9 +84,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; @@ -97,9 +97,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; @@ -113,9 +112,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; @@ -152,9 +150,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; @@ -202,9 +199,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; @@ -278,7 +274,8 @@ /* * print and then set options from the terminal */ -option() +void +option(void) { register OPTION *op; register int retval; @@ -334,8 +331,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; @@ -428,9 +425,8 @@ /* * print the character type */ -put_abil(ability, win) -int *ability; -WINDOW *win; +void +put_abil(int *ability, WINDOW *win) { waddstr(win, char_class[*ability].name); } @@ -440,9 +436,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); } @@ -451,9 +446,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"); } @@ -464,9 +458,8 @@ /* * put out a string */ -put_str(str, win) -char *str; -WINDOW *win; +void +put_str(char *str, WINDOW *win) { waddstr(win, str); }