mark unused read_tree_recursive() callback parameters

We pass a callback to read_tree_recursive(), but not every callback needs every parameter. Let's mark the unused ones to satisfy -Wunused-parameter. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 19, 2022 at 06:08 UTC 555ff1c8a4fc3bf4beab0b5bb8774fd607f95111
7 files changed +18 -13
archive-tar.c
+1 -1
@@ -421,7 +421,7 @@ static int git_tar_config(const char *var, const char *value, void *cb)
421 return tar_filter_config(var, value, cb);
422 }
423
424 -static int write_tar_archive(const struct archiver *ar,
424 +static int write_tar_archive(const struct archiver *UNUSED(ar),
425 struct archiver_args *args)
426 {
427 int err = 0;
archive-zip.c
+1 -1
@@ -618,7 +618,7 @@ static int archive_zip_config(const char *var, const char *value,
618 return userdiff_config(var, value);
619 }
620
621 -static int write_zip_archive(const struct archiver *ar,
621 +static int write_zip_archive(const struct archiver *UNUSED(ar),
622 struct archiver_args *args)
623 {
624 int err;
archive.c
+2 -1
@@ -382,7 +382,8 @@ struct path_exists_context {
382 struct archiver_args *args;
383 };
384
385 -static int reject_entry(const struct object_id *oid, struct strbuf *base,
385 +static int reject_entry(const struct object_id *UNUSED(oid),
386 + struct strbuf *base,
387 const char *filename, unsigned mode,
388 void *context)
389 {
builtin/checkout.c
+1 -1
@@ -125,7 +125,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm
125 }
126
127 static int update_some(const struct object_id *oid, struct strbuf *base,
128 - const char *pathname, unsigned mode, void *context)
128 + const char *pathname, unsigned mode, void *UNUSED(context))
129 {
130 int len;
131 struct cache_entry *ce;
builtin/log.c
+4 -3
@@ -645,9 +645,10 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
645 return 0;
646 }
647
648 -static int show_tree_object(const struct object_id *oid,
649 - struct strbuf *base,
650 - const char *pathname, unsigned mode, void *context)
648 +static int show_tree_object(const struct object_id *UNUSED(oid),
649 + struct strbuf *UNUSED(base),
650 + const char *pathname, unsigned mode,
651 + void *context)
652 {
653 FILE *file = context;
654 fprintf(file, "%s%s\n", pathname, S_ISDIR(mode) ? "/" : "");
builtin/ls-tree.c
+8 -5
@@ -142,7 +142,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
142 }
143
144 static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
145 - const char *pathname, unsigned mode, void *context)
145 + const char *pathname, unsigned mode, void *UNUSED(context))
146 {
147 size_t baselen;
148 int recurse = 0;
@@ -213,7 +213,7 @@ static void show_tree_common_default_long(struct strbuf *base,
213
214 static int show_tree_default(const struct object_id *oid, struct strbuf *base,
215 const char *pathname, unsigned mode,
216 - void *context)
216 + void *UNUSED(context))
217 {
218 int early;
219 int recurse;
@@ -230,7 +230,8 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
230 }
231
232 static int show_tree_long(const struct object_id *oid, struct strbuf *base,
233 - const char *pathname, unsigned mode, void *context)
233 + const char *pathname, unsigned mode,
234 + void *UNUSED(context))
235 {
236 int early;
237 int recurse;
@@ -259,7 +260,8 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
260 }
261
262 static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
262 - const char *pathname, unsigned mode, void *context)
263 + const char *pathname, unsigned mode,
264 + void *UNUSED(context))
265 {
266 int early;
267 int recurse;
@@ -279,7 +281,8 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
281 }
282
283 static int show_tree_object(const struct object_id *oid, struct strbuf *base,
282 - const char *pathname, unsigned mode, void *context)
284 + const char *pathname, unsigned mode,
285 + void *UNUSED(context))
286 {
287 int early;
288 int recurse;
merge-recursive.c
+1 -1
@@ -456,7 +456,7 @@ static void unpack_trees_finish(struct merge_options *opt)
456 clear_unpack_trees_porcelain(&opt->priv->unpack_opts);
457 }
458
459 -static int save_files_dirs(const struct object_id *oid,
459 +static int save_files_dirs(const struct object_id *UNUSED(oid),
460 struct strbuf *base, const char *path,
461 unsigned int mode, void *context)
462 {