Skip to content

Commit 0d71690

Browse files
committed
oidmap: remove GIT__USE_OIDMAP macro
1 parent 659f5d0 commit 0d71690

File tree

10 files changed

+7
-25
lines changed

10 files changed

+7
-25
lines changed

src/cache.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include "object.h"
1616
#include "git2/oid.h"
1717

18-
GIT__USE_OIDMAP
19-
2018
bool git_cache__enabled = true;
2119
ssize_t git_cache__max_storage = (256 * 1024 * 1024);
2220
git_atomic_ssize git_cache__current_storage = {0};

src/describe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include "vector.h"
2020
#include "repository.h"
2121

22-
GIT__USE_OIDMAP
23-
2422
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
2523

2624
struct commit_name {

src/indexer.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "oidmap.h"
1919
#include "zstream.h"
2020

21-
GIT__USE_OIDMAP
22-
2321
extern git_mutex git__mwindow_mutex;
2422

2523
#define UINT31_MAX (0x7FFFFFFF)

src/odb_mempack.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "git2/types.h"
1919
#include "git2/pack.h"
2020

21-
GIT__USE_OIDMAP
22-
2321
struct memobject {
2422
git_oid oid;
2523
size_t len;

src/oidmap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
#include "oidmap.h"
99

10+
GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
11+
{
12+
khint_t h;
13+
memcpy(&h, oid, sizeof(khint_t));
14+
return h;
15+
}
16+
1017
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
1118

1219
git_oidmap *git_oidmap_alloc()

src/oidmap.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020
__KHASH_TYPE(oid, const git_oid *, void *)
2121
typedef khash_t(oid) git_oidmap;
2222

23-
GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
24-
{
25-
khint_t h;
26-
memcpy(&h, oid, sizeof(khint_t));
27-
return h;
28-
}
29-
30-
#define GIT__USE_OIDMAP \
31-
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
32-
3323
git_oidmap *git_oidmap_alloc(void);
3424
#define git_oidmap_free(h) git_oidmap__free(h); (h) = NULL
3525
void git_oidmap__free(git_oidmap *map);

src/pack-objects.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ struct pack_write_context {
4141
git_transfer_progress *stats;
4242
};
4343

44-
GIT__USE_OIDMAP
45-
4644
#ifdef GIT_THREADS
4745

4846
#define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op) do { \

src/pack.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <zlib.h>
1818

1919
GIT__USE_OFFMAP
20-
GIT__USE_OIDMAP
2120

2221
static int packfile_open(struct git_pack_file *p);
2322
static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n);

src/revwalk.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include "merge.h"
1616
#include "vector.h"
1717

18-
GIT__USE_OIDMAP
19-
2018
git_commit_list_node *git_revwalk__commit_lookup(
2119
git_revwalk *walk, const git_oid *oid)
2220
{

tests/core/oidmap.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include "clar_libgit2.h"
22
#include "oidmap.h"
33

4-
GIT__USE_OIDMAP
5-
64
typedef struct {
75
git_oid oid;
86
size_t extra;

0 commit comments

Comments
 (0)