Lines Matching refs:parent

113 static uint8_t get_side(struct rbnode *parent, struct rbnode *child)  in get_side()  argument
115 CHECK(get_child(parent, 0U) == child || get_child(parent, 1U) == child); in get_side()
117 return (get_child(parent, 1U) == child) ? 1U : 0U; in get_side()
134 struct rbnode *parent = stack[stacksz - 2]; in rotate() local
136 uint8_t side = get_side(parent, child); in rotate()
143 set_child(grandparent, get_side(grandparent, parent), child); in rotate()
147 set_child(child, (side == 0U) ? 1U : 0U, parent); in rotate()
148 set_child(parent, side, b); in rotate()
150 stack[stacksz - 1] = parent; in rotate()
161 struct rbnode *parent = stack[stacksz - 2]; in fix_extra_red() local
169 if (is_black(parent)) { in fix_extra_red()
179 uint8_t side = get_side(grandparent, parent); in fix_extra_red()
185 set_color(parent, BLACK); in fix_extra_red()
200 uint8_t parent_side = get_side(parent, node); in fix_extra_red()
239 struct rbnode *parent = stack[stacksz - 1]; in rb_insert() local
241 uint8_t side = tree->lessthan_fn(node, parent) ? 0U : 1U; in rb_insert()
243 set_child(parent, side, node); in rb_insert()
276 struct rbnode *parent = stack[stacksz - 2]; in fix_missing_black() local
277 uint8_t n_side = get_side(parent, n); in fix_missing_black()
278 struct rbnode *sib = get_child(parent, in fix_missing_black()
291 set_color(parent, RED); in fix_missing_black()
296 parent = stack[stacksz - 2]; in fix_missing_black()
297 sib = get_child(parent, (n_side == 0U) ? 1U : 0U); in fix_missing_black()
310 set_child(parent, n_side, NULL); in fix_missing_black()
314 if (is_black(parent)) { in fix_missing_black()
324 set_color(parent, BLACK); in fix_missing_black()
360 set_color(sib, get_color(parent)); in fix_missing_black()
361 set_color(parent, BLACK); in fix_missing_black()
366 set_child(parent, n_side, NULL); in fix_missing_black()
473 struct rbnode *parent = stack[stacksz - 2]; in rb_remove() local
485 set_child(parent, get_side(parent, node), NULL); in rb_remove()
488 set_child(parent, get_side(parent, node), child); in rb_remove()