Ignore:
Timestamp:
Aug 6, 2018, 9:53:42 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
0fc87d47
Parents:
66cb142
git-author:
Sebastian Huber <sebastian.huber@…> (08/06/18 09:53:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/10/18 05:14:43)
Message:

score: Fix _Addresses_Subtract()

Use architecture-specific integer type for an address difference.

Update #3486.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/address.h

    r66cb142 rb2de426  
    7878
    7979/**
    80  * @brief Subtract two offsets.
     80 * @brief Subtract two addresses.
    8181 *
    8282 * This function is used to subtract two addresses.  It returns the
     
    8787 *
    8888 * @return This method returns the resulting address.
    89  *
    90  * @note  The cast of an address to an uint32_t makes this code
    91  *        dependent on an addresses being thirty two bits.
    9289 */
    93 RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
     90RTEMS_INLINE_ROUTINE intptr_t _Addresses_Subtract(
    9491  const void *left,
    9592  const void *right
    9693)
    9794{
    98   return (int32_t) ((const char *) left - (const char *) right);
     95  return (intptr_t) ( (const char *) left - (const char *) right );
    9996}
    10097
Note: See TracChangeset for help on using the changeset viewer.