summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/rbtreeinsert.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-05-24 02:44:58 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-05-24 02:44:58 +0000
commitdacdda304b8a7a2a10bc03ae36b1d75b728ba149 (patch)
treeb709b10d06bb4303fcf2f08511ca096ea2d5a0aa /cpukit/score/src/rbtreeinsert.c
parent2011-05-23 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff)
downloadrtems-dacdda304b8a7a2a10bc03ae36b1d75b728ba149.tar.bz2
Remove white-spaces.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/rbtreeinsert.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c
index b9a7c994d8..8a694063ff 100644
--- a/cpukit/score/src/rbtreeinsert.c
+++ b/cpukit/score/src/rbtreeinsert.c
@@ -19,9 +19,9 @@
/** @brief Validate and fix-up tree properties for a new insert/colored node
*
- * This routine checks and fixes the Red-Black Tree properties based on
+ * This routine checks and fixes the Red-Black Tree properties based on
* @a the_node being just added to the tree.
- *
+ *
* @note It does NOT disable interrupts to ensure the atomicity of the
* append operation.
*/
@@ -37,7 +37,7 @@ void _RBTree_Validate_insert_unprotected(
while (_RBTree_Is_red(_RBTree_Parent(the_node))) {
u = _RBTree_Parent_sibling(the_node);
g = the_node->parent->parent;
-
+
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
the_node->parent->color = RBT_BLACK;
@@ -47,7 +47,7 @@ void _RBTree_Validate_insert_unprotected(
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
-
+
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
@@ -55,7 +55,7 @@ void _RBTree_Validate_insert_unprotected(
}
the_node->parent->color = RBT_BLACK;
g->color = RBT_RED;
-
+
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
}
@@ -71,7 +71,7 @@ void _RBTree_Validate_insert_unprotected(
*
* @retval 0 Successfully inserted.
* @retval -1 NULL @a the_node.
- * @retval RBTree_Node* if one with equal value to @a the_node->value exists
+ * @retval RBTree_Node* if one with equal value to @a the_node->value exists
* in @a the_rbtree.
*
* @note It does NOT disable interrupts to ensure the atomicity
@@ -92,7 +92,7 @@ RBTree_Node *_RBTree_Insert_unprotected(
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
the_node->parent = (RBTree_Node *) the_rbtree;
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
- } else {
+ } else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
if(the_node->value == iter_node->value) return(iter_node);
@@ -112,7 +112,7 @@ RBTree_Node *_RBTree_Insert_unprotected(
}
} /* while(iter_node) */
-
+
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}