summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-03-28 13:15:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-29 02:03:10 (GMT)
commita1aad71601a7a2052058d735ef86624b3cc774cf (patch)
tree8c607238fac75a6cc96456448d55d440e6a9d2e4 /builtin
parentd385784f89b3350db16380441bc8a18ebe54179a (diff)
downloadgit-a1aad71601a7a2052058d735ef86624b3cc774cf.zip
git-a1aad71601a7a2052058d735ef86624b3cc774cf.tar.gz
git-a1aad71601a7a2052058d735ef86624b3cc774cf.tar.bz2
fsck.h: use "enum object_type" instead of "int"
Change the fsck_walk_func to use an "enum object_type" instead of an "int" type. The types are compatible, and ever since this was added in 355885d5315 (add generic, type aware object chain walker, 2008-02-25) we've used entries from object_type (OBJ_BLOB etc.). So this doesn't really change anything as far as the generated code is concerned, it just gives the compiler more information and makes this easier to read. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fsck.c3
-rw-r--r--builtin/index-pack.c3
-rw-r--r--builtin/unpack-objects.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index a56a2d0..ed5f2af 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -192,7 +192,8 @@ static int traverse_reachable(void)
return !!result;
}
-static int mark_used(struct object *obj, int type, void *data, struct fsck_options *options)
+static int mark_used(struct object *obj, enum object_type object_type,
+ void *data, struct fsck_options *options)
{
if (!obj)
return 1;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index bad5748..69f24fe 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -212,7 +212,8 @@ static void cleanup_thread(void)
free(thread_data);
}
-static int mark_link(struct object *obj, int type, void *data, struct fsck_options *options)
+static int mark_link(struct object *obj, enum object_type type,
+ void *data, struct fsck_options *options)
{
if (!obj)
return -1;
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index dd4a75e..ca54fd1 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -187,7 +187,8 @@ static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
* that have reachability requirements and calls this function.
* Verify its reachability and validity recursively and write it out.
*/
-static int check_object(struct object *obj, int type, void *data, struct fsck_options *options)
+static int check_object(struct object *obj, enum object_type type,
+ void *data, struct fsck_options *options)
{
struct obj_buffer *obj_buf;