Lines Matching refs:tmp

106 #define RB_ROTATE_LEFT(head, elm, tmp) do {			\  argument
107 (tmp) = RB_RIGHT(elm); \
108 if ((RB_RIGHT(elm) = RB_LEFT(tmp))) { \
109 RB_PARENT(RB_LEFT(tmp)) = (elm); \
112 if ((RB_PARENT(tmp) = RB_PARENT(elm))) { \
114 RB_LEFT(RB_PARENT(elm)) = (tmp); \
116 RB_RIGHT(RB_PARENT(elm)) = (tmp); \
118 (head)->rb_node = (tmp); \
119 RB_LEFT(tmp) = (elm); \
120 RB_PARENT(elm) = (tmp); \
121 RB_AUGMENT(tmp); \
122 if ((RB_PARENT(tmp))) \
123 RB_AUGMENT(RB_PARENT(tmp)); \
126 #define RB_ROTATE_RIGHT(head, elm, tmp) do { \ argument
127 (tmp) = RB_LEFT(elm); \
128 if ((RB_LEFT(elm) = RB_RIGHT(tmp))) { \
129 RB_PARENT(RB_RIGHT(tmp)) = (elm); \
132 if ((RB_PARENT(tmp) = RB_PARENT(elm))) { \
134 RB_LEFT(RB_PARENT(elm)) = (tmp); \
136 RB_RIGHT(RB_PARENT(elm)) = (tmp); \
138 (head)->rb_node = (tmp); \
139 RB_RIGHT(tmp) = (elm); \
140 RB_PARENT(elm) = (tmp); \
141 RB_AUGMENT(tmp); \
142 if ((RB_PARENT(tmp))) \
143 RB_AUGMENT(RB_PARENT(tmp)); \
149 struct rb_node *parent, *gparent, *tmp; in rb_insert_color() local
154 tmp = RB_RIGHT(gparent); in rb_insert_color()
155 if (tmp && RB_COLOR(tmp) == RB_RED) { in rb_insert_color()
156 RB_COLOR(tmp) = RB_BLACK; in rb_insert_color()
162 RB_ROTATE_LEFT(head, parent, tmp); in rb_insert_color()
163 tmp = parent; in rb_insert_color()
165 elm = tmp; in rb_insert_color()
168 RB_ROTATE_RIGHT(head, gparent, tmp); in rb_insert_color()
170 tmp = RB_LEFT(gparent); in rb_insert_color()
171 if (tmp && RB_COLOR(tmp) == RB_RED) { in rb_insert_color()
172 RB_COLOR(tmp) = RB_BLACK; in rb_insert_color()
178 RB_ROTATE_RIGHT(head, parent, tmp); in rb_insert_color()
179 tmp = parent; in rb_insert_color()
181 elm = tmp; in rb_insert_color()
184 RB_ROTATE_LEFT(head, gparent, tmp); in rb_insert_color()
194 struct rb_node *tmp; in rb_remove_color() local
198 tmp = RB_RIGHT(parent); in rb_remove_color()
199 if (RB_COLOR(tmp) == RB_RED) { in rb_remove_color()
200 RB_SET_BLACKRED(tmp, parent); in rb_remove_color()
201 RB_ROTATE_LEFT(head, parent, tmp); in rb_remove_color()
202 tmp = RB_RIGHT(parent); in rb_remove_color()
204 if ((RB_LEFT(tmp) == NULL || in rb_remove_color()
205 RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) && in rb_remove_color()
206 (RB_RIGHT(tmp) == NULL || in rb_remove_color()
207 RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK)) { in rb_remove_color()
208 RB_COLOR(tmp) = RB_RED; in rb_remove_color()
212 if (RB_RIGHT(tmp) == NULL || in rb_remove_color()
213 RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK) { in rb_remove_color()
215 if ((oleft = RB_LEFT(tmp))) in rb_remove_color()
217 RB_COLOR(tmp) = RB_RED; in rb_remove_color()
218 RB_ROTATE_RIGHT(head, tmp, oleft); in rb_remove_color()
219 tmp = RB_RIGHT(parent); in rb_remove_color()
221 RB_COLOR(tmp) = RB_COLOR(parent); in rb_remove_color()
223 if (RB_RIGHT(tmp)) in rb_remove_color()
224 RB_COLOR(RB_RIGHT(tmp)) = RB_BLACK; in rb_remove_color()
225 RB_ROTATE_LEFT(head, parent, tmp); in rb_remove_color()
230 tmp = RB_LEFT(parent); in rb_remove_color()
231 if (RB_COLOR(tmp) == RB_RED) { in rb_remove_color()
232 RB_SET_BLACKRED(tmp, parent); in rb_remove_color()
233 RB_ROTATE_RIGHT(head, parent, tmp); in rb_remove_color()
234 tmp = RB_LEFT(parent); in rb_remove_color()
236 if ((RB_LEFT(tmp) == NULL || in rb_remove_color()
237 RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) && in rb_remove_color()
238 (RB_RIGHT(tmp) == NULL || in rb_remove_color()
239 RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK)) { in rb_remove_color()
240 RB_COLOR(tmp) = RB_RED; in rb_remove_color()
244 if (RB_LEFT(tmp) == NULL || in rb_remove_color()
245 RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) { in rb_remove_color()
247 if ((oright = RB_RIGHT(tmp))) in rb_remove_color()
249 RB_COLOR(tmp) = RB_RED; in rb_remove_color()
250 RB_ROTATE_LEFT(head, tmp, oright); in rb_remove_color()
251 tmp = RB_LEFT(parent); in rb_remove_color()
253 RB_COLOR(tmp) = RB_COLOR(parent); in rb_remove_color()
255 if (RB_LEFT(tmp)) in rb_remove_color()
256 RB_COLOR(RB_LEFT(tmp)) = RB_BLACK; in rb_remove_color()
257 RB_ROTATE_RIGHT(head, parent, tmp); in rb_remove_color()