]> xenbits.xensource.com Git - libvirt.git/commitdiff
vshReadlineParse: Drop some unused variables
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 27 Jul 2016 15:40:35 +0000 (17:40 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 28 Jul 2016 11:01:54 +0000 (13:01 +0200)
My compiler identified some variables that were set, but never
actually used. For instance, opts_required, and data_acomplete.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/vsh.c

index a7ce1415aba0f65ce52d4b947822150d90808bfc..540c78ca8597e7eb5a2e07626af9a0188378bbae 100644 (file)
@@ -2640,10 +2640,10 @@ vshReadlineParse(const char *text, int state)
     char *res = NULL;
     static char *ctext, *sanitized_text;
     static uint64_t const_opts_need_arg, const_opts_required, const_opts_seen;
-    uint64_t opts_need_arg, opts_required, opts_seen;
+    uint64_t opts_need_arg, opts_seen;
     size_t opt_index;
     static bool cmd_exists, opts_filled, opt_exists;
-    static bool non_bool_opt_exists, data_acomplete;
+    static bool non_bool_opt_exists;
 
     if (!state) {
         parser.pos = rl_line_buffer;
@@ -2687,7 +2687,6 @@ vshReadlineParse(const char *text, int state)
         cmd_exists = false;
         opts_filled = false;
         non_bool_opt_exists = false;
-        data_acomplete = false;
 
         const_opts_need_arg = 0;
         const_opts_required = 0;
@@ -2713,7 +2712,6 @@ vshReadlineParse(const char *text, int state)
                        c_isalnum(tkdata[2])) {
                 /* Command retrieved successfully, move to options */
                 opts_need_arg = const_opts_need_arg;
-                opts_required = const_opts_required;
                 opts_seen = const_opts_seen;
                 optstr = strchr(tkdata + 2, '=');
                 opt_index = 0;
@@ -2749,7 +2747,6 @@ vshReadlineParse(const char *text, int state)
                         tkdata = const_tkdata;
                         if (STREQ(tkdata, sanitized_text)) {
                             /* auto-complete non-bool option */
-                            data_acomplete = true;
                             break;
                         }
                     }