]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cbtree.h
dir.h: move DTYPE defines from cache.h
[thirdparty/git.git] / cbtree.h
index a04a312c3f5bd14873e96edc227524a2245c6c35..43193abdda23cef279f9e9cee99370509611f7c5 100644 (file)
--- a/cbtree.h
+++ b/cbtree.h
@@ -14,8 +14,6 @@
 #ifndef CBTREE_H
 #define CBTREE_H
 
-#include "git-compat-util.h"
-
 struct cb_node;
 struct cb_node {
        struct cb_node *child[2];
@@ -37,16 +35,16 @@ enum cb_next {
        CB_BREAK = 1
 };
 
-#define CBTREE_INIT { .root = NULL }
+#define CBTREE_INIT { 0 }
 
 static inline void cb_init(struct cb_tree *t)
 {
-       t->root = NULL;
+       struct cb_tree blank = CBTREE_INIT;
+       memcpy(t, &blank, sizeof(*t));
 }
 
 struct cb_node *cb_lookup(struct cb_tree *, const uint8_t *k, size_t klen);
 struct cb_node *cb_insert(struct cb_tree *, struct cb_node *, size_t klen);
-struct cb_node *cb_unlink(struct cb_tree *t, const uint8_t *k, size_t klen);
 
 typedef enum cb_next (*cb_iter)(struct cb_node *, void *arg);