get rid of several "variable 'x' set but not used" warnings
authorCristian Ionescu-Idbohrn <cii@axis.com>
Sun, 1 May 2011 12:43:53 +0000 (14:43 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 May 2011 12:43:53 +0000 (14:43 +0200)
Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
.gitignore
scripts/kconfig/conf.c
scripts/kconfig/lxdialog/textbox.c

index 7d2cca67c5b0f2d2ecac3d932b174d9e00e8c130..0a0c65bc3e0df675a814d10a2693ab540ef1759d 100644 (file)
@@ -18,6 +18,7 @@ Config.in
 # Normal output
 #
 /busybox
+/busybox_old
 /busybox_unstripped*
 
 #
index 6e097889fd68e9bbae32595e66e3cac0b4688f4f..ea2446a89814d8187609aa0f5948ef0811cc755e 100644 (file)
@@ -173,7 +173,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
 int conf_string(struct menu *menu)
 {
        struct symbol *sym = menu->sym;
-       const char *def, *help;
+       const char *def;
 
        while (1) {
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -188,10 +188,7 @@ int conf_string(struct menu *menu)
                case '?':
                        /* print help */
                        if (line[1] == '\n') {
-                               help = nohelp_text;
-                               if (menu->sym->help)
-                                       help = menu->sym->help;
-                               printf("\n%s\n", menu->sym->help);
+                               printf("\n%s\n", menu->sym->help ? menu->sym->help : nohelp_text);
                                def = NULL;
                                break;
                        }
@@ -207,7 +204,6 @@ int conf_string(struct menu *menu)
 static int conf_sym(struct menu *menu)
 {
        struct symbol *sym = menu->sym;
-       int type;
        tristate oldval, newval;
        const char *help;
 
@@ -215,7 +211,6 @@ static int conf_sym(struct menu *menu)
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
                if (sym->name)
                        printf("(%s) ", sym->name);
-               type = sym_get_type(sym);
                putchar('[');
                oldval = sym_get_tristate_value(sym);
                switch (oldval) {
@@ -282,11 +277,9 @@ static int conf_choice(struct menu *menu)
 {
        struct symbol *sym, *def_sym;
        struct menu *child;
-       int type;
        bool is_new;
 
        sym = menu->sym;
-       type = sym_get_type(sym);
        is_new = !sym_has_value(sym);
        if (sym_is_changable(sym)) {
                conf_sym(menu);
index 77848bb8e07f8795fbffeebee7980a0ee1adc269..de4ae41d7b7cd013d259c1a6e99b7bd1eeca1c68 100644 (file)
@@ -38,11 +38,8 @@ int dialog_textbox(const char *title, const char *file, int height, int width)
 {
        int i, x, y, cur_x, cur_y, fpos, key = 0;
        int passed_end;
-       char search_term[MAX_LEN + 1];
        WINDOW *dialog, *text;
 
-       search_term[0] = '\0';  /* no search term entered yet */
-
        /* Open input file for reading */
        if ((fd = open(file, O_RDONLY)) == -1) {
                endwin();
@@ -437,7 +434,6 @@ static void print_page(WINDOW * win, int height, int width)
  */
 static void print_line(WINDOW * win, int row, int width)
 {
-       int y, x;
        char *line;
 
        line = get_line();
@@ -446,11 +442,13 @@ static void print_line(WINDOW * win, int row, int width)
        waddch(win, ' ');
        waddnstr(win, line, MIN(strlen(line), width - 2));
 
-       getyx(win, y, x);
        /* Clear 'residue' of previous line */
 #if OLD_NCURSES
        {
                int i;
+               int y, x;
+
+               getyx(win, y, x);
                for (i = 0; i < width - x; i++)
                        waddch(win, ' ');
        }