options parsing madness

I should have reenabled curses before committing an earlier change;
it broke compile.

Make all optfn_FOO() be static in options.c;
fix newly added prototype for optfn_cursesgraphics();
fix conditionals for optfn_palette(), both prototype and function.

Also, add missing prototype for a sound routine.
This commit is contained in:
PatR
2021-01-23 15:42:00 -08:00
parent ab74ed2c20
commit 8affbf5a24
3 changed files with 106 additions and 110 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 extern.h $NHDT-Date: 1608749030 2020/12/23 18:43:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.934 $ */
/* NetHack 3.7 extern.h $NHDT-Date: 1611445282 2021/01/23 23:41:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.947 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2415,6 +2415,7 @@ E int NDECL(tiphat);
#ifdef USER_SOUNDS
E int FDECL(add_sound_mapping, (const char *));
E void FDECL(play_sound_for_message, (const char *));
E void FDECL(maybe_play_sound, (const char *));
E void NDECL(release_sound_mappings);
#endif

View File

@@ -12,7 +12,7 @@
* updates that should accompany your change.
*/
extern int FDECL(optfn_boolean, (int, int, BOOLEAN_P, char *, char *));
static int FDECL(optfn_boolean, (int, int, BOOLEAN_P, char *, char *));
enum OptType {BoolOpt, CompOpt};
enum Y_N {No, Yes};
enum Off_On {Off, On};
@@ -45,9 +45,9 @@ struct allopt_t {
#if defined(NHOPT_PROTO)
#define NHOPTB(a, b, c, s, i, n, v, d, al, bp)
#define NHOPTC(a, b, c, s, n, v, d, h, al, z) \
int FDECL(optfn_##a, (int, int, BOOLEAN_P, char *, char *));
static int FDECL(optfn_##a, (int, int, BOOLEAN_P, char *, char *));
#define NHOPTP(a, b, c, s, n, v, d, h, al, z) \
int FDECL(pfxfn_##a, (int, int, BOOLEAN_P, char *, char *));
static int FDECL(pfxfn_##a, (int, int, BOOLEAN_P, char *, char *));
#elif defined(NHOPT_ENUM)
#define NHOPTB(a, b, c, s, i, n, v, d, al, bp) \