diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-06 11:53:42 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-10 07:14:43 +0200 |
commit | b2de4260c5c71e518742731a8cdebe3411937181 (patch) | |
tree | f61b88bcb073b9787b25f280b3eac2b3408a8448 /cpukit/include/rtems/score/address.h | |
parent | rtems: Parameter types in rtems_partition_create() (diff) | |
download | rtems-b2de4260c5c71e518742731a8cdebe3411937181.tar.bz2 |
score: Fix _Addresses_Subtract()
Use architecture-specific integer type for an address difference.
Update #3486.
Diffstat (limited to 'cpukit/include/rtems/score/address.h')
-rw-r--r-- | cpukit/include/rtems/score/address.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cpukit/include/rtems/score/address.h b/cpukit/include/rtems/score/address.h index 8f38f7c2dc..fb88230d18 100644 --- a/cpukit/include/rtems/score/address.h +++ b/cpukit/include/rtems/score/address.h @@ -77,7 +77,7 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset ( } /** - * @brief Subtract two offsets. + * @brief Subtract two addresses. * * This function is used to subtract two addresses. It returns the * resulting offset. @@ -86,16 +86,13 @@ RTEMS_INLINE_ROUTINE void *_Addresses_Subtract_offset ( * @param[in] right is the address on the right hand side of the subtraction. * * @return This method returns the resulting address. - * - * @note The cast of an address to an uint32_t makes this code - * dependent on an addresses being thirty two bits. */ -RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( +RTEMS_INLINE_ROUTINE intptr_t _Addresses_Subtract( const void *left, const void *right ) { - return (int32_t) ((const char *) left - (const char *) right); + return (intptr_t) ( (const char *) left - (const char *) right ); } /** |