Remove dead stores detected by static analysis

None of these are harmful, and they are almost certainly optimized
away by the compiler. The motivation for fixing them anyway is that
we'd like to enable static analysis as part of CI, and the first step
towards that is resolving the warnings it produces at present.
This commit is contained in:
Kevin Svetlitski
2023-04-26 14:10:41 -07:00
committed by Qi Wang
parent 0288126d9c
commit 3e2ba7a651
6 changed files with 7 additions and 13 deletions

View File

@@ -423,7 +423,6 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
unsigned char len = '?';
char *s;
size_t slen;
bool first_width_digit = true;
bool pad_zero = false;
f++;
@@ -462,9 +461,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
}
break;
case '0':
if (first_width_digit) {
pad_zero = true;
}
pad_zero = true;
JEMALLOC_FALLTHROUGH;
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': {
@@ -474,7 +471,6 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
assert(uwidth != UINTMAX_MAX || get_errno() !=
ERANGE);
width = (int)uwidth;
first_width_digit = false;
break;
} default:
break;