Mercurial > hg > early-roguelike
diff rogue4/options.c @ 215:1b73a8641b37
rogue4: fix most GCC5 warnings.
Converting all function definitions to ANSI style accounts for most of
the change. This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
author | John "Elwin" Edwards |
---|---|
date | Wed, 27 Jan 2016 19:41:05 -0500 |
parents | e7dc81b41168 |
children | 50b89f165a34 |
line wrap: on
line diff
--- a/rogue4/options.c Sat Jan 23 09:35:14 2016 -0500 +++ b/rogue4/options.c Wed Jan 27 19:41:05 2016 -0500 @@ -36,7 +36,10 @@ int allowchange(OPTION *opt); -int put_bool(), get_bool(), put_str(), get_str(); +void put_bool(bool *b); +void put_str(char *str); +int get_bool(bool *bp, WINDOW *win); +int get_str(char *opt, WINDOW *win); OPTION optlist[] = { {"terse", "Terse output: ", @@ -63,7 +66,8 @@ * option: * Print and then set options from the terminal */ -option() +void +option(void) { register OPTION *op; register int retval; @@ -125,8 +129,8 @@ * put_bool * Put out a boolean */ -put_bool(b) -bool *b; +void +put_bool(bool *b) { waddstr(hw, *b ? "True" : "False"); } @@ -135,8 +139,8 @@ * put_str: * Put out a string */ -put_str(str) -char *str; +void +put_str(char *str) { waddstr(hw, str); } @@ -145,9 +149,8 @@ * get_bool: * 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; @@ -196,9 +199,8 @@ */ #define MAXINP 50 /* max string to read from terminal or environment */ -get_str(opt, win) -register char *opt; -WINDOW *win; +int +get_str(char *opt, WINDOW *win) { register char *sp; register int c, oy, ox; @@ -274,9 +276,8 @@ * get_num: * Get a numeric option */ -get_num(opt, win) -short *opt; -WINDOW *win; +int +get_num(short *opt, WINDOW *win) { register int i; char buf[MAXSTR]; @@ -295,8 +296,8 @@ * being "name=....", with the string being defined up to a comma * 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; @@ -373,9 +374,8 @@ * strucpy: * Copy string using unctrol for things */ -strucpy(s1, s2, len) -register char *s1, *s2; -register int len; +void +strucpy(char *s1, char *s2, int len) { if (len > MAXINP) len = MAXINP;