curses lint

This commit is contained in:
PatR
2018-12-26 01:45:17 -08:00
parent cae50298b6
commit ceb446eaea
4 changed files with 44 additions and 40 deletions

View File

@@ -87,17 +87,10 @@ curses_line_input_dialog(const char *prompt, char *answer, int buffer)
int prompt_width = strlen(prompt) + buffer + 1;
int prompt_height = 1;
int height = prompt_height;
#if __STDC_VERSION__ >= 199901L
char input[buffer];
#else
#ifndef BUFSZ
#define BUFSZ 256
#endif
char input[BUFSZ];
buffer = BUFSZ - 1;
#endif
if (buffer >= (int) sizeof input)
buffer = (int) sizeof input - 1;
maxwidth = term_cols - 2;
if (iflags.window_inited) {
@@ -164,7 +157,9 @@ curses_character_input_dialog(const char *prompt, const char *choices,
CHAR_P def)
{
WINDOW *askwin = NULL;
#ifdef PDCURSES
WINDOW *message_window;
#endif
int answer, count, maxwidth, map_height, map_width;
char *linestr;
char askstr[BUFSZ + QBUFSZ];
@@ -518,8 +513,8 @@ curses_add_nhmenu_item(winid wid, int glyph, const ANY_P * identifier,
nhmenu *current_menu = get_menu(wid);
if (current_menu == NULL) {
impossible
("curses_add_nhmenu_item: attempt to add item to nonexistent menu");
impossible(
"curses_add_nhmenu_item: attempt to add item to nonexistent menu");
return;
}
@@ -568,21 +563,19 @@ void
curses_finalize_nhmenu(winid wid, const char *prompt)
{
int count = 0;
nhmenu_item *menu_item_ptr;
nhmenu *current_menu = get_menu(wid);
if (current_menu == NULL) {
impossible("curses_finalize_nhmenu: attempt to finalize nonexistent menu");
impossible(
"curses_finalize_nhmenu: attempt to finalize nonexistent menu");
return;
}
nhmenu_item *menu_item_ptr = current_menu->entries;
while (menu_item_ptr != NULL) {
menu_item_ptr = menu_item_ptr->next_item;
for (menu_item_ptr = current_menu->entries;
menu_item_ptr != NULL; menu_item_ptr = menu_item_ptr->next_item)
count++;
}
current_menu->num_entries = count;
current_menu->prompt = curses_copy_of(prompt);
}
@@ -601,7 +594,8 @@ curses_display_nhmenu(winid wid, int how, MENU_ITEM_P ** _selected)
*_selected = NULL;
if (current_menu == NULL) {
impossible("curses_display_nhmenu: attempt to display nonexistent menu");
impossible(
"curses_display_nhmenu: attempt to display nonexistent menu");
return '\033';
}
@@ -1021,7 +1015,7 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num)
start_col += 4;
}
#if 0
//FIXME: menuglyphs not implemented yet
/* FIXME: menuglyphs not implemented yet */
if (menu_item_ptr->glyph != NO_GLYPH && iflags.use_menu_glyphs) {
unsigned special; /*notused */