[ofw] [PATCH] use C99 standard type 'uintptr_t' instead of non-standard complib type 'uintn_t'

Smith, Stan stan.smith at intel.com
Mon Nov 16 17:18:03 PST 2009


Cleanup code by using C99 standard type in preference over complib defined non-standard data type.

Tested by clean building all arches for all Oses; installed, ran dapl tests, uninstalled for
 wlh x64, wlh x86, wnet ia64, win7 x64.

Will do commits on your approval.

Signed-off-by: stan smith <stan.smith at intel.com>

--- a/core/complib/cl_memory.c  Mon Nov 16 16:11:07 2009
+++ b/core/complib/cl_memory.c  Mon Nov 16 16:10:55 2009
@@ -260,7 +260,7 @@
        p_hdr->p_mem = p_mem;

        /* Insert the header structure into our allocation list. */
-       cl_qmap_insert( &gp_mem_tracker->alloc_map, (uintn_t)p_mem, &p_hdr->map_item );
+       cl_qmap_insert( &gp_mem_tracker->alloc_map, (uintptr_t)p_mem, &p_hdr->map_item );
        cl_spinlock_release( &gp_mem_tracker->lock );

        return( p_mem );
@@ -327,7 +327,7 @@
                 * To the user's data and returns the pointer to header referencing the
                 * allocated memory block.
                 */
-               p_map_item = cl_qmap_get( &gp_mem_tracker->alloc_map, (uintn_t)p_memory );
+               p_map_item = cl_qmap_get( &gp_mem_tracker->alloc_map, (uintptr_t)p_memory );
                if( p_map_item != cl_qmap_end( &gp_mem_tracker->alloc_map ) )
                {
                        /* Get the pointer to the header. */


--- a/core/complib/cl_pool.c    Mon Nov 16 14:06:51 2009
+++ b/core/complib/cl_pool.c    Mon Nov 16 13:43:44 2009
@@ -129,7 +129,7 @@
                 * 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;


--- a/inc/complib/cl_types.h    Mon Nov 16 14:08:11 2009
+++ b/inc/complib/cl_types.h    Fri Nov 13 10:38:38 2009
@@ -61,7 +61,7 @@
 *      The offsetof macro returns the offset of a member within a structure.
 *
 * SYNOPSIS
-*      uintn_t
+*      uintptr_t
 *      offsetof(
 *              IN TYPE,
 *              IN MEMBER );
@@ -82,7 +82,7 @@
 *      PARENT_STRUCT
 *********/
 #ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((uintn_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((uintptr_t) &((TYPE *)0)->MEMBER)
 #endif





More information about the ofw mailing list