]> xenbits.xensource.com Git - libvirt.git/commitdiff
vshReadlineParse: Remove unused variable
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Nov 2016 08:07:04 +0000 (09:07 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Nov 2016 09:20:58 +0000 (10:20 +0100)
After 06a7b1ff4 the @&opts_need_arg is not used anywhere. Well,
it is set but never read:

vsh.c: In function 'vshReadlineParse':
vsh.c:2658:14: warning: variable 'opts_need_arg' set but not used [-Wunused-but-set-variable]
     uint64_t opts_need_arg, opts_seen;
              ^~~~~~~~~~~~~

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

index 17199aecb2bfa150f37770e6138c793dbed9823c..f7ba070e673ee1f63bff9b9ab2558e9dfb7f90d6 100644 (file)
@@ -2655,7 +2655,7 @@ vshReadlineParse(const char *text, int state)
     static char **completed_list;
     static unsigned int completed_list_index;
     static uint64_t const_opts_need_arg, const_opts_required, const_opts_seen;
-    uint64_t opts_need_arg, opts_seen;
+    uint64_t opts_seen;
     size_t opt_index;
     static bool cmd_exists, opts_filled, opt_exists;
     static bool non_bool_opt_exists, data_complete;
@@ -2728,7 +2728,6 @@ vshReadlineParse(const char *text, int state)
                 if (vshCmddefOptParse(cmd, &const_opts_need_arg,
                                       &const_opts_required) < 0)
                     goto error;
-                opts_need_arg = const_opts_need_arg;
                 opts_seen = const_opts_seen;
                 opts_filled = true;
             } else if (tkdata[0] == '-' && tkdata[1] == '-' &&
@@ -2793,7 +2792,6 @@ vshReadlineParse(const char *text, int state)
                     || opt->type == VSH_OT_BOOL)
                     goto error;
                 opt_exists = true;
-                opts_need_arg = const_opts_need_arg;
                 opts_seen = const_opts_seen;
             } else {
                 /* In every other case, return NULL */