avoid dependency on delta.o in binaries which don't need it
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
diff --git a/lib/delta.c b/lib/delta.c
index 2bed534..42f628d 100644
--- a/lib/delta.c
+++ b/lib/delta.c
@@ -58,13 +58,6 @@ got_delta_open(off_t offset, size_t tslen, int type, size_t size,
return delta;
}
-void
-got_delta_close(struct got_delta *delta)
-{
- free(delta->delta_buf);
- free(delta);
-}
-
const struct got_error *
got_delta_chain_get_base_type(int *type, struct got_delta_chain *deltas)
{
diff --git a/lib/got_lib_delta.h b/lib/got_lib_delta.h
index a2cb4a3..8b79413 100644
--- a/lib/got_lib_delta.h
+++ b/lib/got_lib_delta.h
@@ -34,7 +34,6 @@ struct got_delta_chain {
struct got_delta *got_delta_open(off_t, size_t, int, size_t, off_t,
uint8_t *, size_t);
-void got_delta_close(struct got_delta *);
const struct got_error *got_delta_chain_get_base_type(int *,
struct got_delta_chain *);
const struct got_error *got_delta_get_sizes(uint64_t *, uint64_t *,
diff --git a/lib/object_parse.c b/lib/object_parse.c
index d924810..75a7a67 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -113,7 +113,8 @@ got_object_close(struct got_object *obj)
while (!SIMPLEQ_EMPTY(&obj->deltas.entries)) {
delta = SIMPLEQ_FIRST(&obj->deltas.entries);
SIMPLEQ_REMOVE_HEAD(&obj->deltas.entries, entry);
- got_delta_close(delta);
+ free(delta->delta_buf);
+ free(delta);
}
}
if (obj->flags & GOT_OBJ_FLAG_PACKED)
diff --git a/libexec/got-read-blob/Makefile b/libexec/got-read-blob/Makefile
index ad08409..a946ea4 100644
--- a/libexec/got-read-blob/Makefile
+++ b/libexec/got-read-blob/Makefile
@@ -1,7 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG= got-read-blob
-SRCS= got-read-blob.c delta.c error.c inflate.c object_parse.c \
+SRCS= got-read-blob.c error.c inflate.c object_parse.c \
path.c privsep.c sha1.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
diff --git a/libexec/got-read-commit/Makefile b/libexec/got-read-commit/Makefile
index 2786410..c08ff1e 100644
--- a/libexec/got-read-commit/Makefile
+++ b/libexec/got-read-commit/Makefile
@@ -1,7 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG= got-read-commit
-SRCS= got-read-commit.c delta.c error.c inflate.c object_parse.c \
+SRCS= got-read-commit.c error.c inflate.c object_parse.c \
path.c privsep.c sha1.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
diff --git a/libexec/got-read-object/Makefile b/libexec/got-read-object/Makefile
index da7839d..5936393 100644
--- a/libexec/got-read-object/Makefile
+++ b/libexec/got-read-object/Makefile
@@ -1,7 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG= got-read-object
-SRCS= got-read-object.c delta.c error.c inflate.c object_parse.c \
+SRCS= got-read-object.c error.c inflate.c object_parse.c \
path.c privsep.c sha1.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
diff --git a/libexec/got-read-tag/Makefile b/libexec/got-read-tag/Makefile
index 3526b16..0d2ce55 100644
--- a/libexec/got-read-tag/Makefile
+++ b/libexec/got-read-tag/Makefile
@@ -1,7 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG= got-read-tag
-SRCS= got-read-tag.c delta.c error.c inflate.c object_parse.c \
+SRCS= got-read-tag.c error.c inflate.c object_parse.c \
path.c privsep.c sha1.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
diff --git a/libexec/got-read-tree/Makefile b/libexec/got-read-tree/Makefile
index 2d7e641..829da95 100644
--- a/libexec/got-read-tree/Makefile
+++ b/libexec/got-read-tree/Makefile
@@ -1,7 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG= got-read-tree
-SRCS= got-read-tree.c delta.c error.c inflate.c object_parse.c \
+SRCS= got-read-tree.c error.c inflate.c object_parse.c \
path.c privsep.c sha1.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
diff --git a/regress/idset/Makefile b/regress/idset/Makefile
index 9b1d3ab..3783d35 100644
--- a/regress/idset/Makefile
+++ b/regress/idset/Makefile
@@ -1,11 +1,7 @@
.PATH:${.CURDIR}/../../lib
PROG = idset_test
-SRCS = error.c object.c privsep.c sha1.c pack.c inflate.c path.c opentemp.c \
- delta.c repository.c reference.c worktree.c fileindex.c object_cache.c \
- object_idset.c object_parse.c idset_test.c \
- buf.c worklist.c rcsutil.c diff.c diffreg.c diff3.c lockfile.c \
- deflate.c object_create.c
+SRCS = error.c sha1.c object_idset.c inflate.c object_parse.c idset_test.c
CPPFLAGS = -I${.CURDIR}/../../include -I${.CURDIR}/../../lib
LDADD = -lutil -lz