diff options
author | Jan Janssen <medhefgo@web.de> | 2022-08-30 09:52:03 +0200 |
---|---|---|
committer | Jan Janssen <medhefgo@web.de> | 2022-08-30 12:03:33 +0200 |
commit | f996072fe05358ac24460dff1dc12dd804bf210d (patch) | |
tree | 4f459f4caaec458b8b2007c4f487571977a8cb07 /src/cgtop | |
parent | 5570a09702b2a4c77772617d5fce97b6b70ec03f (diff) | |
download | systemd-f996072fe05358ac24460dff1dc12dd804bf210d.tar.gz |
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.
Diffstat (limited to 'src/cgtop')
-rw-r--r-- | src/cgtop/cgtop.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)); |