Archived
1
0
Fork 0

rbtree: remove unused arguments from INIT macro.

This commit is contained in:
Henrik Hautakoski 2011-02-01 12:00:07 +01:00
parent b5f0c3117c
commit d64f14af4e
4 changed files with 6 additions and 6 deletions

View file

@ -9,10 +9,10 @@ Initialize a `rbtree` structure. +
should only be used with the declaration like: 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 Data structures
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~

View file

@ -31,8 +31,8 @@ static void wd_free(void *ptr);
static int wd_cmp(const void *a, const void *b); static int wd_cmp(const void *a, const void *b);
static int path_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_wd_paths = RBTREE_INIT(wd_cmp);
static rbtree tree_path_wd = RBTREE_INIT(xfree, NULL, path_cmp); static rbtree tree_path_wd = RBTREE_INIT(path_cmp);
static int wd_cmp(const void *a, const void *b) { static int wd_cmp(const void *a, const void *b) {

View file

@ -19,7 +19,7 @@ typedef struct {
int (*cmp_fn)(const void *, const void *); int (*cmp_fn)(const void *, const void *);
} rbtree; } rbtree;
#define RBTREE_INIT(delete, update, cmp) { NULL, cmp } #define RBTREE_INIT(cmp) { NULL, cmp }
int rbtree_is_empty(rbtree *tree); int rbtree_is_empty(rbtree *tree);

View file

@ -12,7 +12,7 @@ static int vcmp(const void *a, const void *b);
static void vdelete(void *ptr); static void vdelete(void *ptr);
/* data */ /* data */
static rbtree tree = RBTREE_INIT(NULL, NULL, vcmp); static rbtree tree = RBTREE_INIT(vcmp);
static int keyref[NODES]; static int keyref[NODES];
static int vcmp(const void *a, const void *b) { static int vcmp(const void *a, const void *b) {