version 1.2, 2011/06/07 11:49:39
|
version 1.3, 2011/08/29 12:00:57
|
Line 135 struct { \
|
Line 135 struct { \
|
SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ |
SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ |
(head)->sph_root = tmp; \ |
(head)->sph_root = tmp; \ |
} while (0) |
} while (0) |
| |
#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ |
#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ |
SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ |
SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ |
SPLAY_LEFT(tmp, field) = (head)->sph_root; \ |
SPLAY_LEFT(tmp, field) = (head)->sph_root; \ |
Line 381 struct { \
|
Line 381 struct { \
|
} while (0) |
} while (0) |
|
|
#ifndef RB_AUGMENT |
#ifndef RB_AUGMENT |
#define RB_AUGMENT(x) do {} while (0) | #define RB_AUGMENT(x) (void)(x) |
#endif |
#endif |
|
|
#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ |
#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ |
Line 425 struct { \
|
Line 425 struct { \
|
} while (0) |
} while (0) |
|
|
/* Generates prototypes and inline functions */ |
/* Generates prototypes and inline functions */ |
#define RB_PROTOTYPE(name, type, field, cmp) \ | #define RB_PROTOTYPE(name, type, field, cmp) \ |
RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) |
RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) |
#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ |
#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ |
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) |
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) |
Line 517 name##_RB_REMOVE_COLOR(struct name *head, struct type
|
Line 517 name##_RB_REMOVE_COLOR(struct name *head, struct type
|
if (RB_RIGHT(tmp, field) == NULL || \ |
if (RB_RIGHT(tmp, field) == NULL || \ |
RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ |
RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ |
struct type *oleft; \ |
struct type *oleft; \ |
if ((oleft = RB_LEFT(tmp, field)))\ | if ((oleft = RB_LEFT(tmp, field))) \ |
RB_COLOR(oleft, field) = RB_BLACK;\ |
RB_COLOR(oleft, field) = RB_BLACK;\ |
RB_COLOR(tmp, field) = RB_RED; \ |
RB_COLOR(tmp, field) = RB_RED; \ |
RB_ROTATE_RIGHT(head, tmp, oleft, field);\ |
RB_ROTATE_RIGHT(head, tmp, oleft, field);\ |
Line 549 name##_RB_REMOVE_COLOR(struct name *head, struct type
|
Line 549 name##_RB_REMOVE_COLOR(struct name *head, struct type
|
if (RB_LEFT(tmp, field) == NULL || \ |
if (RB_LEFT(tmp, field) == NULL || \ |
RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ |
RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ |
struct type *oright; \ |
struct type *oright; \ |
if ((oright = RB_RIGHT(tmp, field)))\ | if ((oright = RB_RIGHT(tmp, field))) \ |
RB_COLOR(oright, field) = RB_BLACK;\ |
RB_COLOR(oright, field) = RB_BLACK;\ |
RB_COLOR(tmp, field) = RB_RED; \ |
RB_COLOR(tmp, field) = RB_RED; \ |
RB_ROTATE_LEFT(head, tmp, oright, field);\ |
RB_ROTATE_LEFT(head, tmp, oright, field);\ |