Lines Matching refs:right

89  * @n does not have any right children, this returns @n.
97 while (n->right)
98 n = n->right;
119 if (n->right)
120 return c_rbnode_leftmost(n->right);
122 while ((p = c_rbnode_parent(n)) && n == p->right)
223 p->right = new;
264 u = g->right;
279 if (n == p->right) {
281 * We're the right child. Rotate on parent to
285 p->right = n->left;
303 x = p->right;
305 p->right = g;
324 x = n->right;
325 p->left = n->right;
326 n->right = p;
336 g->right = x;
361 * @l: left/right slot of @p (or root) to link at
380 * i = &(*i)->right;
396 * i = (*i)->right;
412 assert(!p || l == &p->left || l == &p->right);
416 n->left = n->right = NULL;
435 s = p->right;
443 p->right = x;
452 x = s->right;
471 * Left child of our sibling is red, right one is black.
472 * Rotate on parent so the right child of our sibling is
474 x = y->right;
475 s->left = y->right;
476 y->right = s;
477 p->right = y;
485 * The right child of our sibling is red. Rotate left and flip
490 p->right = y;
498 } else /* if (!n || n == p->right) */ { /* same as above, but mirrored */
502 x = s->right;
504 s->right = p;
514 y = s->right;
525 s->right = y->left;
535 y = s->right;
537 s->right = p;
609 * The node has no left child. If it neither has a right child,
613 * But if the node has a right child, the child *must* be red
614 * (otherwise, the right path has more black nodes as the
622 c_rbtree_swap_child(t, p, n, n->right);
623 if (n->right)
624 c_rbnode_set_parent_and_color(n->right, p, c);
627 } else if (!n->right) {
647 s = n->right;
649 /* right child is next, no need to touch grandchild */
651 gc = s->right;
657 gc = s->right;
658 p->left = s->right;
659 s->right = n->right;
660 c_rbnode_set_parent(n->right, s);