From c50dca2a18077306eb6796938d3d01c76590b4c6 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 24 Feb 2023 01:39:22 -0500 Subject: list-objects: mark unused callback parameters Our graph-traversal functions take callbacks for showing commits and objects, but not all callbacks need each parameter. Likewise for the similar traverse_bitmap_commit_list(), which has a different interface but serves the same purpose. And the include_check mechanism, which passes along a void pointer which is not always used. Mark the unused ones to to make -Wunused-parameter happy. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- reachable.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'reachable.c') diff --git a/reachable.c b/reachable.c index aba63ebeb3..08f290c2be 100644 --- a/reachable.c +++ b/reachable.c @@ -48,7 +48,9 @@ static int add_one_ref(const char *path, const struct object_id *oid, * The traversal will have already marked us as SEEN, so we * only need to handle any progress reporting here. */ -static void mark_object(struct object *obj, const char *name, void *data) +static void mark_object(struct object *obj UNUSED, + const char *name UNUSED, + void *data) { update_progress(data); } @@ -202,10 +204,10 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs, static int mark_object_seen(const struct object_id *oid, enum object_type type, - int exclude, - uint32_t name_hash, - struct packed_git *found_pack, - off_t found_offset) + int exclude UNUSED, + uint32_t name_hash UNUSED, + struct packed_git *found_pack UNUSED, + off_t found_offset UNUSED) { struct object *obj = lookup_object_by_type(the_repository, oid, type); if (!obj) -- cgit v1.2.3 From be252d3349f1a5fdf7aaf53390f3ce555b5de9d9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 24 Feb 2023 01:39:24 -0500 Subject: for_each_object: mark unused callback parameters The for_each_{loose,packed}_object interface uses callback functions, but not every callback needs all of the parameters. Mark the unused ones to satisfy -Wunused-parameter. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- reachable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'reachable.c') diff --git a/reachable.c b/reachable.c index 08f290c2be..0afe80c203 100644 --- a/reachable.c +++ b/reachable.c @@ -154,7 +154,8 @@ static int add_recent_loose(const struct object_id *oid, } static int add_recent_packed(const struct object_id *oid, - struct packed_git *p, uint32_t pos, + struct packed_git *p, + uint32_t pos, void *data) { struct object *obj; -- cgit v1.2.3