[rtems commit] score/rbtree: Add const qualifier
Sebastian Huber
sebh at rtems.org
Fri Mar 30 09:39:17 UTC 2012
Module: rtems
Branch: master
Commit: 9fc284cfde0b9a2b44a7c2f2cec32816c687afd8
Changeset: http://git.rtems.org/rtems/commit/?id=9fc284cfde0b9a2b44a7c2f2cec32816c687afd8
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Mar 30 11:35:39 2012 +0200
score/rbtree: Add const qualifier
---
cpukit/sapi/inline/rtems/rbtree.inl | 26 ++++++------
cpukit/score/include/rtems/score/rbtree.h | 2 +-
cpukit/score/inline/rtems/score/rbtree.inl | 60 ++++++++++++++--------------
cpukit/score/src/rbtreepeek.c | 2 +-
4 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/cpukit/sapi/inline/rtems/rbtree.inl b/cpukit/sapi/inline/rtems/rbtree.inl
index 16a6e2a..259a586 100644
--- a/cpukit/sapi/inline/rtems/rbtree.inl
+++ b/cpukit/sapi/inline/rtems/rbtree.inl
@@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_null_node(
* This function returns a pointer to the root node of @a the_rbtree.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_root(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_Root( the_rbtree );
@@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_root(
* This function returns a pointer to the minimum node of @a the_rbtree.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_min(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_First( the_rbtree, RBT_LEFT );
@@ -129,7 +129,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_min(
* This function returns a pointer to the maximum node of @a the_rbtree.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_max(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_First( the_rbtree, RBT_RIGHT );
@@ -141,7 +141,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_max(
* This function returns a pointer to the left child node of @a the_node.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_left(
- rtems_rbtree_node *the_node
+ const rtems_rbtree_node *the_node
)
{
return _RBTree_Left( the_node );
@@ -153,7 +153,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_left(
* This function returns a pointer to the right child node of @a the_node.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_right(
- rtems_rbtree_node *the_node
+ const rtems_rbtree_node *the_node
)
{
return _RBTree_Right( the_node );
@@ -165,7 +165,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_right(
* This function returns a pointer to the parent node of @a the_node.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_parent(
- rtems_rbtree_node *the_node
+ const rtems_rbtree_node *the_node
)
{
return _RBTree_Parent( the_node );
@@ -192,7 +192,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_are_nodes_equal(
* false otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_empty(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_Is_empty( the_rbtree );
@@ -205,7 +205,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_empty(
* and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_min(
- rtems_rbtree_control *the_rbtree,
+ const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
{
@@ -219,7 +219,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_min(
* and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_max(
- rtems_rbtree_control *the_rbtree,
+ const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
{
@@ -247,7 +247,7 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_has_only_one_node(
* false otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_root(
- rtems_rbtree_control *the_rbtree,
+ const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
{
@@ -346,7 +346,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
* It disables interrupts to ensure the atomicity of the peek operation.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_min(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_Peek( the_rbtree, RBT_LEFT );
@@ -361,7 +361,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_min(
* It disables interrupts to ensure the atomicity of the peek operation.
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_max(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return _RBTree_Peek( the_rbtree, RBT_RIGHT );
@@ -404,7 +404,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert(
/** @brief Determines whether the tree is unique
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_unique rtems_rbtree_is_unique(
- rtems_rbtree_control *the_rbtree
+ const rtems_rbtree_control *the_rbtree
)
{
return( _RBTree_Is_unique(the_rbtree) );
diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h
index 7c43965..03e8792 100644
--- a/cpukit/score/include/rtems/score/rbtree.h
+++ b/cpukit/score/include/rtems/score/rbtree.h
@@ -232,7 +232,7 @@ RBTree_Node *_RBTree_Get(
* @note It disables interrupts to ensure the atomicity of the get operation.
*/
RBTree_Node *_RBTree_Peek(
- RBTree_Control *the_rbtree,
+ const RBTree_Control *the_rbtree,
RBTree_Direction dir
);
diff --git a/cpukit/score/inline/rtems/score/rbtree.inl b/cpukit/score/inline/rtems/score/rbtree.inl
index 422924a..2ce0b2b 100644
--- a/cpukit/score/inline/rtems/score/rbtree.inl
+++ b/cpukit/score/inline/rtems/score/rbtree.inl
@@ -107,8 +107,8 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Is_null_node(
* This function returns a pointer to the root node of @a the_rbtree.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Root(
- RBTree_Control *the_rbtree
- )
+ const RBTree_Control *the_rbtree
+)
{
return the_rbtree->root;
}
@@ -119,9 +119,9 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Root(
* where @a dir specifies whether to return the minimum (0) or maximum (1).
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
- RBTree_Control *the_rbtree,
- RBTree_Direction dir
- )
+ const RBTree_Control *the_rbtree,
+ RBTree_Direction dir
+)
{
return the_rbtree->first[dir];
}
@@ -131,8 +131,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
* This function returns a pointer to the parent node of @a the_node.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
if (!the_node->parent->parent) return NULL;
return the_node->parent;
@@ -147,8 +147,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
* @return This method returns the left node on the rbtree.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Left(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
return the_node->child[RBT_LEFT];
}
@@ -162,8 +162,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Left(
* @return This method returns the right node on the rbtree.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Right(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
return the_node->child[RBT_RIGHT];
}
@@ -179,8 +179,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Right(
* @a the_rbtree and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(
- RBTree_Control *the_rbtree
- )
+ const RBTree_Control *the_rbtree
+)
{
return (the_rbtree->root == NULL);
}
@@ -193,10 +193,10 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(
*
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_first(
- RBTree_Control *the_rbtree,
- const RBTree_Node *the_node,
- RBTree_Direction dir
- )
+ const RBTree_Control *the_rbtree,
+ const RBTree_Node *the_node,
+ RBTree_Direction dir
+)
{
return (the_node == _RBTree_First(the_rbtree, dir));
}
@@ -233,9 +233,9 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Has_only_one_node(
* false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_root(
- RBTree_Control *the_rbtree,
- const RBTree_Node *the_node
- )
+ const RBTree_Control *the_rbtree,
+ const RBTree_Node *the_node
+)
{
return (the_node == _RBTree_Root(the_rbtree));
}
@@ -265,8 +265,8 @@ RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(
*
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Grandparent(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
@@ -281,8 +281,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Grandparent(
* exists, and NULL if not.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
@@ -300,8 +300,8 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
* @a the_node if it exists, and NULL if not.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent_sibling(
- RBTree_Node *the_node
- )
+ const RBTree_Node *the_node
+)
{
if(!the_node) return NULL;
if(_RBTree_Grandparent(the_node) == NULL) return NULL;
@@ -446,9 +446,9 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Get_unprotected(
* @retval NULL if @a the_rbtree is empty.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Peek_unprotected(
- RBTree_Control *the_rbtree,
- RBTree_Direction dir
- )
+ const RBTree_Control *the_rbtree,
+ RBTree_Direction dir
+)
{
return(the_rbtree->first[dir]);
}
@@ -484,7 +484,7 @@ RTEMS_INLINE_ROUTINE void _RBTree_Rotate(
/** @brief Determines whether the tree is unique
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_unique(
- RBTree_Control *the_rbtree
+ const RBTree_Control *the_rbtree
)
{
return( the_rbtree && the_rbtree->is_unique );
diff --git a/cpukit/score/src/rbtreepeek.c b/cpukit/score/src/rbtreepeek.c
index 74a3409..13ea333 100644
--- a/cpukit/score/src/rbtreepeek.c
+++ b/cpukit/score/src/rbtreepeek.c
@@ -36,7 +36,7 @@
*/
RBTree_Node *_RBTree_Peek(
- RBTree_Control *the_rbtree,
+ const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
More information about the vc
mailing list