From 4dd57efc8b4a02070ccef75df780f8d622dbf3c2 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 11 Sep 2017 01:48:06 +0200 Subject: [PATCH] rb: rename tree.h -> rb.h --- src/epoll-socket.h | 2 +- src/epoll.c | 2 +- src/handle-tree.c | 2 +- src/handle-tree.h | 2 +- src/port.h | 2 +- src/{tree.h => rb.h} | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/{tree.h => rb.h} (99%) diff --git a/src/epoll-socket.h b/src/epoll-socket.h index c14483d..e36a69a 100644 --- a/src/epoll-socket.h +++ b/src/epoll-socket.h @@ -7,7 +7,7 @@ #include "handle-tree.h" #include "internal.h" #include "queue.h" -#include "tree.h" +#include "rb.h" #include "util.h" #include "win.h" diff --git a/src/epoll.c b/src/epoll.c index 07e793c..5b5c03f 100644 --- a/src/epoll.c +++ b/src/epoll.c @@ -13,7 +13,7 @@ #include "poll-request.h" #include "port.h" #include "queue.h" -#include "tree.h" +#include "rb.h" #include "util.h" #include "win.h" diff --git a/src/handle-tree.c b/src/handle-tree.c index 96ddac6..87a66d0 100644 --- a/src/handle-tree.c +++ b/src/handle-tree.c @@ -2,7 +2,7 @@ #include "error.h" #include "handle-tree.h" -#include "tree.h" +#include "rb.h" static inline int _handle_tree_compare(handle_tree_node_t* a, handle_tree_node_t* b) { diff --git a/src/handle-tree.h b/src/handle-tree.h index c58ac60..19cd1c3 100644 --- a/src/handle-tree.h +++ b/src/handle-tree.h @@ -2,7 +2,7 @@ #define EPOLL_HANDLE_TREE_H_ #include "internal.h" -#include "tree.h" +#include "rb.h" typedef RB_HEAD(handle_tree, handle_tree_node) handle_tree_t; diff --git a/src/port.h b/src/port.h index a3e2791..12c6dc3 100644 --- a/src/port.h +++ b/src/port.h @@ -6,7 +6,7 @@ #include "handle-tree.h" #include "internal.h" #include "queue.h" -#include "tree.h" +#include "rb.h" #include "util.h" #include "win.h" diff --git a/src/tree.h b/src/rb.h similarity index 99% rename from src/tree.h rename to src/rb.h index c1ba278..c10aba7 100644 --- a/src/tree.h +++ b/src/rb.h @@ -35,13 +35,13 @@ * The maximum height of a red-black tree is 2lg (n+1). */ -#ifndef EPOLL_TREE_H_ -#define EPOLL_TREE_H_ +#ifndef EPOLL_RB_H_ +#define EPOLL_RB_H_ #ifdef __clang__ -//#define TREE_UNUSED __attribute__((__unused__)) +#define RB_UNUSED __attribute__((__unused__)) #else -#define TREE_UNUSED /* empty */ +#define RB_UNUSED /* empty */ #endif /* clang-format off */ @@ -123,7 +123,7 @@ struct { \ #define RB_PROTOTYPE(name, type, field, cmp) \ RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) #define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ - RB_PROTOTYPE_INTERNAL(name, type, field, cmp, static TREE_UNUSED) + RB_PROTOTYPE_INTERNAL(name, type, field, cmp, static RB_UNUSED) #define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \ attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ @@ -142,7 +142,7 @@ attr struct type *name##_RB_MINMAX(struct name *, int); \ #define RB_GENERATE(name, type, field, cmp) \ RB_GENERATE_INTERNAL(name, type, field, cmp,) #define RB_GENERATE_STATIC(name, type, field, cmp) \ - RB_GENERATE_INTERNAL(name, type, field, cmp, static TREE_UNUSED) + RB_GENERATE_INTERNAL(name, type, field, cmp, static RB_UNUSED) #define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ @@ -498,4 +498,4 @@ name##_RB_MINMAX(struct name *head, int val) \ /* clang-format on */ -#endif /* EPOLL_TREE_H_ */ +#endif /* EPOLL_RB_H_ */