rbtree: remove unused arguments from INIT macro.
This commit is contained in:
parent
b5f0c3117c
commit
d64f14af4e
4 changed files with 6 additions and 6 deletions
|
|
@ -9,10 +9,10 @@ Initialize a `rbtree` structure. +
|
|||
should only be used with the declaration like:
|
||||
+
|
||||
----
|
||||
rbtree tree = RBTREE_INIT(...);
|
||||
rbtree tree = RBTREE_INIT(cmp);
|
||||
----
|
||||
+
|
||||
the arguments are pointers to callback functions, in order: `delete_fn`, `update_fn`, `cmp_fn`
|
||||
will expand to set the compare function 'cmp' to the `cmp_fn` member.
|
||||
|
||||
Data structures
|
||||
~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ static void wd_free(void *ptr);
|
|||
static int wd_cmp(const void *a, const void *b);
|
||||
static int path_cmp(const void *a, const void *b);
|
||||
|
||||
static rbtree tree_wd_paths = RBTREE_INIT(wd_free, NULL, wd_cmp);
|
||||
static rbtree tree_path_wd = RBTREE_INIT(xfree, NULL, path_cmp);
|
||||
static rbtree tree_wd_paths = RBTREE_INIT(wd_cmp);
|
||||
static rbtree tree_path_wd = RBTREE_INIT(path_cmp);
|
||||
|
||||
static int wd_cmp(const void *a, const void *b) {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ typedef struct {
|
|||
int (*cmp_fn)(const void *, const void *);
|
||||
} rbtree;
|
||||
|
||||
#define RBTREE_INIT(delete, update, cmp) { NULL, cmp }
|
||||
#define RBTREE_INIT(cmp) { NULL, cmp }
|
||||
|
||||
int rbtree_is_empty(rbtree *tree);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ static int vcmp(const void *a, const void *b);
|
|||
static void vdelete(void *ptr);
|
||||
|
||||
/* data */
|
||||
static rbtree tree = RBTREE_INIT(NULL, NULL, vcmp);
|
||||
static rbtree tree = RBTREE_INIT(vcmp);
|
||||
static int keyref[NODES];
|
||||
|
||||
static int vcmp(const void *a, const void *b) {
|
||||
|
|
|
|||
Reference in a new issue