oidmap: remove GIT__USE_OIDMAP macro
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
diff --git a/src/cache.c b/src/cache.c
index f76e72d..c92a3a7 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -15,8 +15,6 @@
#include "object.h"
#include "git2/oid.h"
-GIT__USE_OIDMAP
-
bool git_cache__enabled = true;
ssize_t git_cache__max_storage = (256 * 1024 * 1024);
git_atomic_ssize git_cache__current_storage = {0};
diff --git a/src/describe.c b/src/describe.c
index 1523858..4a1e253 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -19,8 +19,6 @@
#include "vector.h"
#include "repository.h"
-GIT__USE_OIDMAP
-
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
struct commit_name {
diff --git a/src/indexer.c b/src/indexer.c
index 3e88bc7..869e229 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -18,8 +18,6 @@
#include "oidmap.h"
#include "zstream.h"
-GIT__USE_OIDMAP
-
extern git_mutex git__mwindow_mutex;
#define UINT31_MAX (0x7FFFFFFF)
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index 52f8089..d6f2fb4 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -18,8 +18,6 @@
#include "git2/types.h"
#include "git2/pack.h"
-GIT__USE_OIDMAP
-
struct memobject {
git_oid oid;
size_t len;
diff --git a/src/oidmap.c b/src/oidmap.c
index ab821df..0df9a4f 100644
--- a/src/oidmap.c
+++ b/src/oidmap.c
@@ -7,6 +7,13 @@
#include "oidmap.h"
+GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
+{
+ khint_t h;
+ memcpy(&h, oid, sizeof(khint_t));
+ return h;
+}
+
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
git_oidmap *git_oidmap_alloc()
diff --git a/src/oidmap.h b/src/oidmap.h
index bfad8e2..a3f8961 100644
--- a/src/oidmap.h
+++ b/src/oidmap.h
@@ -20,16 +20,6 @@
__KHASH_TYPE(oid, const git_oid *, void *)
typedef khash_t(oid) git_oidmap;
-GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
-{
- khint_t h;
- memcpy(&h, oid, sizeof(khint_t));
- return h;
-}
-
-#define GIT__USE_OIDMAP \
- __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
-
git_oidmap *git_oidmap_alloc(void);
#define git_oidmap_free(h) git_oidmap__free(h); (h) = NULL
void git_oidmap__free(git_oidmap *map);
diff --git a/src/pack-objects.c b/src/pack-objects.c
index 1b4ec9d..58b7b94 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -41,8 +41,6 @@ struct pack_write_context {
git_transfer_progress *stats;
};
-GIT__USE_OIDMAP
-
#ifdef GIT_THREADS
#define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op) do { \
diff --git a/src/pack.c b/src/pack.c
index 4e30ca7..9be051e 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -17,7 +17,6 @@
#include <zlib.h>
GIT__USE_OFFMAP
-GIT__USE_OIDMAP
static int packfile_open(struct git_pack_file *p);
static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n);
diff --git a/src/revwalk.c b/src/revwalk.c
index ac54002..6d08164 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -15,8 +15,6 @@
#include "merge.h"
#include "vector.h"
-GIT__USE_OIDMAP
-
git_commit_list_node *git_revwalk__commit_lookup(
git_revwalk *walk, const git_oid *oid)
{
diff --git a/tests/core/oidmap.c b/tests/core/oidmap.c
index 92b8c19..617da54 100644
--- a/tests/core/oidmap.c
+++ b/tests/core/oidmap.c
@@ -1,8 +1,6 @@
#include "clar_libgit2.h"
#include "oidmap.h"
-GIT__USE_OIDMAP
-
typedef struct {
git_oid oid;
size_t extra;