[ofw] [PATCH] complib: replace intn_t types by C99 intptr_t

Sasha Khapyorsky sashak at voltaire.com
Fri Nov 13 08:06:26 PST 2009


Use C99 standard pointer size integer types intptr_t and uintptr_t
instead of privately defined intn_t and uintn_t.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/complib/cl_pool.c              |    2 +-
 opensm/include/complib/cl_types.h     |   12 ++----------
 opensm/include/complib/cl_types_osd.h |    5 +----
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/opensm/complib/cl_pool.c b/opensm/complib/cl_pool.c
index 1f66284..5a8d637 100644
--- a/opensm/complib/cl_pool.c
+++ b/opensm/complib/cl_pool.c
@@ -128,7 +128,7 @@ cl_status_t cl_qcpool_init(IN cl_qcpool_t * const p_pool,
 		 * are aligned on a natural boundary.
 		 */
 		p_pool->component_sizes[i] =
-		    ROUNDUP(p_pool->component_sizes[i], sizeof(uintn_t));
+		    ROUNDUP(p_pool->component_sizes[i], sizeof(uintptr_t));
 	}
 
 	p_pool->max_objects = max_size ? max_size : ~(size_t) 0;
diff --git a/opensm/include/complib/cl_types.h b/opensm/include/complib/cl_types.h
index 84f629d..2891c6b 100644
--- a/opensm/include/complib/cl_types.h
+++ b/opensm/include/complib/cl_types.h
@@ -89,7 +89,7 @@ typedef uint64_t net64_t;
 *	The offsetof macro returns the offset of a member within a structure.
 *
 * SYNOPSIS
-*	uintn_t
+*	uintptr_t
 *	offsetof(
 *		IN TYPE,
 *		IN MEMBER );
@@ -110,7 +110,7 @@ typedef uint64_t net64_t;
 *	PARENT_STRUCT
 *********/
 #ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((uintn_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((uintptr_t) &((TYPE *)0)->MEMBER)
 #endif
 
 /****d* Component Library: Pointer Manipulation/PARENT_STRUCT
@@ -245,14 +245,6 @@ typedef uint64_t net64_t;
 *	net64_t
 *		64-bit network byte order value.
 *
-*	intn_t
-*		Signed natural sized integer.  32-bit on a 32-bit platform, 64-bit on
-*		a 64-bit platform.
-*
-*	uintn_t
-*		Unsigned natural sized integer.  32-bit on a 32-bit platform, 64-bit on
-*		a 64-bit platform.
-*
 *	boolean_t
 *		integral sized.  Set to TRUE or FALSE and used in logical expressions.
 *
diff --git a/opensm/include/complib/cl_types_osd.h b/opensm/include/complib/cl_types_osd.h
index d12aa4c..7c6e51d 100644
--- a/opensm/include/complib/cl_types_osd.h
+++ b/opensm/include/complib/cl_types_osd.h
@@ -37,8 +37,7 @@
  * Abstract:
  *	Defines sized datatypes for Linux User mode
  *  exported sizes are int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t
- *  int64_t, uint64_t. uintn_t is a polymorphic type, size is native size and
- *  also size of the pointer.
+ *  int64_t, uint64_t.
  */
 
 #ifndef _CL_TYPES_OSD_H_
@@ -73,8 +72,6 @@ BEGIN_C_DECLS
 /*
  * Types not explicitly defined are native to the platform.
  */
-typedef unsigned long uintn_t;
-typedef long intn_t;
 typedef int boolean_t;
 typedef volatile int32_t atomic32_t;
 
-- 
1.6.5.2




More information about the ofw mailing list