Lines Matching refs:sibling
398 rbnode_type* sibling;
406 /* determine sibling to the node that is one-black short */
407 if(child_parent->right == child) sibling = child_parent->left;
408 else sibling = child_parent->right;
418 if(sibling->color == RED)
419 { /* rotate to get a black sibling */
421 sibling->color = BLACK;
425 /* new sibling after rotation */
426 if(child_parent->right == child) sibling = child_parent->left;
427 else sibling = child_parent->right;
431 && sibling->color == BLACK
432 && sibling->left->color == BLACK
433 && sibling->right->color == BLACK)
434 { /* fixup local with recolor of sibling */
435 if(sibling != RBTREE_NULL)
436 sibling->color = RED;
440 /* prepare to go up, new sibling */
441 if(child_parent->right == child) sibling = child_parent->left;
442 else sibling = child_parent->right;
448 && sibling->color == BLACK
449 && sibling->left->color == BLACK
450 && sibling->right->color == BLACK)
452 /* move red to sibling to rebalance */
453 if(sibling != RBTREE_NULL)
454 sibling->color = RED;
458 assert(sibling != RBTREE_NULL);
460 /* get a new sibling, by rotating at sibling. See which child
461 of sibling is red */
463 && sibling->color == BLACK
464 && sibling->right->color == RED
465 && sibling->left->color == BLACK)
467 sibling->color = RED;
468 sibling->right->color = BLACK;
469 rbtree_rotate_left(rbtree, sibling);
470 /* new sibling after rotation */
471 if(child_parent->right == child) sibling = child_parent->left;
472 else sibling = child_parent->right;
475 && sibling->color == BLACK
476 && sibling->left->color == RED
477 && sibling->right->color == BLACK)
479 sibling->color = RED;
480 sibling->left->color = BLACK;
481 rbtree_rotate_right(rbtree, sibling);
482 /* new sibling after rotation */
483 if(child_parent->right == child) sibling = child_parent->left;
484 else sibling = child_parent->right;
487 /* now we have a black sibling with a red child. rotate and exchange colors. */
488 sibling->color = child_parent->color;
492 assert(sibling->left->color == RED);
493 sibling->left->color = BLACK;
498 assert(sibling->right->color == RED);
499 sibling->right->color = BLACK;