summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2011-11-26 18:15:39 +0000
committerGedare Bloom <gedare@rtems.org>2011-11-26 18:15:39 +0000
commitb4959ec32751c2d4259dd05a143e7c6c816c1021 (patch)
treef8518d341000eb0cb7800b718e3d6c3b412349b4 /cpukit/score
parent2011-11-26 Gedare Bloom <gedare@rtems.org> (diff)
downloadrtems-b4959ec32751c2d4259dd05a143e7c6c816c1021.tar.bz2
2011-11-26 Gedare Bloom <gedare@rtems.org>
PR 1963 * score/include/rtems/score/rbtree.h: Fix _RBTree_Container_of macro to use correct arithmetic.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/rbtree.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h
index 1c7953ffad..f0e3b4b5c0 100644
--- a/cpukit/score/include/rtems/score/rbtree.h
+++ b/cpukit/score/include/rtems/score/rbtree.h
@@ -89,8 +89,11 @@ struct RBTree_Node_struct {
* field name of the RBTree_Node structure in @a container_type.
*
*/
-#define _RBTree_Container_of(node,container_type, node_field_name) \
- ((container_type*) (node - offsetof(container_type,node_field_name)))
+#define _RBTree_Container_of(node, container_type, node_field_name) \
+( \
+ (container_type*) \
+ ( (uintptr_t)(node) - offsetof(container_type, node_field_name) ) \
+)
/**
* This type indicates the direction.