From 13c3bc9adf7c3e467c6d1a577859bf31d551022b Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 27 Jan 2017 14:32:23 +0100 Subject: [PATCH] strmap: remove GIT__USE_STRMAP macro --- src/attr.c | 2 -- src/attrcache.c | 2 -- src/checkout.c | 2 -- src/config_file.c | 2 -- src/diff_driver.c | 2 -- src/fileops.c | 2 -- src/mwindow.c | 2 -- src/refdb_fs.c | 2 -- src/refs.c | 2 -- src/repository.c | 1 - src/sortedcache.c | 2 -- src/strmap.c | 2 +- src/strmap.h | 3 --- src/transaction.c | 2 -- src/tree.c | 2 -- tests/core/strmap.c | 2 -- 16 files changed, 1 insertion(+), 31 deletions(-) diff --git a/src/attr.c b/src/attr.c index 4023526e5..999f41318 100644 --- a/src/attr.c +++ b/src/attr.c @@ -7,8 +7,6 @@ #include "git2/oid.h" #include -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 8860d77b1..6cac14bc3 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 b70d5ab35..af600da6c 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 6a3738905..cd5727c05 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -21,8 +21,6 @@ #include #include -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 721388bb9..9109f3155 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 0b0ed42be..57dea8fce 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 91dbcae7f..7bb9dbbe2 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 def5302de..e2a69d6ed 100644 --- a/src/refdb_fs.c +++ b/src/refdb_fs.c @@ -26,8 +26,6 @@ #include #include -GIT__USE_STRMAP - #define DEFAULT_NESTING_LEVEL 5 #define MAX_NESTING_LEVEL 10 diff --git a/src/refs.c b/src/refs.c index 140b175af..70f5519c6 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 4b937be20..0db481638 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 20e137e91..cc322d478 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 09ace0fce..678d98344 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 2c898e00b..389702c9b 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 5b345e1a9..3d3f35a03 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 8f4cab814..dba2060c3 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 860f1109b..2fa594d43 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)