From a5adff0eebb383985cd41fa117ee9381cbed7f8e Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:50:01 +0000 Subject: Rename ARB_REBALANCE(3) to ARB_REINSERT(3) to match tree(3), and document it. MFC after: 2 weeks Sponsored by: Klara Inc, Netflix --- sys/sys/arb.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/sys/arb.h') diff --git a/sys/sys/arb.h b/sys/sys/arb.h index 71b81b645d04..e5f0a450cb3a 100644 --- a/sys/sys/arb.h +++ b/sys/sys/arb.h @@ -253,7 +253,7 @@ struct { \ ARB_PROTOTYPE_PREV(name, type, attr); \ ARB_PROTOTYPE_CMINMAX(name, type, attr); \ ARB_PROTOTYPE_MINMAX(name, type, attr); \ - ARB_PROTOTYPE_REBALANCE(name, type, attr); + ARB_PROTOTYPE_REINSERT(name, type, attr); #define ARB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ attr void name##_ARB_INSERT_COLOR(struct name *, struct type *) #define ARB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ @@ -289,8 +289,8 @@ struct { \ attr const struct type *name##_ARB_CMINMAX(const struct name *, int) #define ARB_PROTOTYPE_MINMAX(name, type, attr) \ attr struct type *name##_ARB_MINMAX(const struct name *, int) -#define ARB_PROTOTYPE_REBALANCE(name, type, attr) \ - attr struct type *name##_ARB_REBALANCE(struct name *, struct type *) +#define ARB_PROTOTYPE_REINSERT(name, type, attr) \ + attr struct type *name##_ARB_REINSERT(struct name *, struct type *) #define ARB_GENERATE(name, type, field, cmp) \ ARB_GENERATE_INTERNAL(name, type, field, cmp,) @@ -309,7 +309,7 @@ struct { \ ARB_GENERATE_PREV(name, type, field, attr) \ ARB_GENERATE_CMINMAX(name, type, field, attr) \ ARB_GENERATE_MINMAX(name, type, field, attr) \ - ARB_GENERATE_REBALANCE(name, type, field, cmp, attr) + ARB_GENERATE_REINSERT(name, type, field, cmp, attr) #define ARB_GENERATE_INSERT_COLOR(name, type, field, attr) \ attr void \ @@ -695,9 +695,9 @@ attr struct type * \ name##_ARB_MINMAX(const struct name *head, int val) \ { return (__DECONST(struct type *, name##_ARB_CMINMAX(head, val))); } -#define ARB_GENERATE_REBALANCE(name, type, field, cmp, attr) \ +#define ARB_GENERATE_REINSERT(name, type, field, cmp, attr) \ attr struct type * \ -name##_ARB_REBALANCE(struct name *head, struct type *elm) \ +name##_ARB_REINSERT(struct name *head, struct type *elm) \ { \ struct type *cmpelm; \ if (((cmpelm = ARB_PREV(name, head, elm)) != NULL && \ @@ -731,7 +731,7 @@ name##_ARB_REBALANCE(struct name *head, struct type *elm) \ name##_ARB_CMINMAX(x, ARB_INF) : ARB_CNODE(x, ARB_MAXIDX(x))) #define ARB_MAX(name, x) (ARB_MAXIDX(x) == ARB_NULLIDX ? \ name##_ARB_MINMAX(x, ARB_INF) : ARB_NODE(x, ARB_MAXIDX(x))) -#define ARB_REBALANCE(name, x, y) name##_ARB_REBALANCE(x, y) +#define ARB_REINSERT(name, x, y) name##_ARB_REINSERT(x, y) #define ARB_FOREACH(x, name, head) \ for ((x) = ARB_MIN(name, head); \ -- cgit v1.2.3