Commit ad818106 authored by Randy Dunlap's avatar Randy Dunlap Committed by Masahiro Yamada

kconfig: fix sparse warnings in nconfig

Fix sparse warnings in scripts/kconfig/nconf* ('make nconfig'):

../scripts/kconfig/nconf.c:1071:32: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1238:30: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:511:51: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1460:6: warning: symbol 'setup_windows' was not declared. Should it be static?
../scripts/kconfig/nconf.c:274:12: warning: symbol 'current_instructions' was not declared. Should it be static?
../scripts/kconfig/nconf.c:308:22: warning: symbol 'function_keys' was not declared. Should it be static?
../scripts/kconfig/nconf.gui.c:132:17: warning: non-ANSI function declaration of function 'set_colors'
../scripts/kconfig/nconf.gui.c:195:24: warning: Using plain integer as NULL pointer

nconf.gui.o before/after files are the same.
nconf.o before/after files are the same until the 'static' function
declarations are added.
Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 2f263d14
...@@ -271,7 +271,7 @@ static struct mitem k_menu_items[MAX_MENU_ITEMS]; ...@@ -271,7 +271,7 @@ static struct mitem k_menu_items[MAX_MENU_ITEMS];
static int items_num; static int items_num;
static int global_exit; static int global_exit;
/* the currently selected button */ /* the currently selected button */
const char *current_instructions = menu_instructions; static const char *current_instructions = menu_instructions;
static char *dialog_input_result; static char *dialog_input_result;
static int dialog_input_result_len; static int dialog_input_result_len;
...@@ -305,7 +305,7 @@ struct function_keys { ...@@ -305,7 +305,7 @@ struct function_keys {
}; };
static const int function_keys_num = 9; static const int function_keys_num = 9;
struct function_keys function_keys[] = { static struct function_keys function_keys[] = {
{ {
.key_str = "F1", .key_str = "F1",
.func = "Help", .func = "Help",
...@@ -508,7 +508,7 @@ static int get_mext_match(const char *match_str, match_f flag) ...@@ -508,7 +508,7 @@ static int get_mext_match(const char *match_str, match_f flag)
index = (index + items_num) % items_num; index = (index + items_num) % items_num;
while (true) { while (true) {
char *str = k_menu_items[index].str; char *str = k_menu_items[index].str;
if (strcasestr(str, match_str) != 0) if (strcasestr(str, match_str) != NULL)
return index; return index;
if (flag == FIND_NEXT_MATCH_UP || if (flag == FIND_NEXT_MATCH_UP ||
flag == MATCH_TINKER_PATTERN_UP) flag == MATCH_TINKER_PATTERN_UP)
...@@ -1067,7 +1067,7 @@ static int do_match(int key, struct match_state *state, int *ans) ...@@ -1067,7 +1067,7 @@ static int do_match(int key, struct match_state *state, int *ans)
static void conf(struct menu *menu) static void conf(struct menu *menu)
{ {
struct menu *submenu = 0; struct menu *submenu = NULL;
const char *prompt = menu_get_prompt(menu); const char *prompt = menu_get_prompt(menu);
struct symbol *sym; struct symbol *sym;
int res; int res;
...@@ -1234,7 +1234,7 @@ static void show_help(struct menu *menu) ...@@ -1234,7 +1234,7 @@ static void show_help(struct menu *menu)
static void conf_choice(struct menu *menu) static void conf_choice(struct menu *menu)
{ {
const char *prompt = _(menu_get_prompt(menu)); const char *prompt = _(menu_get_prompt(menu));
struct menu *child = 0; struct menu *child = NULL;
struct symbol *active; struct symbol *active;
int selected_index = 0; int selected_index = 0;
int last_top_row = 0; int last_top_row = 0;
...@@ -1456,7 +1456,7 @@ static void conf_save(void) ...@@ -1456,7 +1456,7 @@ static void conf_save(void)
} }
} }
void setup_windows(void) static void setup_windows(void)
{ {
int lines, columns; int lines, columns;
......
...@@ -129,7 +129,7 @@ static void no_colors_theme(void) ...@@ -129,7 +129,7 @@ static void no_colors_theme(void)
mkattrn(FUNCTION_TEXT, A_REVERSE); mkattrn(FUNCTION_TEXT, A_REVERSE);
} }
void set_colors() void set_colors(void)
{ {
start_color(); start_color();
use_default_colors(); use_default_colors();
...@@ -192,7 +192,7 @@ const char *get_line(const char *text, int line_no) ...@@ -192,7 +192,7 @@ const char *get_line(const char *text, int line_no)
int lines = 0; int lines = 0;
if (!text) if (!text)
return 0; return NULL;
for (i = 0; text[i] != '\0' && lines < line_no; i++) for (i = 0; text[i] != '\0' && lines < line_no; i++)
if (text[i] == '\n') if (text[i] == '\n')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment