xz: list.c: Fix some warnings from -Wsign-conversion.

This commit is contained in:
Lasse Collin 2019-06-24 00:12:38 +03:00
parent d0a78751eb
commit 50120deb01
1 changed files with 4 additions and 3 deletions

View File

@ -292,7 +292,7 @@ init_headings(void)
// Calculate the field width for printf("%*s") so that
// the string uses .columns number of columns on a terminal.
headings[i].fw = (int)(len + headings[i].columns - w);
headings[i].fw = (int)(len + (size_t)headings[i].columns - w);
}
return;
@ -870,9 +870,10 @@ print_info_adv(xz_file_info *xfi, file_pair *pair)
// the actual check value as it is hexadecimal. However, to
// print the column heading, further calculation is needed
// to handle a translated string (it's done a few lines later).
assert(check_max <= LZMA_CHECK_SIZE_MAX);
const int checkval_width = my_max(
(uint32_t)(headings[HEADING_CHECKVAL].columns),
2 * check_max);
headings[HEADING_CHECKVAL].columns,
(int)(2 * check_max));
// All except Check are right aligned; Check is left aligned.
printf(" %s\n %*s %*s %*s %*s %*s %*s %*s %-*s",