mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
5bf6639e0f
commit
a6548e4fb3
@ -3323,7 +3323,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs)
|
|||||||
case 'c':
|
case 'c':
|
||||||
case 's':
|
case 's':
|
||||||
case 'S':
|
case 'S':
|
||||||
length_modifier = '\0';
|
|
||||||
str_arg_l = 1;
|
str_arg_l = 1;
|
||||||
switch (fmt_spec) {
|
switch (fmt_spec) {
|
||||||
case '%':
|
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
|
* zero value is formatted with an
|
||||||
* explicit precision of zero */
|
* explicit precision of zero */
|
||||||
precision = num_of_digits + 1;
|
precision = num_of_digits + 1;
|
||||||
precision_specified = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* zero padding to specified precision? */
|
/* zero padding to specified precision? */
|
||||||
|
Loading…
Reference in New Issue
Block a user