rb: rename tree.h -> rb.h

This commit is contained in:
Bert Belder 2017-09-11 01:48:06 +02:00
parent 854f8a552c
commit 4dd57efc8b
6 changed files with 12 additions and 12 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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) {

View File

@ -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;

View File

@ -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"

View File

@ -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_ */