From: PatR Date: Wed, 26 Feb 2020 00:18:58 +0000 (-0800) Subject: fix curses' create_nhmenu() warning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cff63b5b4c9f27edd5ee956d445a5861ee4a71cb;p=nethack fix curses' create_nhmenu() warning The extra flags argument to create_nhmenu() wasn't propagated to anywhere useful. It still doesn't do anything yet. --- diff --git a/include/wincurs.h b/include/wincurs.h index 6ba6f2925..9ae069a22 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -173,7 +173,7 @@ extern void curses_line_input_dialog(const char *prompt, extern int curses_character_input_dialog(const char *prompt, const char *choices, CHAR_P def); extern int curses_ext_cmd(void); -extern void curses_create_nhmenu(winid wid); +extern void curses_create_nhmenu(winid wid, unsigned long); extern void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P *identifier, CHAR_P accelerator, CHAR_P group_accel, int attr, diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index e18ccdc57..d29722bb5 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -83,6 +83,7 @@ typedef struct nhm { int num_pages; /* Number of display pages for entry */ int height; /* Window height of menu */ int width; /* Window width of menu */ + unsigned long mbehavior; /* menu flags */ boolean reuse_accels; /* Non-unique accelerators per page */ boolean bottom_heavy; /* display multi-page menu starting at end */ struct nhm *prev_menu; /* Pointer to previous entry */ @@ -510,7 +511,7 @@ curses_ext_cmd() /* Initialize a menu from given NetHack winid */ void -curses_create_nhmenu(winid wid) +curses_create_nhmenu(winid wid, unsigned long mbehavior) { nhmenu *new_menu = NULL; nhmenu *menuptr = nhmenus; @@ -541,6 +542,7 @@ curses_create_nhmenu(winid wid) new_menu->num_pages = 0; new_menu->height = 0; new_menu->width = 0; + new_menu->mbehavior = mbehavior; new_menu->reuse_accels = FALSE; new_menu->bottom_heavy = FALSE; return; @@ -553,6 +555,7 @@ curses_create_nhmenu(winid wid) new_menu->num_pages = 0; new_menu->height = 0; new_menu->width = 0; + new_menu->mbehavior = mbehavior; new_menu->reuse_accels = FALSE; new_menu->bottom_heavy = FALSE; new_menu->next_menu = NULL; diff --git a/win/curses/cursdial.h b/win/curses/cursdial.h index 08b9f2948..e75a55b30 100644 --- a/win/curses/cursdial.h +++ b/win/curses/cursdial.h @@ -12,7 +12,7 @@ void curses_line_input_dialog(const char *prompt, char *answer, int buffer); int curses_character_input_dialog(const char *prompt, const char *choices, CHAR_P def); int curses_ext_cmd(void); -void curses_create_nhmenu(winid wid); +void curses_create_nhmenu(winid wid, unsigned long); void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P *identifier, CHAR_P accelerator, CHAR_P group_accel, int attr, const char *str, unsigned itemflags); diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 24f0b3f4c..65037c0a8 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -485,7 +485,7 @@ curses_start_menu(winid wid, unsigned long mbehavior) if (inv_update) return; - curses_create_nhmenu(wid); + curses_create_nhmenu(wid, mbehavior); } /* diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index ab2ceb587..6300ca1fc 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -367,7 +367,7 @@ curses_prev_mesg() boolean do_lifo = (iflags.prevmsg_window != 'f'); wid = curses_get_wid(NHW_MENU); - curses_create_nhmenu(wid); + curses_create_nhmenu(wid, 0UL); Id = cg.zeroany; for (count = 0; count < num_messages; ++count) { diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index 314efe5af..902dbda08 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -671,7 +671,7 @@ curses_view_file(const char *filename, boolean must_exist) } wid = curses_get_wid(NHW_MENU); - curses_create_nhmenu(wid); + curses_create_nhmenu(wid, 0UL); Id = cg.zeroany; while (dlb_fgets(buf, BUFSZ, fp) != NULL) {