refs: mark unused each_ref_fn parameters

Functions used with for_each_ref(), etc, need to conform to the each_ref_fn interface. But most of them don't need every parameter; let's annotate the unused ones to quiet -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 63e14ee2d69b58eae72e34df81f2cde145427037
39 files changed +132 -84
bisect.c
+4 -3
@@ -441,7 +441,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
441 }
442
443 static int register_ref(const char *refname, const struct object_id *oid,
444 - int flags, void *cb_data)
444 + int UNUSED(flags), void *UNUSED(cb_data))
445 {
446 struct strbuf good_prefix = STRBUF_INIT;
447 strbuf_addstr(&good_prefix, term_good);
@@ -1160,8 +1160,9 @@ int estimate_bisect_steps(int all)
1160 return (e < 3 * x) ? n : n - 1;
1161 }
1162
1163 -static int mark_for_removal(const char *refname, const struct object_id *oid,
1164 - int flag, void *cb_data)
1163 +static int mark_for_removal(const char *refname,
1164 + const struct object_id *UNUSED(oid),
1165 + int UNUSED(flag), void *cb_data)
1166 {
1167 struct string_list *refs = cb_data;
1168 char *ref = xstrfmt("refs/bisect%s", refname);
builtin/bisect--helper.c
+7 -5
@@ -329,8 +329,9 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
329 return 0;
330 }
331
332 -static int inc_nr(const char *refname, const struct object_id *oid,
333 - int flag, void *cb_data)
332 +static int inc_nr(const char *UNUSED(refname),
333 + const struct object_id *UNUSED(oid),
334 + int UNUSED(flag), void *cb_data)
335 {
336 unsigned int *nr = (unsigned int *)cb_data;
337 (*nr)++;
@@ -518,7 +519,7 @@ finish:
519 }
520
521 static int add_bisect_ref(const char *refname, const struct object_id *oid,
521 - int flags, void *cb)
522 + int UNUSED(flags), void *cb)
523 {
524 struct add_bisect_ref_data *data = cb;
525
@@ -1134,8 +1135,9 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a
1135 return res;
1136 }
1137
1137 -static int get_first_good(const char *refname, const struct object_id *oid,
1138 - int flag, void *cb_data)
1138 +static int get_first_good(const char *UNUSED(refname),
1139 + const struct object_id *oid,
1140 + int UNUSED(flag), void *cb_data)
1141 {
1142 oidcpy(cb_data, oid);
1143 return 1;
builtin/checkout.c
+1 -1
@@ -990,7 +990,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
990
991 static int add_pending_uninteresting_ref(const char *refname,
992 const struct object_id *oid,
993 - int flags, void *cb_data)
993 + int UNUSED(flags), void *cb_data)
994 {
995 add_pending_oid(cb_data, refname, oid, UNINTERESTING);
996 return 0;
builtin/describe.c
+2 -1
@@ -140,7 +140,8 @@ static void add_to_known_names(const char *path,
140 }
141 }
142
143 -static int get_name(const char *path, const struct object_id *oid, int flag, void *cb_data)
143 +static int get_name(const char *path, const struct object_id *oid,
144 + int UNUSED(flag), void *UNUSED(cb_data))
145 {
146 int is_tag = 0;
147 struct object_id peeled;
builtin/fetch.c
+4 -3
@@ -329,7 +329,7 @@ static struct refname_hash_entry *refname_hash_add(struct hashmap *map,
329
330 static int add_one_refname(const char *refname,
331 const struct object_id *oid,
332 - int flag, void *cbdata)
332 + int UNUSED(flag), void *cbdata)
333 {
334 struct hashmap *refname_map = cbdata;
335
@@ -1462,8 +1462,9 @@ static void set_option(struct transport *transport, const char *name, const char
1462 }
1463
1464
1465 -static int add_oid(const char *refname, const struct object_id *oid, int flags,
1466 - void *cb_data)
1465 +static int add_oid(const char *UNUSED(refname),
1466 + const struct object_id *oid,
1467 + int UNUSED(flags), void *cb_data)
1468 {
1469 struct oid_array *oids = cb_data;
1470
builtin/fsck.c
+4 -3
@@ -502,8 +502,9 @@ static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid
502 return 0;
503 }
504
505 -static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
506 - int flag, void *cb_data)
505 +static int fsck_handle_reflog(const char *logname,
506 + const struct object_id *UNUSED(oid),
507 + int UNUSED(flag), void *cb_data)
508 {
509 struct strbuf refname = STRBUF_INIT;
510
@@ -514,7 +515,7 @@ static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
515 }
516
517 static int fsck_handle_ref(const char *refname, const struct object_id *oid,
517 - int flag, void *cb_data)
518 + int UNUSED(flag), void *UNUSED(cb_data))
519 {
520 struct object *obj;
521
builtin/gc.c
+3 -2
@@ -782,8 +782,9 @@ struct cg_auto_data {
782 int limit;
783 };
784
785 -static int dfs_on_ref(const char *refname,
786 - const struct object_id *oid, int flags,
785 +static int dfs_on_ref(const char *UNUSED(refname),
786 + const struct object_id *oid,
787 + int UNUSED(flags),
788 void *cb_data)
789 {
790 struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
builtin/name-rev.c
+2 -1
@@ -344,7 +344,8 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
344 return a->taggerdate != b->taggerdate;
345 }
346
347 -static int name_ref(const char *path, const struct object_id *oid, int flags, void *cb_data)
347 +static int name_ref(const char *path, const struct object_id *oid,
348 + int UNUSED(flags), void *cb_data)
349 {
350 struct object *o = parse_object(the_repository, oid);
351 struct name_ref_data *data = cb_data;
builtin/pack-objects.c
+7 -5
@@ -759,8 +759,8 @@ static enum write_one_status write_one(struct hashfile *f,
759 return WRITE_ONE_WRITTEN;
760 }
761
762 -static int mark_tagged(const char *path, const struct object_id *oid, int flag,
763 - void *cb_data)
762 +static int mark_tagged(const char *UNUSED(path), const struct object_id *oid,
763 + int UNUSED(flag), void *UNUSED(cb_data))
764 {
765 struct object_id peeled;
766 struct object_entry *entry = packlist_find(&to_pack, oid);
@@ -3035,7 +3035,8 @@ static void add_tag_chain(const struct object_id *oid)
3035 }
3036 }
3037
3038 -static int add_ref_tag(const char *tag, const struct object_id *oid, int flag, void *cb_data)
3038 +static int add_ref_tag(const char *UNUSED(tag), const struct object_id *oid,
3039 + int UNUSED(flag), void *UNUSED(cb_data))
3040 {
3041 struct object_id peeled;
3042
@@ -3950,8 +3951,9 @@ static void record_recent_commit(struct commit *commit, void *data)
3951 }
3952
3953 static int mark_bitmap_preferred_tip(const char *refname,
3953 - const struct object_id *oid, int flags,
3954 - void *_data)
3954 + const struct object_id *oid,
3955 + int UNUSED(flags),
3956 + void *UNUSED(data))
3957 {
3958 struct object_id peeled;
3959 struct object *object;
builtin/receive-pack.c
+1 -1
@@ -291,7 +291,7 @@ static void show_ref(const char *path, const struct object_id *oid)
291 }
292
293 static int show_ref_cb(const char *path_full, const struct object_id *oid,
294 - int flag, void *data)
294 + int UNUSED(flag), void *data)
295 {
296 struct oidset *seen = data;
297 const char *path = strip_namespace(path_full);
builtin/reflog.c
+2 -1
@@ -56,7 +56,8 @@ struct worktree_reflogs {
56 struct string_list reflogs;
57 };
58
59 -static int collect_reflog(const char *ref, const struct object_id *oid, int unused, void *cb_data)
59 +static int collect_reflog(const char *ref, const struct object_id *UNUSED(oid),
60 + int UNUSED(flags), void *cb_data)
61 {
62 struct worktree_reflogs *cb = cb_data;
63 struct worktree *worktree = cb->worktree;
builtin/remote.c
+8 -4
@@ -264,7 +264,8 @@ static const char *abbrev_ref(const char *name, const char *prefix)
264 }
265 #define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
266
267 -static int config_read_branches(const char *key, const char *value, void *cb)
267 +static int config_read_branches(const char *key, const char *value,
268 + void *UNUSED(data))
269 {
270 const char *orig_key = key;
271 char *name;
@@ -538,7 +539,8 @@ struct branches_for_remote {
539 };
540
541 static int add_branch_for_removal(const char *refname,
541 - const struct object_id *oid, int flags, void *cb_data)
542 + const struct object_id *UNUSED(oid),
543 + int UNUSED(flags), void *cb_data)
544 {
545 struct branches_for_remote *branches = cb_data;
546 struct refspec_item refspec;
@@ -580,7 +582,8 @@ struct rename_info {
582 };
583
584 static int read_remote_branches(const char *refname,
583 - const struct object_id *oid, int flags, void *cb_data)
585 + const struct object_id *UNUSED(oid),
586 + int UNUSED(flags), void *cb_data)
587 {
588 struct rename_info *rename = cb_data;
589 struct strbuf buf = STRBUF_INIT;
@@ -953,7 +956,8 @@ static void free_remote_ref_states(struct ref_states *states)
956 }
957
958 static int append_ref_to_tracked_list(const char *refname,
956 - const struct object_id *oid, int flags, void *cb_data)
959 + const struct object_id *UNUSED(oid),
960 + int flags, void *cb_data)
961 {
962 struct ref_states *states = cb_data;
963 struct refspec_item refspec;
builtin/repack.c
+2 -2
@@ -514,9 +514,9 @@ struct midx_snapshot_ref_data {
514 int preferred;
515 };
516
517 -static int midx_snapshot_ref_one(const char *refname,
517 +static int midx_snapshot_ref_one(const char *UNUSED(refname),
518 const struct object_id *oid,
519 - int flag, void *_data)
519 + int UNUSED(flag), void *_data)
520 {
521 struct midx_snapshot_ref_data *data = _data;
522 struct object_id peeled;
builtin/rev-parse.c
+4 -2
@@ -195,7 +195,8 @@ static int show_default(void)
195 return 0;
196 }
197
198 -static int show_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
198 +static int show_reference(const char *refname, const struct object_id *oid,
199 + int UNUSED(flag), void *UNUSED(cb_data))
200 {
201 if (ref_excluded(ref_excludes, refname))
202 return 0;
@@ -203,7 +204,8 @@ static int show_reference(const char *refname, const struct object_id *oid, int
204 return 0;
205 }
206
206 -static int anti_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
207 +static int anti_reference(const char *refname, const struct object_id *oid,
208 + int UNUSED(flag), void *UNUSED(cb_data))
209 {
210 show_rev(REVERSED, oid, refname);
211 return 0;
builtin/show-branch.c
+3 -3
@@ -404,7 +404,7 @@ static int append_ref(const char *refname, const struct object_id *oid,
404 }
405
406 static int append_head_ref(const char *refname, const struct object_id *oid,
407 - int flag, void *cb_data)
407 + int UNUSED(flag), void *UNUSED(cb_data))
408 {
409 struct object_id tmp;
410 int ofs = 11;
@@ -419,7 +419,7 @@ static int append_head_ref(const char *refname, const struct object_id *oid,
419 }
420
421 static int append_remote_ref(const char *refname, const struct object_id *oid,
422 - int flag, void *cb_data)
422 + int UNUSED(flag), void *UNUSED(cb_data))
423 {
424 struct object_id tmp;
425 int ofs = 13;
@@ -434,7 +434,7 @@ static int append_remote_ref(const char *refname, const struct object_id *oid,
434 }
435
436 static int append_tag_ref(const char *refname, const struct object_id *oid,
437 - int flag, void *cb_data)
437 + int UNUSED(flag), void *UNUSED(cb_data))
438 {
439 if (!starts_with(refname, "refs/tags/"))
440 return 0;
builtin/show-ref.c
+4 -3
@@ -47,7 +47,7 @@ static void show_one(const char *refname, const struct object_id *oid)
47 }
48
49 static int show_ref(const char *refname, const struct object_id *oid,
50 - int flag, void *cbdata)
50 + int UNUSED(flag), void *UNUSED(cbdata))
51 {
52 if (show_head && !strcmp(refname, "HEAD"))
53 goto match;
@@ -77,8 +77,9 @@ match:
77 return 0;
78 }
79
80 -static int add_existing(const char *refname, const struct object_id *oid,
81 - int flag, void *cbdata)
80 +static int add_existing(const char *refname,
81 + const struct object_id *UNUSED(oid),
82 + int UNUSED(flag), void *cbdata)
83 {
84 struct string_list *list = (struct string_list *)cbdata;
85 string_list_insert(list, refname);
builtin/submodule--helper.c
+3 -2
@@ -622,8 +622,9 @@ static void print_status(unsigned int flags, char state, const char *path,
622 printf("\n");
623 }
624
625 -static int handle_submodule_head_ref(const char *refname,
626 - const struct object_id *oid, int flags,
625 +static int handle_submodule_head_ref(const char *UNUSED(refname),
626 + const struct object_id *oid,
627 + int UNUSED(flags),
628 void *cb_data)
629 {
630 struct object_id *output = cb_data;
commit-graph.c
+2 -2
@@ -1639,9 +1639,9 @@ struct refs_cb_data {
1639 struct progress *progress;
1640 };
1641
1642 -static int add_ref_to_set(const char *refname,
1642 +static int add_ref_to_set(const char *UNUSED(refname),
1643 const struct object_id *oid,
1644 - int flags, void *cb_data)
1644 + int UNUSED(flags), void *cb_data)
1645 {
1646 struct object_id peeled;
1647 struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
delta-islands.c
+1 -1
@@ -365,7 +365,7 @@ static void add_ref_to_island(const char *island_name, const struct object_id *o
365 }
366
367 static int find_island_for_ref(const char *refname, const struct object_id *oid,
368 - int flags, void *data)
368 + int UNUSED(flags), void *UNUSED(data))
369 {
370 /*
371 * We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
fetch-pack.c
+8 -4
@@ -176,8 +176,10 @@ static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
176 return 0;
177 }
178
179 -static int rev_list_insert_ref_oid(const char *refname, const struct object_id *oid,
180 - int flag, void *cb_data)
179 +static int rev_list_insert_ref_oid(const char *UNUSED(refname),
180 + const struct object_id *oid,
181 + int UNUSED(flag),
182 + void *cb_data)
183 {
184 return rev_list_insert_ref(cb_data, oid);
185 }
@@ -580,8 +582,10 @@ static int mark_complete(const struct object_id *oid)
582 return 0;
583 }
584
583 -static int mark_complete_oid(const char *refname, const struct object_id *oid,
584 - int flag, void *cb_data)
585 +static int mark_complete_oid(const char *UNUSED(refname),
586 + const struct object_id *oid,
587 + int UNUSED(flag),
588 + void *UNUSED(cb_data))
589 {
590 return mark_complete(oid);
591 }
help.c
+3 -2
@@ -781,8 +781,9 @@ struct similar_ref_cb {
781 struct string_list *similar_refs;
782 };
783
784 -static int append_similar_ref(const char *refname, const struct object_id *oid,
785 - int flags, void *cb_data)
784 +static int append_similar_ref(const char *refname,
785 + const struct object_id *UNUSED(oid),
786 + int UNUSED(flags), void *cb_data)
787 {
788 struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
789 char *branch = strrchr(refname, '/') + 1;
http-backend.c
+1 -1
@@ -505,7 +505,7 @@ static void run_service(const char **argv, int buffer_input)
505 }
506
507 static int show_text_ref(const char *name, const struct object_id *oid,
508 - int flag, void *cb_data)
508 + int UNUSED(flag), void *cb_data)
509 {
510 const char *name_nons = strip_namespace(name);
511 struct strbuf *buf = cb_data;
log-tree.c
+2 -1
@@ -135,7 +135,8 @@ static int ref_filter_match(const char *refname,
135 }
136
137 static int add_ref_decoration(const char *refname, const struct object_id *oid,
138 - int flags, void *cb_data)
138 + int UNUSED(flags),
139 + void *cb_data)
140 {
141 struct object *obj;
142 enum object_type objtype;
negotiator/default.c
+2 -1
@@ -36,7 +36,8 @@ static void rev_list_push(struct negotiation_state *ns,
36 }
37
38 static int clear_marks(const char *refname, const struct object_id *oid,
39 - int flag, void *cb_data)
39 + int UNUSED(flag),
40 + void *UNUSED(cb_data))
41 {
42 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
43
negotiator/skipping.c
+2 -1
@@ -72,7 +72,8 @@ static struct entry *rev_list_push(struct data *data, struct commit *commit, int
72 }
73
74 static int clear_marks(const char *refname, const struct object_id *oid,
75 - int flag, void *cb_data)
75 + int UNUSED(flag),
76 + void *UNUSED(cb_data))
77 {
78 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
79
notes.c
+3 -2
@@ -924,8 +924,9 @@ out:
924 return ret;
925 }
926
927 -static int string_list_add_one_ref(const char *refname, const struct object_id *oid,
928 - int flag, void *cb)
927 +static int string_list_add_one_ref(const char *refname,
928 + const struct object_id *UNUSED(oid),
929 + int UNUSED(flag), void *cb)
930 {
931 struct string_list *refs = cb;
932 if (!unsorted_string_list_has_string(refs, refname))
object-name.c
+2 -1
@@ -1306,7 +1306,8 @@ struct handle_one_ref_cb {
1306 };
1307
1308 static int handle_one_ref(const char *path, const struct object_id *oid,
1309 - int flag, void *cb_data)
1309 + int UNUSED(flag),
1310 + void *cb_data)
1311 {
1312 struct handle_one_ref_cb *cb = cb_data;
1313 struct commit_list **list = cb->list;
reflog.c
+2 -1
@@ -294,7 +294,8 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
294 return expire;
295 }
296
297 -static int push_tip_to_list(const char *refname, const struct object_id *oid,
297 +static int push_tip_to_list(const char *UNUSED(refname),
298 + const struct object_id *oid,
299 int flags, void *cb_data)
300 {
301 struct commit_list **list = cb_data;
refs.c
+7 -4
@@ -358,7 +358,8 @@ struct warn_if_dangling_data {
358 const char *msg_fmt;
359 };
360
361 -static int warn_if_dangling_symref(const char *refname, const struct object_id *oid,
361 +static int warn_if_dangling_symref(const char *refname,
362 + const struct object_id *UNUSED(oid),
363 int flags, void *cb_data)
364 {
365 struct warn_if_dangling_data *d = cb_data;
@@ -934,9 +935,11 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
935 return cb->found_it;
936 }
937
937 -static int read_ref_at_ent_newest(struct object_id *ooid, struct object_id *noid,
938 - const char *email, timestamp_t timestamp,
939 - int tz, const char *message, void *cb_data)
938 +static int read_ref_at_ent_newest(struct object_id *UNUSED(ooid),
939 + struct object_id *noid,
940 + const char *UNUSED(email),
941 + timestamp_t timestamp, int tz,
942 + const char *message, void *cb_data)
943 {
944 struct read_ref_at_cb *cb = cb_data;
945
refs/files-backend.c
+3 -1
@@ -2995,7 +2995,9 @@ static int files_transaction_abort(struct ref_store *ref_store,
2995 }
2996
2997 static int ref_present(const char *refname,
2998 - const struct object_id *oid, int flags, void *cb_data)
2998 + const struct object_id *UNUSED(oid),
2999 + int UNUSED(flags),
3000 + void *cb_data)
3001 {
3002 struct string_list *affected_refnames = cb_data;
3003
remote.c
+2 -1
@@ -2320,7 +2320,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
2320 }
2321
2322 static int one_local_ref(const char *refname, const struct object_id *oid,
2323 - int flag, void *cb_data)
2323 + int UNUSED(flag),
2324 + void *cb_data)
2325 {
2326 struct ref ***local_tail = cb_data;
2327 struct ref *ref;
replace-object.c
+2 -1
@@ -9,7 +9,8 @@
9 static int register_replace_ref(struct repository *r,
10 const char *refname,
11 const struct object_id *oid,
12 - int flag, void *cb_data)
12 + int UNUSED(flag),
13 + void *UNUSED(cb_data))
14 {
15 /* Get sha1 from refname */
16 const char *slash = strrchr(refname, '/');
revision.c
+4 -3
@@ -1543,7 +1543,8 @@ int ref_excluded(struct string_list *ref_excludes, const char *path)
1543 }
1544
1545 static int handle_one_ref(const char *path, const struct object_id *oid,
1546 - int flag, void *cb_data)
1546 + int UNUSED(flag),
1547 + void *cb_data)
1548 {
1549 struct all_refs_cb *cb = cb_data;
1550 struct object *object;
@@ -1627,8 +1628,8 @@ static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
1628 }
1629
1630 static int handle_one_reflog(const char *refname_in_wt,
1630 - const struct object_id *oid,
1631 - int flag, void *cb_data)
1631 + const struct object_id *UNUSED(oid),
1632 + int UNUSED(flag), void *cb_data)
1633 {
1634 struct all_refs_cb *cb = cb_data;
1635 struct strbuf refname = STRBUF_INIT;
server-info.c
+2 -1
@@ -147,7 +147,8 @@ out:
147 }
148
149 static int add_info_ref(const char *path, const struct object_id *oid,
150 - int flag, void *cb_data)
150 + int UNUSED(flag),
151 + void *cb_data)
152 {
153 struct update_info_ctx *uic = cb_data;
154 struct object *o = parse_object(the_repository, oid);
shallow.c
+8 -4
@@ -604,8 +604,10 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
604 free(tmp);
605 }
606
607 -static int mark_uninteresting(const char *refname, const struct object_id *oid,
608 - int flags, void *cb_data)
607 +static int mark_uninteresting(const char *UNUSED(refname),
608 + const struct object_id *oid,
609 + int UNUSED(flags),
610 + void *UNUSED(cb_data))
611 {
612 struct commit *commit = lookup_commit_reference_gently(the_repository,
613 oid, 1);
@@ -715,8 +717,10 @@ struct commit_array {
717 int nr, alloc;
718 };
719
718 -static int add_ref(const char *refname, const struct object_id *oid,
719 - int flags, void *cb_data)
720 +static int add_ref(const char *UNUSED(refname),
721 + const struct object_id *oid,
722 + int UNUSED(flags),
723 + void *cb_data)
724 {
725 struct commit_array *ca = cb_data;
726 ALLOC_GROW(ca->commits, ca->nr + 1, ca->alloc);
submodule.c
+6 -4
@@ -940,8 +940,9 @@ static void free_submodules_data(struct string_list *submodules)
940 string_list_clear(submodules, 1);
941 }
942
943 -static int has_remote(const char *refname, const struct object_id *oid,
944 - int flags, void *cb_data)
943 +static int has_remote(const char *UNUSED(refname),
944 + const struct object_id *UNUSED(oid),
945 + int UNUSED(flags), void *UNUSED(cb_data))
946 {
947 return 1;
948 }
@@ -1243,8 +1244,9 @@ int push_unpushed_submodules(struct repository *r,
1244 return ret;
1245 }
1246
1246 -static int append_oid_to_array(const char *ref, const struct object_id *oid,
1247 - int flags, void *data)
1247 +static int append_oid_to_array(const char *UNUSED(ref),
1248 + const struct object_id *oid,
1249 + int UNUSED(flags), void *data)
1250 {
1251 struct oid_array *array = data;
1252 oid_array_append(array, oid);
t/helper/test-ref-store.c
+1 -1
@@ -161,7 +161,7 @@ static int cmd_rename_ref(struct ref_store *refs, const char **argv)
161 }
162
163 static int each_ref(const char *refname, const struct object_id *oid,
164 - int flags, void *cb_data)
164 + int flags, void *UNUSED(cb_data))
165 {
166 printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
167 return 0;
upload-pack.c
+4 -3
@@ -1170,7 +1170,7 @@ static int mark_our_ref(const char *refname, const char *refname_full,
1170 }
1171
1172 static int check_ref(const char *refname_full, const struct object_id *oid,
1173 - int flag, void *cb_data)
1173 + int UNUSED(flag), void *UNUSED(cb_data))
1174 {
1175 const char *refname = strip_namespace(refname_full);
1176
@@ -1194,7 +1194,7 @@ static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {
1194 }
1195
1196 static int send_ref(const char *refname, const struct object_id *oid,
1197 - int flag, void *cb_data)
1197 + int UNUSED(flag), void *cb_data)
1198 {
1199 static const char *capabilities = "multi_ack thin-pack side-band"
1200 " side-band-64k ofs-delta shallow deepen-since deepen-not"
@@ -1236,7 +1236,8 @@ static int send_ref(const char *refname, const struct object_id *oid,
1236 return 0;
1237 }
1238
1239 -static int find_symref(const char *refname, const struct object_id *oid,
1239 +static int find_symref(const char *refname,
1240 + const struct object_id *UNUSED(oid),
1241 int flag, void *cb_data)
1242 {
1243 const char *symref_target;
walker.c
+4 -2
@@ -215,8 +215,10 @@ static int interpret_target(struct walker *walker, char *target, struct object_i
215 return -1;
216 }
217
218 -static int mark_complete(const char *path, const struct object_id *oid,
219 - int flag, void *cb_data)
218 +static int mark_complete(const char *UNUSED(path),
219 + const struct object_id *oid,
220 + int UNUSED(flag),
221 + void *UNUSED(cb_data))
222 {
223 struct commit *commit = lookup_commit_reference_gently(the_repository,
224 oid, 1);