From a6548e4fb34d50fbd49d0878618c3aecefabe79b Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Mon, 10 Nov 2014 18:00:46 +0100 Subject: Fix warnings: message.c: vim_vsnprintf(): Dead assignment (2): HI. Problem : Dead assignment @ 3323. Dead assignment @ 3587. Diagnostic : Harmless issues. Rationale : - 3323: Assignment is in fact dead. But, in addition to that, `length_modifier` is assigned default value `\0` when declared and is untouched in path leading to signaled point. So, maintaining assignment adds nothing to code. - 3587: Assignment is in fact dead. It could be thought that `precision_specified` has to be 1 in order to flag `precision` as having a valid value. But that doesn't seem to be the case, as there are places in the code where `precision` gets assigned a default value, even if `precision_specified` is 0. So, maintaining assignment adds nothing to code. Resolution : Remove dead assignments. --- src/nvim/message.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index 0e287268eb..ee83fd371e 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -3323,7 +3323,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs) case 'c': case 's': case 'S': - length_modifier = '\0'; str_arg_l = 1; switch (fmt_spec) { case '%': @@ -3587,7 +3586,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs) * zero value is formatted with an * explicit precision of zero */ precision = num_of_digits + 1; - precision_specified = 1; } } /* zero padding to specified precision? */ -- cgit