From ea9d622c0cb70970d322cd94950b447d4357f5e6 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 4 Nov 2016 09:07:04 +0100 Subject: [PATCH] vshReadlineParse: Remove unused variable 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 --- tools/vsh.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 17199aecb2..f7ba070e67 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -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 */