relocate choose_classes_menu() to windows.c

choose_classes_menu was declared extern. The only caller presently
was calling it was optfn_pickup_types() in options.c.

It could have had the extern declaration from include/extern.h and
declare it as static within options.c, if that was the only use
anticipated. Also, if the one existing caller were all there would
ever be, the argument passed to it that was the subject of pr #1146
could have just been removed along with the switch.

Checking the comments above the function, however, it was clearly
designed as a general-purpose function that could be called from
anywhere for the functionality desired, even though there's presently
just the one caller, passing just the one variation of the category
argument.

Relocate the general-purpose function over to src/windows.c, where
several interface-related / menu-related general-purpose functions
already reside.

options.c has gotten *huge* and this is a fitting opportunity to
reduce its size a little.
This commit is contained in:
nhmall
2023-11-23 14:28:12 -05:00
parent fc5688cee8
commit fa4a47d8ff
3 changed files with 134 additions and 135 deletions

View File

@@ -2067,7 +2067,6 @@ extern void option_help(void);
extern void all_options_strbuf(strbuf_t *);
extern void next_opt(winid, const char *);
extern int fruitadd(char *, struct fruit *);
extern int choose_classes_menu(const char *, int, boolean, char *, char *);
extern boolean parsebindings(char *);
extern void oc_to_str(char *, char *);
extern void add_menu_cmd_alias(char, char);
@@ -3437,12 +3436,12 @@ extern void genl_display_file(const char *, boolean);
extern boolean menuitem_invert_test(int, unsigned, boolean);
extern const char *mixed_to_glyphinfo(const char *str, glyph_info *gip);
extern void adjust_menu_promptstyle(winid, color_attr *);
extern int choose_classes_menu(const char *, int, boolean, char *, char *);
extern void add_menu(winid, const glyph_info *, const ANY_P *,
char, char, int, int, const char *, unsigned int);
extern void add_menu_heading(winid, const char *);
extern void add_menu_str(winid, const char *);
extern int select_menu(winid, int, menu_item **);
extern void getlin(const char *, char *);
/* ### windows.c ### */