From db41bb6784c6f7da698eda25c969082143e65b43 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 3 Oct 2008 22:27:01 +0000 Subject: 2008-10-03 Joel Sherrill * libcsupport/src/printk.c: Addresses can be larger than integers so use long for %p formats. * score/inline/rtems/score/address.inl: Offsets can be positive or negative, so use int32_t. Also do math with intptr_t since there are cases where the number of bits in an address do not equal the number of bits in an integer. * score/inline/rtems/score/heap.inl: Offsets can be positive or negative, so use int32_t. --- cpukit/score/inline/rtems/score/address.inl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cpukit/score/inline/rtems/score/address.inl') diff --git a/cpukit/score/inline/rtems/score/address.inl b/cpukit/score/inline/rtems/score/address.inl index 3394a52388..fb44781e6d 100644 --- a/cpukit/score/inline/rtems/score/address.inl +++ b/cpukit/score/inline/rtems/score/address.inl @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -39,12 +39,13 @@ * * @return This method returns the resulting address. */ +#include RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( void *base, - uint32_t offset + int32_t offset ) { - return (void *)((char *)base + offset); + return (void *)((intptr_t)base + offset); } /** @brief Subtract Offset from Offset @@ -61,10 +62,10 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset ( void *base, - uint32_t offset + int32_t offset ) { - return (void *)((char *)base - offset); + return (void *)((intptr_t)base - offset); } /** @brief Subtract Two Offsets -- cgit v1.2.3