From 93934f886f919d5e6fcc33cf2fab2f36cd9e3d66 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 22 Aug 2017 14:18:09 +0200 Subject: heap: Fix integer types Update #3082. --- cpukit/libmisc/cpuuse/cpuusagetop.c | 8 ++++---- cpukit/libmisc/shell/print_heapinfo.c | 6 +++--- cpukit/score/include/rtems/score/heap.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cpukit/libmisc/cpuuse/cpuusagetop.c b/cpukit/libmisc/cpuuse/cpuusagetop.c index 9afa4e292d..c37fae0c56 100644 --- a/cpukit/libmisc/cpuuse/cpuusagetop.c +++ b/cpukit/libmisc/cpuuse/cpuusagetop.c @@ -106,14 +106,14 @@ static inline bool less_than_uint32_t( uint32_t * lhs, uint32_t * rhs ) #define CPU_usage_Less_than( _lhs, _rhs ) _Timestamp_Less_than( _lhs, _rhs ) static void -print_memsize(rtems_cpu_usage_data* data, const uint32_t size, const char* label) +print_memsize(rtems_cpu_usage_data* data, const uintptr_t size, const char* label) { if (size > (1024 * 1024)) - rtems_printf(data->printer, "%4" PRIu32 "M %s", size / (1024 * 1024), label); + rtems_printf(data->printer, "%4" PRIuPTR "M %s", size / (1024 * 1024), label); else if (size > 1024) - rtems_printf(data->printer, "%4" PRIu32 "K %s", size / 1024, label); + rtems_printf(data->printer, "%4" PRIuPTR "K %s", size / 1024, label); else - rtems_printf(data->printer, "%4" PRIu32 " %s", size, label); + rtems_printf(data->printer, "%4" PRIuPTR " %s", size, label); } static int diff --git a/cpukit/libmisc/shell/print_heapinfo.c b/cpukit/libmisc/shell/print_heapinfo.c index 719f7116c3..45cb8e8238 100644 --- a/cpukit/libmisc/shell/print_heapinfo.c +++ b/cpukit/libmisc/shell/print_heapinfo.c @@ -24,9 +24,9 @@ void rtems_shell_print_heap_info( ) { printf( - "Number of %s blocks: %12" PRIu32 "\n" - "Largest %s block: %12" PRIu32 "\n" - "Total bytes %s: %12" PRIu32 "\n", + "Number of %s blocks: %12" PRIuPTR "\n" + "Largest %s block: %12" PRIuPTR "\n" + "Total bytes %s: %12" PRIuPTR "\n", c, h->number, c, h->largest, c, h->total diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index f2a0fb73d7..60cb3be99d 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -360,17 +360,17 @@ typedef struct { /** * @brief Number of blocks of this type. */ - uint32_t number; + uintptr_t number; /** * @brief Largest block of this type. */ - uint32_t largest; + uintptr_t largest; /** * @brief Total size of the blocks of this type. */ - uint32_t total; + uintptr_t total; } Heap_Information; /** -- cgit v1.2.3