mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
kconfig: nconf: get rid of (void) casts from wattrset() calls
This reverts commit 10175ba65f ("nconfig: Silence unused return values
from wattrset").
With this patch applied, recent GCC versions can cleanly build nconf
without "value computed is not used" warnings.
The wattrset() used to be implemented as a macro, like this:
#define wattrset(win,at) \
(NCURSES_OK_ADDR(win) \
? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
OK) \
: ERR)
The GCC bugzilla [1] reported a false-positive -Wunused-value warning
in a similar test case. It was fixed by GCC 4.4.1.
Let's revert that commit, and see if somebody will claim the issue.
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39889
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
@@ -370,18 +370,18 @@ static void print_function_line(void)
|
||||
int lines = getmaxy(stdscr);
|
||||
|
||||
for (i = 0; i < function_keys_num; i++) {
|
||||
(void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
|
||||
wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
|
||||
mvwprintw(main_window, lines-3, offset,
|
||||
"%s",
|
||||
function_keys[i].key_str);
|
||||
(void) wattrset(main_window, attributes[FUNCTION_TEXT]);
|
||||
wattrset(main_window, attributes[FUNCTION_TEXT]);
|
||||
offset += strlen(function_keys[i].key_str);
|
||||
mvwprintw(main_window, lines-3,
|
||||
offset, "%s",
|
||||
function_keys[i].func);
|
||||
offset += strlen(function_keys[i].func) + skip;
|
||||
}
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
wattrset(main_window, attributes[NORMAL]);
|
||||
}
|
||||
|
||||
/* help */
|
||||
@@ -954,16 +954,16 @@ static void show_menu(const char *prompt, const char *instructions,
|
||||
current_instructions = instructions;
|
||||
|
||||
clear();
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
wattrset(main_window, attributes[NORMAL]);
|
||||
print_in_middle(stdscr, 1, 0, getmaxx(stdscr),
|
||||
menu_backtitle,
|
||||
attributes[MAIN_HEADING]);
|
||||
|
||||
(void) wattrset(main_window, attributes[MAIN_MENU_BOX]);
|
||||
wattrset(main_window, attributes[MAIN_MENU_BOX]);
|
||||
box(main_window, 0, 0);
|
||||
(void) wattrset(main_window, attributes[MAIN_MENU_HEADING]);
|
||||
wattrset(main_window, attributes[MAIN_MENU_HEADING]);
|
||||
mvwprintw(main_window, 0, 3, " %s ", prompt);
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
wattrset(main_window, attributes[NORMAL]);
|
||||
|
||||
set_menu_items(curses_menu, curses_menu_items);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user