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

Lines Matching defs:sibling

415 	ldns_rbnode_t* sibling;
418 /* determine sibling to the node that is one-black short */
419 if(child_parent->right == child) sibling = child_parent->left;
420 else sibling = child_parent->right;
430 if(sibling->color == RED)
431 { /* rotate to get a black sibling */
433 sibling->color = BLACK;
437 /* new sibling after rotation */
438 if(child_parent->right == child) sibling = child_parent->left;
439 else sibling = child_parent->right;
443 && sibling->color == BLACK
444 && sibling->left->color == BLACK
445 && sibling->right->color == BLACK)
446 { /* fixup local with recolor of sibling */
447 if(sibling != LDNS_RBTREE_NULL)
448 sibling->color = RED;
452 /* prepare to go up, new sibling */
453 if(child_parent->right == child) sibling = child_parent->left;
454 else sibling = child_parent->right;
460 && sibling->color == BLACK
461 && sibling->left->color == BLACK
462 && sibling->right->color == BLACK)
464 /* move red to sibling to rebalance */
465 if(sibling != LDNS_RBTREE_NULL)
466 sibling->color = RED;
471 /* get a new sibling, by rotating at sibling. See which child
472 of sibling is red */
474 && sibling->color == BLACK
475 && sibling->right->color == RED
476 && sibling->left->color == BLACK)
478 sibling->color = RED;
479 sibling->right->color = BLACK;
480 ldns_rbtree_rotate_left(rbtree, sibling);
481 /* new sibling after rotation */
482 if(child_parent->right == child) sibling = child_parent->left;
483 else sibling = child_parent->right;
486 && sibling->color == BLACK
487 && sibling->left->color == RED
488 && sibling->right->color == BLACK)
490 sibling->color = RED;
491 sibling->left->color = BLACK;
492 ldns_rbtree_rotate_right(rbtree, sibling);
493 /* new sibling after rotation */
494 if(child_parent->right == child) sibling = child_parent->left;
495 else sibling = child_parent->right;
498 /* now we have a black sibling with a red child. rotate and exchange colors. */
499 sibling->color = child_parent->color;
503 sibling->left->color = BLACK;
508 sibling->right->color = BLACK;