• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/unbound/util/

Lines Matching defs:sibling

409 	rbnode_type* sibling;
412 /* determine sibling to the node that is one-black short */
413 if(child_parent->right == child) sibling = child_parent->left;
414 else sibling = child_parent->right;
424 if(sibling->color == RED)
425 { /* rotate to get a black sibling */
427 sibling->color = BLACK;
431 /* new sibling after rotation */
432 if(child_parent->right == child) sibling = child_parent->left;
433 else sibling = child_parent->right;
437 && sibling->color == BLACK
438 && sibling->left->color == BLACK
439 && sibling->right->color == BLACK)
440 { /* fixup local with recolor of sibling */
441 if(sibling != RBTREE_NULL)
442 sibling->color = RED;
446 /* prepare to go up, new sibling */
447 if(child_parent->right == child) sibling = child_parent->left;
448 else sibling = child_parent->right;
454 && sibling->color == BLACK
455 && sibling->left->color == BLACK
456 && sibling->right->color == BLACK)
458 /* move red to sibling to rebalance */
459 if(sibling != RBTREE_NULL)
460 sibling->color = RED;
464 log_assert(sibling != RBTREE_NULL);
466 /* get a new sibling, by rotating at sibling. See which child
467 of sibling is red */
469 && sibling->color == BLACK
470 && sibling->right->color == RED
471 && sibling->left->color == BLACK)
473 sibling->color = RED;
474 sibling->right->color = BLACK;
475 rbtree_rotate_left(rbtree, sibling);
476 /* new sibling after rotation */
477 if(child_parent->right == child) sibling = child_parent->left;
478 else sibling = child_parent->right;
481 && sibling->color == BLACK
482 && sibling->left->color == RED
483 && sibling->right->color == BLACK)
485 sibling->color = RED;
486 sibling->left->color = BLACK;
487 rbtree_rotate_right(rbtree, sibling);
488 /* new sibling after rotation */
489 if(child_parent->right == child) sibling = child_parent->left;
490 else sibling = child_parent->right;
493 /* now we have a black sibling with a red child. rotate and exchange colors. */
494 sibling->color = child_parent->color;
498 log_assert(sibling->left->color == RED);
499 sibling->left->color = BLACK;
504 log_assert(sibling->right->color == RED);
505 sibling->right->color = BLACK;