strmap: remove GIT__USE_STRMAP 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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
diff --git a/src/attr.c b/src/attr.c
index 4023526..999f413 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -7,8 +7,6 @@
#include "git2/oid.h"
#include <ctype.h>
-GIT__USE_STRMAP
-
const char *git_attr__true = "[internal]__TRUE__";
const char *git_attr__false = "[internal]__FALSE__";
const char *git_attr__unset = "[internal]__UNSET__";
diff --git a/src/attrcache.c b/src/attrcache.c
index 8860d77..6cac14b 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -5,8 +5,6 @@
#include "sysdir.h"
#include "ignore.h"
-GIT__USE_STRMAP
-
GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache)
{
GIT_UNUSED(cache); /* avoid warning if threading is off */
diff --git a/src/checkout.c b/src/checkout.c
index b70d5ab..af600da 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -35,8 +35,6 @@
#include "pool.h"
#include "strmap.h"
-GIT__USE_STRMAP
-
/* See docs/checkout-internals.md for more information */
enum {
diff --git a/src/config_file.c b/src/config_file.c
index 6a37389..cd5727c 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -21,8 +21,6 @@
#include <sys/types.h>
#include <regex.h>
-GIT__USE_STRMAP
-
typedef struct cvar_t {
struct cvar_t *next;
git_config_entry *entry;
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 721388b..9109f31 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -16,8 +16,6 @@
#include "config.h"
#include "repository.h"
-GIT__USE_STRMAP
-
typedef enum {
DIFF_DRIVER_AUTO = 0,
DIFF_DRIVER_BINARY = 1,
diff --git a/src/fileops.c b/src/fileops.c
index 0b0ed42..57dea8f 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -13,8 +13,6 @@
#include "win32/findfile.h"
#endif
-GIT__USE_STRMAP
-
int git_futils_mkpath2file(const char *file_path, const mode_t mode)
{
return git_futils_mkdir(
diff --git a/src/mwindow.c b/src/mwindow.c
index 91dbcae..7bb9dbb 100644
--- a/src/mwindow.c
+++ b/src/mwindow.c
@@ -14,8 +14,6 @@
#include "strmap.h"
#include "pack.h"
-GIT__USE_STRMAP
-
#define DEFAULT_WINDOW_SIZE \
(sizeof(void*) >= 8 \
? 1 * 1024 * 1024 * 1024 \
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index def5302..e2a69d6 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -26,8 +26,6 @@
#include <git2/sys/refs.h>
#include <git2/sys/reflog.h>
-GIT__USE_STRMAP
-
#define DEFAULT_NESTING_LEVEL 5
#define MAX_NESTING_LEVEL 10
diff --git a/src/refs.c b/src/refs.c
index 140b175..70f5519 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -26,8 +26,6 @@
bool git_reference__enable_symbolic_ref_target_validation = true;
-GIT__USE_STRMAP
-
#define DEFAULT_NESTING_LEVEL 5
#define MAX_NESTING_LEVEL 10
diff --git a/src/repository.c b/src/repository.c
index 4b937be..0db4816 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -30,7 +30,6 @@
#include "submodule.h"
#include "worktree.h"
-GIT__USE_STRMAP
#include "strmap.h"
#ifdef GIT_WIN32
diff --git a/src/sortedcache.c b/src/sortedcache.c
index 20e137e..cc322d4 100644
--- a/src/sortedcache.c
+++ b/src/sortedcache.c
@@ -1,7 +1,5 @@
#include "sortedcache.h"
-GIT__USE_STRMAP
-
int git_sortedcache_new(
git_sortedcache **out,
size_t item_path_offset,
diff --git a/src/strmap.c b/src/strmap.c
index 09ace0f..678d983 100644
--- a/src/strmap.c
+++ b/src/strmap.c
@@ -7,7 +7,7 @@
#include "strmap.h"
-GIT__USE_STRMAP
+__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
int git_strmap_alloc(git_strmap **map)
{
diff --git a/src/strmap.h b/src/strmap.h
index 2c898e0..389702c 100644
--- a/src/strmap.h
+++ b/src/strmap.h
@@ -20,9 +20,6 @@ __KHASH_TYPE(str, const char *, void *)
typedef khash_t(str) git_strmap;
typedef khiter_t git_strmap_iter;
-#define GIT__USE_STRMAP \
- __KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
-
int git_strmap_alloc(git_strmap **map);
#define git_strmap_free(h) git_strmap__free(h); (h) = NULL
diff --git a/src/transaction.c b/src/transaction.c
index 5b345e1..3d3f35a 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -19,8 +19,6 @@
#include "git2/sys/refs.h"
#include "git2/sys/refdb_backend.h"
-GIT__USE_STRMAP
-
typedef enum {
TRANSACTION_NONE,
TRANSACTION_REFS,
diff --git a/src/tree.c b/src/tree.c
index 8f4cab8..dba2060 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -20,8 +20,6 @@
#define TREE_ENTRY_CHECK_NAMELEN(n) \
if (n > UINT16_MAX) { giterr_set(GITERR_INVALID, "tree entry path too long"); }
-GIT__USE_STRMAP
-
static bool valid_filemode(const int filemode)
{
return (filemode == GIT_FILEMODE_TREE
diff --git a/tests/core/strmap.c b/tests/core/strmap.c
index 860f110..2fa594d 100644
--- a/tests/core/strmap.c
+++ b/tests/core/strmap.c
@@ -1,8 +1,6 @@
#include "clar_libgit2.h"
#include "strmap.h"
-GIT__USE_STRMAP
-
git_strmap *g_table;
void test_core_strmap__initialize(void)