summaryrefslogtreecommitdiff
path: root/src/cgtop
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-08-30 09:52:03 +0200
committerJan Janssen <medhefgo@web.de>2022-08-30 12:03:33 +0200
commitf996072fe05358ac24460dff1dc12dd804bf210d (patch)
tree4f459f4caaec458b8b2007c4f487571977a8cb07 /src/cgtop
parent5570a09702b2a4c77772617d5fce97b6b70ec03f (diff)
downloadsystemd-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.c6
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));