mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-23 03:14:48 +08:00
Eliminate unsigned8, unsigned16, unsigned32. Use size_t, ptrdiff_t, intptr_t for 64bit compliance.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#ifndef __ADDRESSES_h
|
||||
#define __ADDRESSES_h
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*
|
||||
* _Addresses_Add_offset
|
||||
*
|
||||
@@ -25,7 +27,7 @@
|
||||
|
||||
STATIC INLINE void *_Addresses_Add_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
size_t offset
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -40,7 +42,7 @@ STATIC INLINE void *_Addresses_Add_offset (
|
||||
|
||||
STATIC INLINE void *_Addresses_Subtract_offset(
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
size_t offset
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -67,7 +69,7 @@ STATIC INLINE void *_Addresses_Add (
|
||||
* resulting offset.
|
||||
*/
|
||||
|
||||
STATIC INLINE unsigned32 _Addresses_Subtract (
|
||||
STATIC INLINE ptrdiff_t _Addresses_Subtract (
|
||||
void *left,
|
||||
void *right
|
||||
);
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#ifndef __INLINE_ADDRESSES_inl
|
||||
#define __INLINE_ADDRESSES_inl
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _Addresses_Add_offset
|
||||
@@ -21,7 +24,7 @@
|
||||
|
||||
STATIC INLINE void *_Addresses_Add_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
size_t offset
|
||||
)
|
||||
{
|
||||
return (base + offset);
|
||||
@@ -35,7 +38,7 @@ STATIC INLINE void *_Addresses_Add_offset (
|
||||
|
||||
STATIC INLINE void *_Addresses_Subtract_offset (
|
||||
void *base,
|
||||
unsigned32 offset
|
||||
size_t offset
|
||||
)
|
||||
{
|
||||
return (base - offset);
|
||||
@@ -54,7 +57,7 @@ STATIC INLINE void *_Addresses_Add (
|
||||
void *right
|
||||
)
|
||||
{
|
||||
return (left + (unsigned32)right);
|
||||
return (left + (ptrdiff_t) right);
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
@@ -65,7 +68,7 @@ STATIC INLINE void *_Addresses_Add (
|
||||
* dependent on an addresses being thirty two bits.
|
||||
*/
|
||||
|
||||
STATIC INLINE unsigned32 _Addresses_Subtract (
|
||||
STATIC INLINE ptrdiff_t _Addresses_Subtract (
|
||||
void *left,
|
||||
void *right
|
||||
)
|
||||
@@ -83,7 +86,7 @@ STATIC INLINE boolean _Addresses_Is_aligned (
|
||||
void *address
|
||||
)
|
||||
{
|
||||
return ( ( (unsigned32)address % 4 ) == 0 );
|
||||
return ( ( (intptr_t)address % 4 ) == 0 );
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
void _Chain_Initialize(
|
||||
Chain_Control *the_chain,
|
||||
void *starting_address,
|
||||
unsigned32 number_nodes,
|
||||
unsigned32 node_size
|
||||
size_t number_nodes,
|
||||
size_t node_size
|
||||
)
|
||||
{
|
||||
unsigned32 count;
|
||||
size_t count;
|
||||
Chain_Node *current;
|
||||
Chain_Node *next;
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef __CHAIN_h
|
||||
#define __CHAIN_h
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "address.h"
|
||||
|
||||
/*
|
||||
@@ -66,8 +68,8 @@ typedef struct {
|
||||
void _Chain_Initialize(
|
||||
Chain_Control *the_chain,
|
||||
void *starting_address,
|
||||
unsigned32 number_nodes,
|
||||
unsigned32 node_size
|
||||
size_t number_nodes,
|
||||
size_t node_size
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
#ifndef __SYSTEM_h
|
||||
#define __SYSTEM_h
|
||||
|
||||
typedef unsigned int unsigned32;
|
||||
typedef unsigned short unsigned16;
|
||||
typedef unsigned char unsigned8;
|
||||
|
||||
#define STATIC static
|
||||
#define INLINE inline
|
||||
|
||||
|
||||
Reference in New Issue
Block a user