summaryrefslogtreecommitdiffstats
path: root/cpukit
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
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')
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/score/include/rtems/score/rbtree.h7
2 files changed, 11 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 1c575a1a58..6489ea5b17 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,11 @@
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.
+
+2011-11-26 Gedare Bloom <gedare@rtems.org>
+
PR 1964
* score/inline/rtems/score/chain.inl: Fix chain is first and last.
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.