diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2011-10-20 11:58:54 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2011-10-20 11:58:54 +0000 |
commit | 050adc2712d2b78697fed19d0312f94971402cd0 (patch) | |
tree | 4961ac2b48650e5b126c0c5a6371ea6cd86e6e78 /cpukit/score | |
parent | 2011-10-20 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-050adc2712d2b78697fed19d0312f94971402cd0.tar.bz2 |
2011-10-20 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/score/rbtree.h (_RBTree_Container_of):
Use offsetof. Don't cast to size_t. Include <stddef.h>.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/rbtree.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h index d2cea57208..1c7953ffad 100644 --- a/cpukit/score/include/rtems/score/rbtree.h +++ b/cpukit/score/include/rtems/score/rbtree.h @@ -18,6 +18,8 @@ #ifndef _RTEMS_SCORE_RBTREE_H #define _RTEMS_SCORE_RBTREE_H +#include <stddef.h> + /** * @defgroup ScoreRBTree Red-Black Tree Handler * @@ -88,8 +90,7 @@ struct RBTree_Node_struct { * */ #define _RBTree_Container_of(node,container_type, node_field_name) \ -((container_type*) \ - ((size_t)node - ((size_t)(&((container_type *)0)->node_field_name)))) + ((container_type*) (node - offsetof(container_type,node_field_name))) /** * This type indicates the direction. |