Lines Matching full:tmp
87 /* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
88 #define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ argument
89 SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
90 SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
91 (head)->sph_root = tmp; \
94 #define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ argument
95 SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
96 SPLAY_LEFT(tmp, field) = (head)->sph_root; \
97 (head)->sph_root = tmp; \
100 #define SPLAY_LINKLEFT(head, tmp, field) do { \ argument
101 SPLAY_LEFT(tmp, field) = (head)->sph_root; \
102 tmp = (head)->sph_root; \
106 #define SPLAY_LINKRIGHT(head, tmp, field) do { \ argument
107 SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
108 tmp = (head)->sph_root; \
342 #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ argument
343 (tmp) = RB_RIGHT(elm, field); \
344 if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
345 RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
348 if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
350 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
352 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
354 (head)->rbh_root = (tmp); \
355 RB_LEFT(tmp, field) = (elm); \
356 RB_PARENT(elm, field) = (tmp); \
357 RB_AUGMENT(tmp); \
358 if ((RB_PARENT(tmp, field))) \
359 RB_AUGMENT(RB_PARENT(tmp, field)); \
362 #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ argument
363 (tmp) = RB_LEFT(elm, field); \
364 if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
365 RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
368 if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
370 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
372 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
374 (head)->rbh_root = (tmp); \
375 RB_RIGHT(tmp, field) = (elm); \
376 RB_PARENT(elm, field) = (tmp); \
377 RB_AUGMENT(tmp); \
378 if ((RB_PARENT(tmp, field))) \
379 RB_AUGMENT(RB_PARENT(tmp, field)); \
410 struct type *parent, *gparent, *tmp; \
415 tmp = RB_RIGHT(gparent, field); \
416 if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
417 RB_COLOR(tmp, field) = RB_BLACK; \
423 RB_ROTATE_LEFT(head, parent, tmp, field); \
424 tmp = parent; \
426 elm = tmp; \
429 RB_ROTATE_RIGHT(head, gparent, tmp, field); \
431 tmp = RB_LEFT(gparent, field); \
432 if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
433 RB_COLOR(tmp, field) = RB_BLACK; \
439 RB_ROTATE_RIGHT(head, parent, tmp, field); \
440 tmp = parent; \
442 elm = tmp; \
445 RB_ROTATE_LEFT(head, gparent, tmp, field); \
455 struct type *tmp; \
459 tmp = RB_RIGHT(parent, field); \
460 if (RB_COLOR(tmp, field) == RB_RED) { \
461 RB_SET_BLACKRED(tmp, parent, field); \
462 RB_ROTATE_LEFT(head, parent, tmp, field); \
463 tmp = RB_RIGHT(parent, field); \
465 if ((RB_LEFT(tmp, field) == NULL || \
466 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
467 (RB_RIGHT(tmp, field) == NULL || \
468 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
469 RB_COLOR(tmp, field) = RB_RED; \
473 if (RB_RIGHT(tmp, field) == NULL || \
474 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) { \
476 if ((oleft = RB_LEFT(tmp, field)) \
479 RB_COLOR(tmp, field) = RB_RED; \
480 RB_ROTATE_RIGHT(head, tmp, oleft, field); \
481 tmp = RB_RIGHT(parent, field); \
483 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
485 if (RB_RIGHT(tmp, field)) \
486 RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \
487 RB_ROTATE_LEFT(head, parent, tmp, field); \
492 tmp = RB_LEFT(parent, field); \
493 if (RB_COLOR(tmp, field) == RB_RED) { \
494 RB_SET_BLACKRED(tmp, parent, field); \
495 RB_ROTATE_RIGHT(head, parent, tmp, field); \
496 tmp = RB_LEFT(parent, field); \
498 if ((RB_LEFT(tmp, field) == NULL || \
499 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
500 (RB_RIGHT(tmp, field) == NULL || \
501 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
502 RB_COLOR(tmp, field) = RB_RED; \
506 if (RB_LEFT(tmp, field) == NULL || \
507 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) { \
509 if ((oright = RB_RIGHT(tmp, field)) \
512 RB_COLOR(tmp, field) = RB_RED; \
513 RB_ROTATE_LEFT(head, tmp, oright, field); \
514 tmp = RB_LEFT(parent, field); \
516 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
518 if (RB_LEFT(tmp, field)) \
519 RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \
520 RB_ROTATE_RIGHT(head, parent, tmp, field); \
601 struct type *tmp; \
604 tmp = RB_ROOT(head); \
605 while (tmp) { \
606 parent = tmp; \
609 tmp = RB_LEFT(tmp, field); \
611 tmp = RB_RIGHT(tmp, field); \
613 return (tmp); \
632 struct type *tmp = RB_ROOT(head); \
634 while (tmp) { \
635 comp = cmp(elm, tmp); \
637 tmp = RB_LEFT(tmp, field); \
639 tmp = RB_RIGHT(tmp, field); \
641 return (tmp); \
650 struct type *tmp = RB_ROOT(head); \
653 while (tmp) { \
654 comp = cmp(elm, tmp); \
656 res = tmp; \
657 tmp = RB_LEFT(tmp, field); \
660 tmp = RB_RIGHT(tmp, field); \
662 return (tmp); \
714 struct type *tmp = RB_ROOT(head); \
716 while (tmp) { \
717 parent = tmp; \
719 tmp = RB_LEFT(tmp, field); \
721 tmp = RB_RIGHT(tmp, field); \