Eliminate unsigned8, unsigned16, unsigned32. Use size_t, ptrdiff_t, intptr_t for 64bit compliance.

This commit is contained in:
Ralf Corsepius
2007-12-07 02:42:58 +00:00
parent 545ae5ba03
commit 4616790a31
5 changed files with 20 additions and 17 deletions
+5 -3
View File
@@ -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
);
+8 -5
View File
@@ -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
+3 -3
View File
@@ -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;
+4 -2
View File
@@ -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
);
/*
-4
View File
@@ -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