From f996072fe05358ac24460dff1dc12dd804bf210d Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 30 Aug 2022 09:52:03 +0200 Subject: tree-wide: Fix field width specifier warnings The casting here isn't pretty, but at least it makes it obvious what is happening instead of implicit and it allows enabling -Wformat-signedness. --- src/cgtop/cgtop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cgtop') diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 46f4624048..95c3987525 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -631,7 +631,7 @@ static void display(Hashmap *a) { if (on_tty()) { const char *on, *off; - unsigned cpu_len = arg_cpu_type == CPU_PERCENT ? 6 : maxtcpu; + int cpu_len = arg_cpu_type == CPU_PERCENT ? 6 : maxtcpu; path_columns = columns() - 36 - cpu_len; if (path_columns < 10) @@ -685,7 +685,9 @@ static void display(Hashmap *a) { else fputs(" -", stdout); } else - printf(" %*s", maxtcpu, MAYBE_FORMAT_TIMESPAN((usec_t) (g->cpu_usage / NSEC_PER_USEC), 0)); + printf(" %*s", + (int) maxtcpu, + MAYBE_FORMAT_TIMESPAN((usec_t) (g->cpu_usage / NSEC_PER_USEC), 0)); printf(" %8s", MAYBE_FORMAT_BYTES(g->memory_valid, g->memory)); printf(" %8s", MAYBE_FORMAT_BYTES(g->io_valid, g->io_input_bps)); -- cgit v1.2.1