Commit 13c3bc9adf7c3e467c6d1a577859bf31d551022b

Patrick Steinhardt 2017-01-27T14:32:23

strmap: remove GIT__USE_STRMAP macro

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)