[rtems commit] heap: Fix integer types
Sebastian Huber
sebh at rtems.org
Tue Aug 22 14:51:24 UTC 2017
Module: rtems
Branch: master
Commit: 93934f886f919d5e6fcc33cf2fab2f36cd9e3d66
Changeset: http://git.rtems.org/rtems/commit/?id=93934f886f919d5e6fcc33cf2fab2f36cd9e3d66
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Aug 22 14:18:09 2017 +0200
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 9afa4e2..c37fae0 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 719f711..45cb8e8 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 f2a0fb7..60cb3be 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;
/**
More information about the vc
mailing list