From 3f3b773be17ab7a090c837e7cdd89459ca213473 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 18 Jul 2011 08:44:55 +0000 Subject: 2011-07-18 Sebastian Huber * libcsupport/src/malloc_report_statistics_plugin.c: Fixed format specifiers. --- .../src/malloc_report_statistics_plugin.c | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/src/malloc_report_statistics_plugin.c b/cpukit/libcsupport/src/malloc_report_statistics_plugin.c index 637587190a..48fd048123 100644 --- a/cpukit/libcsupport/src/malloc_report_statistics_plugin.c +++ b/cpukit/libcsupport/src/malloc_report_statistics_plugin.c @@ -24,27 +24,27 @@ void malloc_report_statistics_with_plugin( rtems_printk_plugin_t print ) { - rtems_malloc_statistics_t *s; - uintmax_t allocated; - - s = &rtems_malloc_statistics; - - allocated = s->lifetime_allocated - s->lifetime_freed; + rtems_malloc_statistics_t *s = &rtems_malloc_statistics; + uint32_t space_available = s->space_available; + uint32_t allocated = (uint32_t) (s->lifetime_allocated - s->lifetime_freed); + uint32_t max_depth = s->max_depth; + /* avoid float! */ + uint32_t allocated_per_cent = (allocated * 100) / space_available; + uint32_t max_depth_per_cent = (max_depth * 100) / space_available; (*print)( context, "Malloc statistics\n" - " avail:%"PRIu32"k allocated:%"PRIu32"k (%"PRId32"%%) " + " avail:%"PRIu32"k allocated:%"PRIu32"k (%"PRIu32"%%) " "max:%"PRIu32"k (%"PRIu32"%%)" - " lifetime:%"PRIu32"k freed:%"PRIu32"k\n", - s->space_available / 1024, + " lifetime:%"PRIuMAX"k freed:%"PRIuMAX"k\n", + space_available / 1024, allocated / 1024, - /* avoid float! */ - (allocated * 100) / s->space_available, - s->max_depth / 1024, - (s->max_depth * 100) / s->space_available, - (uint32_t) (s->lifetime_allocated / 1024), - (uint32_t) (s->lifetime_freed / 1024) + allocated_per_cent, + max_depth / 1024, + max_depth_per_cent, + s->lifetime_allocated / 1024, + s->lifetime_freed / 1024 ); (*print)( context, -- cgit v1.2.3