summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/rbtree.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 11:38:23 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 16:16:58 +0200
commit61340d1723eb7c6a3b2c0028f899b18408c4de53 (patch)
tree272eeb7c355f7ea0b178366f52a436e55a67ef84 /cpukit/score/include/rtems/score/rbtree.h
parentscore: Delete unused _Objects_Get_local_object() (diff)
downloadrtems-61340d1723eb7c6a3b2c0028f899b18408c4de53.tar.bz2
score: Add const to _RBTree_Find_inline()
Diffstat (limited to 'cpukit/score/include/rtems/score/rbtree.h')
-rw-r--r--cpukit/score/include/rtems/score/rbtree.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h
index 18334838ca..dd56f1bca4 100644
--- a/cpukit/score/include/rtems/score/rbtree.h
+++ b/cpukit/score/include/rtems/score/rbtree.h
@@ -307,6 +307,16 @@ RTEMS_INLINE_ROUTINE RBTree_Node **_RBTree_Root_reference(
}
/**
+ * @brief Returns a constant reference to the root pointer of the red-black tree.
+ */
+RTEMS_INLINE_ROUTINE RBTree_Node * const *_RBTree_Root_const_reference(
+ const RBTree_Control *the_rbtree
+)
+{
+ return &RB_ROOT( the_rbtree );
+}
+
+/**
* @brief Returns a pointer to the parent of this node.
*
* The node must have a parent, thus it is invalid to use this function for the
@@ -542,17 +552,17 @@ RTEMS_INLINE_ROUTINE void _RBTree_Insert_inline(
* @retval NULL No object with the specified key exists in the red-black tree.
*/
RTEMS_INLINE_ROUTINE void *_RBTree_Find_inline(
- RBTree_Control *the_rbtree,
- const void *key,
- bool ( *equal )( const void *, const RBTree_Node * ),
- bool ( *less )( const void *, const RBTree_Node * ),
- void *( *map )( RBTree_Node * )
+ const RBTree_Control *the_rbtree,
+ const void *key,
+ bool ( *equal )( const void *, const RBTree_Node * ),
+ bool ( *less )( const void *, const RBTree_Node * ),
+ void *( *map )( RBTree_Node * )
)
{
- RBTree_Node **link;
- RBTree_Node *parent;
+ RBTree_Node * const *link;
+ RBTree_Node *parent;
- link = _RBTree_Root_reference( the_rbtree );
+ link = _RBTree_Root_const_reference( the_rbtree );
parent = NULL;
while ( *link != NULL ) {