git-compat-util.h: use "UNUSED", not "UNUSED(var)"

As reported in [1] the "UNUSED(var)" macro introduced in 2174b8c75de (Merge branch 'jk/unused-annotation' into next, 2022-08-24) breaks coccinelle's parsing of our sources in files where it occurs. Let's instead partially go with the approach suggested in [2] of making this not take an argument. As noted in [1] "coccinelle" will ignore such tokens in argument lists that it doesn't know about, and it's less of a surprise to syntax highlighters. This undoes the "help us notice when a parameter marked as unused is actually use" part of 9b240347543 (git-compat-util: add UNUSED macro, 2022-08-19), a subsequent commit will further tweak the macro to implement a replacement for that functionality. 1. https://lore.kernel.org/git/220825.86ilmg4mil.gmgdl@evledraar.gmail.com/ 2. https://lore.kernel.org/git/220819.868rnk54ju.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Aug 25, 2022 at 19:09 UTC 5cf88fd8b059235b21ee2f72b17bf1f421a9c4e7
93 files changed +269 -269
add-interactive.c
+1 -1
@@ -430,7 +430,7 @@ struct pathname_entry {
430 struct file_item *item;
431 };
432
433 -static int pathname_entry_cmp(const void *UNUSED(cmp_data),
433 +static int pathname_entry_cmp(const void *cmp_data UNUSED,
434 const struct hashmap_entry *he1,
435 const struct hashmap_entry *he2,
436 const void *name)
archive-tar.c
+2 -2
@@ -367,7 +367,7 @@ static struct archiver *find_tar_filter(const char *name, size_t len)
367 }
368
369 static int tar_filter_config(const char *var, const char *value,
370 - void *UNUSED(data))
370 + void *data UNUSED)
371 {
372 struct archiver *ar;
373 const char *name;
@@ -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 *UNUSED(ar),
424 +static int write_tar_archive(const struct archiver *ar UNUSED,
425 struct archiver_args *args)
426 {
427 int err = 0;
archive-zip.c
+2 -2
@@ -613,12 +613,12 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
613 }
614
615 static int archive_zip_config(const char *var, const char *value,
616 - void *UNUSED(data))
616 + void *data UNUSED)
617 {
618 return userdiff_config(var, value);
619 }
620
621 -static int write_zip_archive(const struct archiver *UNUSED(ar),
621 +static int write_zip_archive(const struct archiver *ar UNUSED,
622 struct archiver_args *args)
623 {
624 int err;
archive.c
+1 -1
@@ -382,7 +382,7 @@ struct path_exists_context {
382 struct archiver_args *args;
383 };
384
385 -static int reject_entry(const struct object_id *UNUSED(oid),
385 +static int reject_entry(const struct object_id *oid UNUSED,
386 struct strbuf *base,
387 const char *filename, unsigned mode,
388 void *context)
attr.c
+2 -2
@@ -61,10 +61,10 @@ struct attr_hash_entry {
61 };
62
63 /* attr_hashmap comparison function */
64 -static int attr_hash_entry_cmp(const void *UNUSED(cmp_data),
64 +static int attr_hash_entry_cmp(const void *cmp_data UNUSED,
65 const struct hashmap_entry *eptr,
66 const struct hashmap_entry *entry_or_key,
67 - const void *UNUSED(keydata))
67 + const void *keydata UNUSED)
68 {
69 const struct attr_hash_entry *a, *b;
70
bisect.c
+3 -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 UNUSED(flags), void *UNUSED(cb_data))
444 + int flags UNUSED, void *cb_data UNUSED)
445 {
446 struct strbuf good_prefix = STRBUF_INIT;
447 strbuf_addstr(&good_prefix, term_good);
@@ -1161,8 +1161,8 @@ int estimate_bisect_steps(int all)
1161 }
1162
1163 static int mark_for_removal(const char *refname,
1164 - const struct object_id *UNUSED(oid),
1165 - int UNUSED(flag), void *cb_data)
1164 + const struct object_id *oid UNUSED,
1165 + int flag UNUSED, void *cb_data)
1166 {
1167 struct string_list *refs = cb_data;
1168 char *ref = xstrfmt("refs/bisect%s", refname);
bloom.c
+2 -2
@@ -163,10 +163,10 @@ void init_bloom_filters(void)
163 init_bloom_filter_slab(&bloom_filters);
164 }
165
166 -static int pathmap_cmp(const void *UNUSED(hashmap_cmp_fn_data),
166 +static int pathmap_cmp(const void *hashmap_cmp_fn_data UNUSED,
167 const struct hashmap_entry *eptr,
168 const struct hashmap_entry *entry_or_key,
169 - const void *UNUSED(keydata))
169 + const void *keydata UNUSED)
170 {
171 const struct pathmap_hash_entry *e1, *e2;
172
builtin/am.c
+1 -1
@@ -2301,7 +2301,7 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
2301 return 0;
2302 }
2303
2304 -static int git_am_config(const char *k, const char *v, void *UNUSED(cb))
2304 +static int git_am_config(const char *k, const char *v, void *cb UNUSED)
2305 {
2306 int status;
2307
builtin/bisect--helper.c
+6 -6
@@ -329,9 +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 *UNUSED(refname),
333 - const struct object_id *UNUSED(oid),
334 - int UNUSED(flag), void *cb_data)
332 +static int inc_nr(const char *refname UNUSED,
333 + const struct object_id *oid UNUSED,
334 + int flag UNUSED, void *cb_data)
335 {
336 unsigned int *nr = (unsigned int *)cb_data;
337 (*nr)++;
@@ -519,7 +519,7 @@ finish:
519 }
520
521 static int add_bisect_ref(const char *refname, const struct object_id *oid,
522 - int UNUSED(flags), void *cb)
522 + int flags UNUSED, void *cb)
523 {
524 struct add_bisect_ref_data *data = cb;
525
@@ -1135,9 +1135,9 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a
1135 return res;
1136 }
1137
1138 -static int get_first_good(const char *UNUSED(refname),
1138 +static int get_first_good(const char *refname UNUSED,
1139 const struct object_id *oid,
1140 - int UNUSED(flag), void *cb_data)
1140 + int flag UNUSED, void *cb_data)
1141 {
1142 oidcpy(cb_data, oid);
1143 return 1;
builtin/checkout.c
+2 -2
@@ -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 *UNUSED(context))
128 + const char *pathname, unsigned mode, void *context UNUSED)
129 {
130 int len;
131 struct cache_entry *ce;
@@ -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 UNUSED(flags), void *cb_data)
993 + int flags UNUSED, void *cb_data)
994 {
995 add_pending_oid(cb_data, refname, oid, UNINTERESTING);
996 return 0;
builtin/commit-graph.c
+1 -1
@@ -179,7 +179,7 @@ static int write_option_max_new_filters(const struct option *opt,
179 }
180
181 static int git_commit_graph_write_config(const char *var, const char *value,
182 - void *UNUSED(cb))
182 + void *cb UNUSED)
183 {
184 if (!strcmp(var, "commitgraph.maxnewfilters"))
185 write_opts.max_new_filters = git_config_int(var, value);
builtin/config.c
+3 -3
@@ -208,7 +208,7 @@ static void show_config_scope(struct strbuf *buf)
208 }
209
210 static int show_all_config(const char *key_, const char *value_,
211 - void *UNUSED(cb))
211 + void *cb UNUSED)
212 {
213 if (show_origin || show_scope) {
214 struct strbuf buf = STRBUF_INIT;
@@ -460,7 +460,7 @@ static const char *get_colorbool_slot;
460 static char parsed_color[COLOR_MAXLEN];
461
462 static int git_get_color_config(const char *var, const char *value,
463 - void *UNUSED(cb))
463 + void *cb UNUSED)
464 {
465 if (!strcmp(var, get_color_slot)) {
466 if (!value)
@@ -492,7 +492,7 @@ static int get_colorbool_found;
492 static int get_diff_color_found;
493 static int get_color_ui_found;
494 static int git_get_colorbool_config(const char *var, const char *value,
495 - void *UNUSED(data))
495 + void *data UNUSED)
496 {
497 if (!strcmp(var, get_colorbool_slot))
498 get_colorbool_found = git_config_colorbool(var, value);
builtin/describe.c
+2 -2
@@ -63,7 +63,7 @@ static const char *prio_names[] = {
63 N_("head"), N_("lightweight"), N_("annotated"),
64 };
65
66 -static int commit_name_neq(const void *UNUSED(cmp_data),
66 +static int commit_name_neq(const void *cmp_data UNUSED,
67 const struct hashmap_entry *eptr,
68 const struct hashmap_entry *entry_or_key,
69 const void *peeled)
@@ -141,7 +141,7 @@ static void add_to_known_names(const char *path,
141 }
142
143 static int get_name(const char *path, const struct object_id *oid,
144 - int UNUSED(flag), void *UNUSED(cb_data))
144 + int flag UNUSED, void *cb_data UNUSED)
145 {
146 int is_tag = 0;
147 struct object_id peeled;
builtin/difftool.c
+5 -5
@@ -125,10 +125,10 @@ struct working_tree_entry {
125 char path[FLEX_ARRAY];
126 };
127
128 -static int working_tree_entry_cmp(const void *UNUSED(cmp_data),
128 +static int working_tree_entry_cmp(const void *cmp_data UNUSED,
129 const struct hashmap_entry *eptr,
130 const struct hashmap_entry *entry_or_key,
131 - const void *UNUSED(keydata))
131 + const void *keydata UNUSED)
132 {
133 const struct working_tree_entry *a, *b;
134
@@ -148,10 +148,10 @@ struct pair_entry {
148 const char path[FLEX_ARRAY];
149 };
150
151 -static int pair_cmp(const void *UNUSED(cmp_data),
151 +static int pair_cmp(const void *cmp_data UNUSED,
152 const struct hashmap_entry *eptr,
153 const struct hashmap_entry *entry_or_key,
154 - const void *UNUSED(keydata))
154 + const void *keydata UNUSED)
155 {
156 const struct pair_entry *a, *b;
157
@@ -184,7 +184,7 @@ struct path_entry {
184 char path[FLEX_ARRAY];
185 };
186
187 -static int path_entry_cmp(const void *UNUSED(cmp_data),
187 +static int path_entry_cmp(const void *cmp_data UNUSED,
188 const struct hashmap_entry *eptr,
189 const struct hashmap_entry *entry_or_key,
190 const void *key)
builtin/fast-export.c
+1 -1
@@ -119,7 +119,7 @@ struct anonymized_entry_key {
119 size_t orig_len;
120 };
121
122 -static int anonymized_entry_cmp(const void *UNUSED(cmp_data),
122 +static int anonymized_entry_cmp(const void *cmp_data UNUSED,
123 const struct hashmap_entry *eptr,
124 const struct hashmap_entry *entry_or_key,
125 const void *keydata)
builtin/fast-import.c
+1 -1
@@ -46,7 +46,7 @@ struct object_entry {
46 depth : DEPTH_BITS;
47 };
48
49 -static int object_entry_hashcmp(const void *UNUSED(map_data),
49 +static int object_entry_hashcmp(const void *map_data UNUSED,
50 const struct hashmap_entry *eptr,
51 const struct hashmap_entry *entry_or_key,
52 const void *keydata)
builtin/fetch.c
+4 -4
@@ -301,7 +301,7 @@ struct refname_hash_entry {
301 char refname[FLEX_ARRAY];
302 };
303
304 -static int refname_hash_entry_cmp(const void *UNUSED(hashmap_cmp_fn_data),
304 +static int refname_hash_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
305 const struct hashmap_entry *eptr,
306 const struct hashmap_entry *entry_or_key,
307 const void *keydata)
@@ -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 UNUSED(flag), void *cbdata)
332 + int flag UNUSED, void *cbdata)
333 {
334 struct hashmap *refname_map = cbdata;
335
@@ -1462,9 +1462,9 @@ static void set_option(struct transport *transport, const char *name, const char
1462 }
1463
1464
1465 -static int add_oid(const char *UNUSED(refname),
1465 +static int add_oid(const char *refname UNUSED,
1466 const struct object_id *oid,
1467 - int UNUSED(flags), void *cb_data)
1467 + int flags UNUSED, void *cb_data)
1468 {
1469 struct oid_array *oids = cb_data;
1470
builtin/fsck.c
+6 -6
@@ -488,9 +488,9 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
488 }
489
490 static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid,
491 - const char *UNUSED(email),
492 - timestamp_t timestamp, int UNUSED(tz),
493 - const char *UNUSED(message), void *cb_data)
491 + const char *email UNUSED,
492 + timestamp_t timestamp, int tz UNUSED,
493 + const char *message UNUSED, void *cb_data)
494 {
495 const char *refname = cb_data;
496
@@ -504,8 +504,8 @@ static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid
504 }
505
506 static int fsck_handle_reflog(const char *logname,
507 - const struct object_id *UNUSED(oid),
508 - int UNUSED(flag), void *cb_data)
507 + const struct object_id *oid UNUSED,
508 + int flag UNUSED, void *cb_data)
509 {
510 struct strbuf refname = STRBUF_INIT;
511
@@ -516,7 +516,7 @@ static int fsck_handle_reflog(const char *logname,
516 }
517
518 static int fsck_handle_ref(const char *refname, const struct object_id *oid,
519 - int UNUSED(flag), void *UNUSED(cb_data))
519 + int flag UNUSED, void *cb_data UNUSED)
520 {
521 struct object *obj;
522
builtin/gc.c
+2 -2
@@ -782,9 +782,9 @@ struct cg_auto_data {
782 int limit;
783 };
784
785 -static int dfs_on_ref(const char *UNUSED(refname),
785 +static int dfs_on_ref(const char *refname UNUSED,
786 const struct object_id *oid,
787 - int UNUSED(flags),
787 + int flags UNUSED,
788 void *cb_data)
789 {
790 struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
builtin/log.c
+2 -2
@@ -645,8 +645,8 @@ 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 *UNUSED(oid),
649 - struct strbuf *UNUSED(base),
648 +static int show_tree_object(const struct object_id *oid UNUSED,
649 + struct strbuf *base UNUSED,
650 const char *pathname, unsigned mode,
651 void *context)
652 {
builtin/ls-tree.c
+5 -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 *UNUSED(context))
145 + const char *pathname, unsigned mode, void *context UNUSED)
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 *UNUSED(context))
216 + void *context UNUSED)
217 {
218 int early;
219 int recurse;
@@ -231,7 +231,7 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
231
232 static int show_tree_long(const struct object_id *oid, struct strbuf *base,
233 const char *pathname, unsigned mode,
234 - void *UNUSED(context))
234 + void *context UNUSED)
235 {
236 int early;
237 int recurse;
@@ -261,7 +261,7 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
261
262 static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
263 const char *pathname, unsigned mode,
264 - void *UNUSED(context))
264 + void *context UNUSED)
265 {
266 int early;
267 int recurse;
@@ -282,7 +282,7 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
282
283 static int show_tree_object(const struct object_id *oid, struct strbuf *base,
284 const char *pathname, unsigned mode,
285 - void *UNUSED(context))
285 + void *context UNUSED)
286 {
287 int early;
288 int recurse;
builtin/multi-pack-index.c
+1 -1
@@ -78,7 +78,7 @@ static struct option *add_common_options(struct option *prev)
78 }
79
80 static int git_multi_pack_index_write_config(const char *var, const char *value,
81 - void *UNUSED(cb))
81 + void *cb UNUSED)
82 {
83 if (!strcmp(var, "pack.writebitmaphashcache")) {
84 if (git_config_bool(var, value))
builtin/name-rev.c
+1 -1
@@ -345,7 +345,7 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
345 }
346
347 static int name_ref(const char *path, const struct object_id *oid,
348 - int UNUSED(flags), void *cb_data)
348 + int flags UNUSED, 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
+6 -6
@@ -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 *UNUSED(path), const struct object_id *oid,
763 - int UNUSED(flag), void *UNUSED(cb_data))
762 +static int mark_tagged(const char *path UNUSED, const struct object_id *oid,
763 + int flag UNUSED, void *cb_data UNUSED)
764 {
765 struct object_id peeled;
766 struct object_entry *entry = packlist_find(&to_pack, oid);
@@ -3035,8 +3035,8 @@ static void add_tag_chain(const struct object_id *oid)
3035 }
3036 }
3037
3038 -static int add_ref_tag(const char *UNUSED(tag), const struct object_id *oid,
3039 - int UNUSED(flag), void *UNUSED(cb_data))
3038 +static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid,
3039 + int flag UNUSED, void *cb_data UNUSED)
3040 {
3041 struct object_id peeled;
3042
@@ -3952,8 +3952,8 @@ static void record_recent_commit(struct commit *commit, void *data)
3952
3953 static int mark_bitmap_preferred_tip(const char *refname,
3954 const struct object_id *oid,
3955 - int UNUSED(flags),
3956 - void *UNUSED(data))
3955 + int flags UNUSED,
3956 + void *data UNUSED)
3957 {
3958 struct object_id peeled;
3959 struct object *object;
builtin/receive-pack.c
+2 -2
@@ -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 UNUSED(flag), void *data)
294 + int flag UNUSED, void *data)
295 {
296 struct oidset *seen = data;
297 const char *path = strip_namespace(path_full);
@@ -465,7 +465,7 @@ static void rp_error(const char *err, ...)
465 va_end(params);
466 }
467
468 -static int copy_to_sideband(int in, int UNUSED(out), void *UNUSED(arg))
468 +static int copy_to_sideband(int in, int out UNUSED, void *arg UNUSED)
469 {
470 char data[128];
471 int keepalive_active = 0;
builtin/reflog.c
+2 -2
@@ -56,8 +56,8 @@ struct worktree_reflogs {
56 struct string_list reflogs;
57 };
58
59 -static int collect_reflog(const char *ref, const struct object_id *UNUSED(oid),
60 - int UNUSED(flags), void *cb_data)
59 +static int collect_reflog(const char *ref, const struct object_id *oid UNUSED,
60 + int flags UNUSED, void *cb_data)
61 {
62 struct worktree_reflogs *cb = cb_data;
63 struct worktree *worktree = cb->worktree;
builtin/remote.c
+7 -7
@@ -265,7 +265,7 @@ static const char *abbrev_ref(const char *name, const char *prefix)
265 #define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
266
267 static int config_read_branches(const char *key, const char *value,
268 - void *UNUSED(data))
268 + void *data UNUSED)
269 {
270 const char *orig_key = key;
271 char *name;
@@ -539,8 +539,8 @@ struct branches_for_remote {
539 };
540
541 static int add_branch_for_removal(const char *refname,
542 - const struct object_id *UNUSED(oid),
543 - int UNUSED(flags), void *cb_data)
542 + const struct object_id *oid UNUSED,
543 + int flags UNUSED, void *cb_data)
544 {
545 struct branches_for_remote *branches = cb_data;
546 struct refspec_item refspec;
@@ -582,8 +582,8 @@ struct rename_info {
582 };
583
584 static int read_remote_branches(const char *refname,
585 - const struct object_id *UNUSED(oid),
586 - int UNUSED(flags), void *cb_data)
585 + const struct object_id *oid UNUSED,
586 + int flags UNUSED, void *cb_data)
587 {
588 struct rename_info *rename = cb_data;
589 struct strbuf buf = STRBUF_INIT;
@@ -956,7 +956,7 @@ static void free_remote_ref_states(struct ref_states *states)
956 }
957
958 static int append_ref_to_tracked_list(const char *refname,
959 - const struct object_id *UNUSED(oid),
959 + const struct object_id *oid UNUSED,
960 int flags, void *cb_data)
961 {
962 struct ref_states *states = cb_data;
@@ -1486,7 +1486,7 @@ static int prune(int argc, const char **argv)
1486 return result;
1487 }
1488
1489 -static int get_remote_default(const char *key, const char *UNUSED(value), void *priv)
1489 +static int get_remote_default(const char *key, const char *value UNUSED, void *priv)
1490 {
1491 if (strcmp(key, "remotes.default") == 0) {
1492 int *found = priv;
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 *UNUSED(refname),
517 +static int midx_snapshot_ref_one(const char *refname UNUSED,
518 const struct object_id *oid,
519 - int UNUSED(flag), void *_data)
519 + int flag UNUSED, void *_data)
520 {
521 struct midx_snapshot_ref_data *data = _data;
522 struct object_id peeled;
builtin/rev-parse.c
+2 -2
@@ -196,7 +196,7 @@ static int show_default(void)
196 }
197
198 static int show_reference(const char *refname, const struct object_id *oid,
199 - int UNUSED(flag), void *UNUSED(cb_data))
199 + int flag UNUSED, void *cb_data UNUSED)
200 {
201 if (ref_excluded(ref_excludes, refname))
202 return 0;
@@ -205,7 +205,7 @@ static int show_reference(const char *refname, const struct object_id *oid,
205 }
206
207 static int anti_reference(const char *refname, const struct object_id *oid,
208 - int UNUSED(flag), void *UNUSED(cb_data))
208 + int flag UNUSED, void *cb_data UNUSED)
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 UNUSED(flag), void *UNUSED(cb_data))
407 + int flag UNUSED, void *cb_data UNUSED)
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 UNUSED(flag), void *UNUSED(cb_data))
422 + int flag UNUSED, void *cb_data UNUSED)
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 UNUSED(flag), void *UNUSED(cb_data))
437 + int flag UNUSED, void *cb_data UNUSED)
438 {
439 if (!starts_with(refname, "refs/tags/"))
440 return 0;
builtin/show-ref.c
+3 -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 UNUSED(flag), void *UNUSED(cbdata))
50 + int flag UNUSED, void *cbdata UNUSED)
51 {
52 if (show_head && !strcmp(refname, "HEAD"))
53 goto match;
@@ -78,8 +78,8 @@ match:
78 }
79
80 static int add_existing(const char *refname,
81 - const struct object_id *UNUSED(oid),
82 - int UNUSED(flag), void *cbdata)
81 + const struct object_id *oid UNUSED,
82 + int flag UNUSED, void *cbdata)
83 {
84 struct string_list *list = (struct string_list *)cbdata;
85 string_list_insert(list, refname);
builtin/stash.c
+6 -6
@@ -638,12 +638,12 @@ cleanup:
638 return ret;
639 }
640
641 -static int reject_reflog_ent(struct object_id *UNUSED(ooid),
642 - struct object_id *UNUSED(noid),
643 - const char *UNUSED(email),
644 - timestamp_t UNUSED(timestamp),
645 - int UNUSED(tz), const char *UNUSED(message),
646 - void *UNUSED(cb_data))
641 +static int reject_reflog_ent(struct object_id *ooid UNUSED,
642 + struct object_id *noid UNUSED,
643 + const char *email UNUSED,
644 + timestamp_t timestamp UNUSED,
645 + int tz UNUSED, const char *message UNUSED,
646 + void *cb_data UNUSED)
647 {
648 return 1;
649 }
builtin/submodule--helper.c
+2 -2
@@ -622,9 +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 *UNUSED(refname),
625 +static int handle_submodule_head_ref(const char *refname UNUSED,
626 const struct object_id *oid,
627 - int UNUSED(flags),
627 + int flags UNUSED,
628 void *cb_data)
629 {
630 struct object_id *output = cb_data;
color.c
+1 -1
@@ -415,7 +415,7 @@ int want_color_fd(int fd, int var)
415 return var;
416 }
417
418 -int git_color_config(const char *var, const char *value, void *UNUSED(cb))
418 +int git_color_config(const char *var, const char *value, void *cb UNUSED)
419 {
420 if (!strcmp(var, "color.ui")) {
421 git_use_color_default = git_config_colorbool(var, value);
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 *UNUSED(refname),
1642 +static int add_ref_to_set(const char *refname UNUSED,
1643 const struct object_id *oid,
1644 - int UNUSED(flags), void *cb_data)
1644 + int flags UNUSED, void *cb_data)
1645 {
1646 struct object_id peeled;
1647 struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
commit.c
+3 -3
@@ -951,9 +951,9 @@ static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
951 }
952
953 static int collect_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
954 - const char *UNUSED(ident),
955 - timestamp_t UNUSED(timestamp), int UNUSED(tz),
956 - const char *UNUSED(message), void *cbdata)
954 + const char *ident UNUSED,
955 + timestamp_t timestamp UNUSED, int tz UNUSED,
956 + const char *message UNUSED, void *cbdata)
957 {
958 struct rev_collect *revs = cbdata;
959
compat/terminal.c
+1 -1
@@ -477,7 +477,7 @@ struct escape_sequence_entry {
477 char sequence[FLEX_ARRAY];
478 };
479
480 -static int sequence_entry_cmp(const void *UNUSED(hashmap_cmp_fn_data),
480 +static int sequence_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
481 const struct escape_sequence_entry *e1,
482 const struct escape_sequence_entry *e2,
483 const void *keydata)
config.c
+4 -4
@@ -362,8 +362,8 @@ static void populate_remote_urls(struct config_include_data *inc)
362 current_parsing_scope = store_scope;
363 }
364
365 -static int forbid_remote_url(const char *var, const char *UNUSED(value),
366 - void *UNUSED(data))
365 +static int forbid_remote_url(const char *var, const char *value UNUSED,
366 + void *data UNUSED)
367 {
368 const char *remote_name;
369 size_t remote_name_len;
@@ -2338,10 +2338,10 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
2338 return 0;
2339 }
2340
2341 -static int config_set_element_cmp(const void *UNUSED(cmp_data),
2341 +static int config_set_element_cmp(const void *cmp_data UNUSED,
2342 const struct hashmap_entry *eptr,
2343 const struct hashmap_entry *entry_or_key,
2344 - const void *UNUSED(keydata))
2344 + const void *keydata UNUSED)
2345 {
2346 const struct config_set_element *e1, *e2;
2347
convert.c
+2 -2
@@ -619,7 +619,7 @@ struct filter_params {
619 const char *path;
620 };
621
622 -static int filter_buffer_or_fd(int UNUSED(in), int out, void *data)
622 +static int filter_buffer_or_fd(int in UNUSED, int out, void *data)
623 {
624 /*
625 * Spawn cmd and feed the buffer contents through its stdin.
@@ -1008,7 +1008,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
1008 return 0;
1009 }
1010
1011 -static int read_convert_config(const char *var, const char *value, void *UNUSED(cb))
1011 +static int read_convert_config(const char *var, const char *value, void *cb UNUSED)
1012 {
1013 const char *key, *name;
1014 size_t namelen;
delta-islands.c
+2 -2
@@ -316,7 +316,7 @@ static regex_t *island_regexes;
316 static unsigned int island_regexes_alloc, island_regexes_nr;
317 static const char *core_island_name;
318
319 -static int island_config_callback(const char *k, const char *v, void *UNUSED(cb))
319 +static int island_config_callback(const char *k, const char *v, void *cb UNUSED)
320 {
321 if (!strcmp(k, "pack.island")) {
322 struct strbuf re = STRBUF_INIT;
@@ -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 UNUSED(flags), void *UNUSED(data))
368 + int flags UNUSED, void *data UNUSED)
369 {
370 /*
371 * We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
diff.c
+2 -2
@@ -265,7 +265,7 @@ void init_diff_ui_defaults(void)
265 }
266
267 int git_diff_heuristic_config(const char *var, const char *value,
268 - void *UNUSED(cb))
268 + void *cb UNUSED)
269 {
270 if (!strcmp(var, "diff.indentheuristic"))
271 diff_indent_heuristic = git_config_bool(var, value);
@@ -917,7 +917,7 @@ struct interned_diff_symbol {
917 static int interned_diff_symbol_cmp(const void *hashmap_cmp_fn_data,
918 const struct hashmap_entry *eptr,
919 const struct hashmap_entry *entry_or_key,
920 - const void *UNUSED(keydata))
920 + const void *keydata UNUSED)
921 {
922 const struct diff_options *diffopt = hashmap_cmp_fn_data;
923 const struct emitted_diff_symbol *a, *b;
dir.c
+2 -2
@@ -655,10 +655,10 @@ void parse_path_pattern(const char **pattern,
655 *patternlen = len;
656 }
657
658 -int pl_hashmap_cmp(const void *UNUSED(cmp_data),
658 +int pl_hashmap_cmp(const void *cmp_data UNUSED,
659 const struct hashmap_entry *a,
660 const struct hashmap_entry *b,
661 - const void *UNUSED(key))
661 + const void *key UNUSED)
662 {
663 const struct pattern_entry *ee1 =
664 container_of(a, struct pattern_entry, ent);
environment.c
+2 -2
@@ -333,10 +333,10 @@ static void set_git_dir_1(const char *path)
333 setup_git_env(path);
334 }
335
336 -static void update_relative_gitdir(const char *UNUSED(name),
336 +static void update_relative_gitdir(const char *name UNUSED,
337 const char *old_cwd,
338 const char *new_cwd,
339 - void *UNUSED(data))
339 + void *data UNUSED)
340 {
341 char *path = reparent_relative_path(old_cwd, new_cwd, get_git_dir());
342 struct tmp_objdir *tmp_objdir = tmp_objdir_unapply_primary_odb();
fetch-pack.c
+6 -6
@@ -176,9 +176,9 @@ 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 *UNUSED(refname),
179 +static int rev_list_insert_ref_oid(const char *refname UNUSED,
180 const struct object_id *oid,
181 - int UNUSED(flag),
181 + int flag UNUSED,
182 void *cb_data)
183 {
184 return rev_list_insert_ref(cb_data, oid);
@@ -582,10 +582,10 @@ static int mark_complete(const struct object_id *oid)
582 return 0;
583 }
584
585 -static int mark_complete_oid(const char *UNUSED(refname),
585 +static int mark_complete_oid(const char *refname UNUSED,
586 const struct object_id *oid,
587 - int UNUSED(flag),
588 - void *UNUSED(cb_data))
587 + int flag UNUSED,
588 + void *cb_data UNUSED)
589 {
590 return mark_complete(oid);
591 }
@@ -823,7 +823,7 @@ static int everything_local(struct fetch_pack_args *args,
823 return retval;
824 }
825
826 -static int sideband_demux(int UNUSED(in), int out, void *data)
826 +static int sideband_demux(int in UNUSED, int out, void *data)
827 {
828 int *xd = data;
829 int ret;
git-compat-util.h
+6 -6
@@ -190,9 +190,9 @@ struct strbuf;
190 #define _SGI_SOURCE 1
191
192 #if defined(__GNUC__)
193 -#define UNUSED(var) UNUSED_##var __attribute__((unused))
193 +#define UNUSED __attribute__((unused))
194 #else
195 -#define UNUSED(var) UNUSED_##var
195 +#define UNUSED
196 #endif
197
198 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
@@ -403,9 +403,9 @@ typedef uintmax_t timestamp_t;
403 #endif
404
405 #ifndef platform_core_config
406 -static inline int noop_core_config(const char *UNUSED(var),
407 - const char *UNUSED(value),
408 - void *UNUSED(cb))
406 +static inline int noop_core_config(const char *var UNUSED,
407 + const char *value UNUSED,
408 + void *cb UNUSED)
409 {
410 return 0;
411 }
@@ -499,7 +499,7 @@ static inline void extract_id_from_env(const char *env, uid_t *id)
499 }
500
501 static inline int is_path_owned_by_current_uid(const char *path,
502 - struct strbuf *UNUSED(report))
502 + struct strbuf *report UNUSED)
503 {
504 struct stat st;
505 uid_t euid;
gpg-interface.c
+1 -1
@@ -699,7 +699,7 @@ void set_signing_key(const char *key)
699 configured_signing_key = xstrdup(key);
700 }
701
702 -int git_gpg_config(const char *var, const char *value, void *UNUSED(cb))
702 +int git_gpg_config(const char *var, const char *value, void *cb UNUSED)
703 {
704 struct gpg_format *fmt = NULL;
705 char *fmtname = NULL;
hashmap.c
+5 -5
@@ -142,10 +142,10 @@ static inline struct hashmap_entry **find_entry_ptr(const struct hashmap *map,
142 return e;
143 }
144
145 -static int always_equal(const void *UNUSED(cmp_data),
146 - const struct hashmap_entry *UNUSED(entry1),
147 - const struct hashmap_entry *UNUSED(entry2),
148 - const void *UNUSED(keydata))
145 +static int always_equal(const void *cmp_data UNUSED,
146 + const struct hashmap_entry *entry1 UNUSED,
147 + const struct hashmap_entry *entry2 UNUSED,
148 + const void *keydata UNUSED)
149 {
150 return 0;
151 }
@@ -313,7 +313,7 @@ struct pool_entry {
313 unsigned char data[FLEX_ARRAY];
314 };
315
316 -static int pool_entry_cmp(const void *UNUSED(cmp_data),
316 +static int pool_entry_cmp(const void *cmp_data UNUSED,
317 const struct hashmap_entry *eptr,
318 const struct hashmap_entry *entry_or_key,
319 const void *keydata)
help.c
+2 -2
@@ -782,8 +782,8 @@ struct similar_ref_cb {
782 };
783
784 static int append_similar_ref(const char *refname,
785 - const struct object_id *UNUSED(oid),
786 - int UNUSED(flags), void *cb_data)
785 + const struct object_id *oid UNUSED,
786 + int flags UNUSED, 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 UNUSED(flag), void *cb_data)
508 + int flag UNUSED, void *cb_data)
509 {
510 const char *name_nons = strip_namespace(name);
511 struct strbuf *buf = cb_data;
ident.c
+1 -1
@@ -668,7 +668,7 @@ static int set_ident(const char *var, const char *value)
668 return 0;
669 }
670
671 -int git_ident_config(const char *var, const char *value, void *UNUSED(data))
671 +int git_ident_config(const char *var, const char *value, void *data UNUSED)
672 {
673 if (!strcmp(var, "user.useconfigonly")) {
674 ident_use_config_only = git_config_bool(var, value);
ll-merge.c
+1 -1
@@ -250,7 +250,7 @@ static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail;
250 static const char *default_ll_merge;
251
252 static int read_merge_config(const char *var, const char *value,
253 - void *UNUSED(cb))
253 + void *cb UNUSED)
254 {
255 struct ll_merge_driver *fn;
256 const char *key, *name;
log-tree.c
+1 -1
@@ -135,7 +135,7 @@ 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 UNUSED(flags),
138 + int flags UNUSED,
139 void *cb_data)
140 {
141 struct object *obj;
ls-refs.c
+1 -1
@@ -137,7 +137,7 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
137 }
138
139 static int ls_refs_config(const char *var, const char *value,
140 - void *UNUSED(data))
140 + void *data UNUSED)
141 {
142 /*
143 * We only serve fetches over v2 for now, so respect only "uploadpack"
merge-recursive.c
+6 -6
@@ -45,7 +45,7 @@ struct path_hashmap_entry {
45 char path[FLEX_ARRAY];
46 };
47
48 -static int path_hashmap_cmp(const void *UNUSED(cmp_data),
48 +static int path_hashmap_cmp(const void *cmp_data UNUSED,
49 const struct hashmap_entry *eptr,
50 const struct hashmap_entry *entry_or_key,
51 const void *keydata)
@@ -89,10 +89,10 @@ static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap,
89 return hashmap_get_entry(hashmap, &key, ent, NULL);
90 }
91
92 -static int dir_rename_cmp(const void *UNUSED(cmp_data),
92 +static int dir_rename_cmp(const void *cmp_data UNUSED,
93 const struct hashmap_entry *eptr,
94 const struct hashmap_entry *entry_or_key,
95 - const void *UNUSED(keydata))
95 + const void *keydata UNUSED)
96 {
97 const struct dir_rename_entry *e1, *e2;
98
@@ -134,10 +134,10 @@ static struct collision_entry *collision_find_entry(struct hashmap *hashmap,
134 return hashmap_get_entry(hashmap, &key, ent, NULL);
135 }
136
137 -static int collision_cmp(const void *UNUSED(cmp_data),
137 +static int collision_cmp(const void *cmp_data UNUSED,
138 const struct hashmap_entry *eptr,
139 const struct hashmap_entry *entry_or_key,
140 - const void *UNUSED(keydata))
140 + const void *keydata UNUSED)
141 {
142 const struct collision_entry *e1, *e2;
143
@@ -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 *UNUSED(oid),
459 +static int save_files_dirs(const struct object_id *oid UNUSED,
460 struct strbuf *base, const char *path,
461 unsigned int mode, void *context)
462 {
name-hash.c
+2 -2
@@ -18,7 +18,7 @@ struct dir_entry {
18 char name[FLEX_ARRAY];
19 };
20
21 -static int dir_entry_cmp(const void *UNUSED(cmp_data),
21 +static int dir_entry_cmp(const void *cmp_data UNUSED,
22 const struct hashmap_entry *eptr,
23 const struct hashmap_entry *entry_or_key,
24 const void *keydata)
@@ -120,7 +120,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
120 add_dir_entry(istate, ce);
121 }
122
123 -static int cache_entry_cmp(const void *UNUSED(cmp_data),
123 +static int cache_entry_cmp(const void *cmp_data UNUSED,
124 const struct hashmap_entry *eptr,
125 const struct hashmap_entry *entry_or_key,
126 const void *remove)
negotiator/default.c
+2 -2
@@ -36,8 +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 UNUSED(flag),
40 - void *UNUSED(cb_data))
39 + int flag UNUSED,
40 + void *cb_data UNUSED)
41 {
42 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
43
negotiator/skipping.c
+2 -2
@@ -72,8 +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 UNUSED(flag),
76 - void *UNUSED(cb_data))
75 + int flag UNUSED,
76 + void *cb_data UNUSED)
77 {
78 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
79
notes.c
+2 -2
@@ -925,8 +925,8 @@ out:
925 }
926
927 static int string_list_add_one_ref(const char *refname,
928 - const struct object_id *UNUSED(oid),
929 - int UNUSED(flag), void *cb)
928 + const struct object_id *oid UNUSED,
929 + int flag UNUSED, void *cb)
930 {
931 struct string_list *refs = cb;
932 if (!unsorted_string_list_has_string(refs, refname))
object-name.c
+6 -6
@@ -1306,7 +1306,7 @@ struct handle_one_ref_cb {
1306 };
1307
1308 static int handle_one_ref(const char *path, const struct object_id *oid,
1309 - int UNUSED(flag),
1309 + int flag UNUSED,
1310 void *cb_data)
1311 {
1312 struct handle_one_ref_cb *cb = cb_data;
@@ -1385,11 +1385,11 @@ struct grab_nth_branch_switch_cbdata {
1385 struct strbuf *sb;
1386 };
1387
1388 -static int grab_nth_branch_switch(struct object_id *UNUSED(ooid),
1389 - struct object_id *UNUSED(noid),
1390 - const char *UNUSED(email),
1391 - timestamp_t UNUSED(timestamp),
1392 - int UNUSED(tz),
1388 +static int grab_nth_branch_switch(struct object_id *ooid UNUSED,
1389 + struct object_id *noid UNUSED,
1390 + const char *email UNUSED,
1391 + timestamp_t timestamp UNUSED,
1392 + int tz UNUSED,
1393 const char *message, void *cb_data)
1394 {
1395 struct grab_nth_branch_switch_cbdata *cb = cb_data;
object-store.h
+1 -1
@@ -141,7 +141,7 @@ struct packed_git {
141
142 struct multi_pack_index;
143
144 -static inline int pack_map_entry_cmp(const void *UNUSED(cmp_data),
144 +static inline int pack_map_entry_cmp(const void *cmp_data UNUSED,
145 const struct hashmap_entry *entry,
146 const struct hashmap_entry *entry2,
147 const void *keydata)
oidmap.c
+1 -1
@@ -1,7 +1,7 @@
1 #include "cache.h"
2 #include "oidmap.h"
3
4 -static int oidmap_neq(const void *UNUSED(hashmap_cmp_fn_data),
4 +static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,
5 const struct hashmap_entry *e1,
6 const struct hashmap_entry *e2,
7 const void *keydata)
packfile.c
+1 -1
@@ -1392,7 +1392,7 @@ static int delta_base_cache_key_eq(const struct delta_base_cache_key *a,
1392 return a->p == b->p && a->base_offset == b->base_offset;
1393 }
1394
1395 -static int delta_base_cache_hash_cmp(const void *UNUSED(cmp_data),
1395 +static int delta_base_cache_hash_cmp(const void *cmp_data UNUSED,
1396 const struct hashmap_entry *va,
1397 const struct hashmap_entry *vb,
1398 const void *vkey)
pager.c
+1 -1
@@ -39,7 +39,7 @@ static void wait_for_pager_signal(int signo)
39 }
40
41 static int core_pager_config(const char *var, const char *value,
42 - void *UNUSED(data))
42 + void *data UNUSED)
43 {
44 if (!strcmp(var, "core.pager"))
45 return git_config_string(&pager_program, var, value);
patch-ids.c
+1 -1
@@ -38,7 +38,7 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
38 static int patch_id_neq(const void *cmpfn_data,
39 const struct hashmap_entry *eptr,
40 const struct hashmap_entry *entry_or_key,
41 - const void *UNUSED(keydata))
41 + const void *keydata UNUSED)
42 {
43 /* NEEDSWORK: const correctness? */
44 struct diff_options *opt = (void *)cmpfn_data;
pretty.c
+1 -1
@@ -44,7 +44,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
44 }
45
46 static int git_pretty_formats_config(const char *var, const char *value,
47 - void *UNUSED(cb))
47 + void *cb UNUSED)
48 {
49 struct cmt_fmt_map *commit_format = NULL;
50 const char *name;
range-diff.c
+1 -1
@@ -224,7 +224,7 @@ cleanup:
224 return ret;
225 }
226
227 -static int patch_util_cmp(const void *UNUSED(cmp_data),
227 +static int patch_util_cmp(const void *cmp_data UNUSED,
228 const struct patch_util *a,
229 const struct patch_util *b,
230 const char *keydata)
ref-filter.c
+1 -1
@@ -89,7 +89,7 @@ struct ref_to_worktree_entry {
89 struct worktree *wt; /* key is wt->head_ref */
90 };
91
92 -static int ref_to_worktree_map_cmpfnc(const void *UNUSED(lookupdata),
92 +static int ref_to_worktree_map_cmpfnc(const void *lookupdata UNUSED,
93 const struct hashmap_entry *eptr,
94 const struct hashmap_entry *kptr,
95 const void *keydata_aka_refname)
reflog.c
+9 -9
@@ -240,9 +240,9 @@ static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit
240 * Return true iff the specified reflog entry should be expired.
241 */
242 int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
243 - const char *UNUSED(email),
244 - timestamp_t timestamp, int UNUSED(tz),
245 - const char *UNUSED(message), void *cb_data)
243 + const char *email UNUSED,
244 + timestamp_t timestamp, int tz UNUSED,
245 + const char *message UNUSED, void *cb_data)
246 {
247 struct expire_reflog_policy_cb *cb = cb_data;
248 struct commit *old_commit, *new_commit;
@@ -295,7 +295,7 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
295 return expire;
296 }
297
298 -static int push_tip_to_list(const char *UNUSED(refname),
298 +static int push_tip_to_list(const char *refname UNUSED,
299 const struct object_id *oid,
300 int flags, void *cb_data)
301 {
@@ -380,11 +380,11 @@ void reflog_expiry_cleanup(void *cb_data)
380 }
381 }
382
383 -int count_reflog_ent(struct object_id *UNUSED(ooid),
384 - struct object_id *UNUSED(noid),
385 - const char *UNUSED(email),
386 - timestamp_t timestamp, int UNUSED(tz),
387 - const char *UNUSED(message), void *cb_data)
383 +int count_reflog_ent(struct object_id *ooid UNUSED,
384 + struct object_id *noid UNUSED,
385 + const char *email UNUSED,
386 + timestamp_t timestamp, int tz UNUSED,
387 + const char *message UNUSED, void *cb_data)
388 {
389 struct cmd_reflog_expire_cb *cb = cb_data;
390 if (!cb->expire_total || timestamp < cb->expire_total)
refs.c
+6 -6
@@ -359,7 +359,7 @@ struct warn_if_dangling_data {
359 };
360
361 static int warn_if_dangling_symref(const char *refname,
362 - const struct object_id *UNUSED(oid),
362 + const struct object_id *oid UNUSED,
363 int flags, void *cb_data)
364 {
365 struct warn_if_dangling_data *d = cb_data;
@@ -894,7 +894,7 @@ static void set_read_ref_cutoffs(struct read_ref_at_cb *cb,
894 }
895
896 static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
897 - const char *UNUSED(email),
897 + const char *email UNUSED,
898 timestamp_t timestamp, int tz,
899 const char *message, void *cb_data)
900 {
@@ -936,9 +936,9 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
936 return cb->found_it;
937 }
938
939 -static int read_ref_at_ent_newest(struct object_id *UNUSED(ooid),
939 +static int read_ref_at_ent_newest(struct object_id *ooid UNUSED,
940 struct object_id *noid,
941 - const char *UNUSED(email),
941 + const char *email UNUSED,
942 timestamp_t timestamp, int tz,
943 const char *message, void *cb_data)
944 {
@@ -951,7 +951,7 @@ static int read_ref_at_ent_newest(struct object_id *UNUSED(ooid),
951 }
952
953 static int read_ref_at_ent_oldest(struct object_id *ooid, struct object_id *noid,
954 - const char *UNUSED(email),
954 + const char *email UNUSED,
955 timestamp_t timestamp, int tz,
956 const char *message, void *cb_data)
957 {
@@ -1815,7 +1815,7 @@ struct ref_store_hash_entry
1815 char name[FLEX_ARRAY];
1816 };
1817
1818 -static int ref_store_hash_cmp(const void *UNUSED(cmp_data),
1818 +static int ref_store_hash_cmp(const void *cmp_data UNUSED,
1819 const struct hashmap_entry *eptr,
1820 const struct hashmap_entry *entry_or_key,
1821 const void *keydata)
refs/files-backend.c
+7 -7
@@ -2202,8 +2202,8 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
2202 return ok;
2203 }
2204
2205 -static int files_reflog_iterator_peel(struct ref_iterator *UNUSED(ref_iterator),
2206 - struct object_id *UNUSED(peeled))
2205 +static int files_reflog_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
2206 + struct object_id *peeled UNUSED)
2207 {
2208 BUG("ref_iterator_peel() called for reflog_iterator");
2209 }
@@ -2257,7 +2257,7 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
2257 static enum iterator_selection reflog_iterator_select(
2258 struct ref_iterator *iter_worktree,
2259 struct ref_iterator *iter_common,
2260 - void *UNUSED(cb_data))
2260 + void *cb_data UNUSED)
2261 {
2262 if (iter_worktree) {
2263 /*
@@ -2985,7 +2985,7 @@ cleanup:
2985
2986 static int files_transaction_abort(struct ref_store *ref_store,
2987 struct ref_transaction *transaction,
2988 - struct strbuf *UNUSED(err))
2988 + struct strbuf *err UNUSED)
2989 {
2990 struct files_ref_store *refs =
2991 files_downcast(ref_store, 0, "ref_transaction_abort");
@@ -2995,8 +2995,8 @@ 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 *UNUSED(oid),
2999 - int UNUSED(flags),
2998 + const struct object_id *oid UNUSED,
2999 + int flags UNUSED,
3000 void *cb_data)
3001 {
3002 struct string_list *affected_refnames = cb_data;
@@ -3261,7 +3261,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
3261 return -1;
3262 }
3263
3264 -static int files_init_db(struct ref_store *ref_store, struct strbuf *UNUSED(err))
3264 +static int files_init_db(struct ref_store *ref_store, struct strbuf *err UNUSED)
3265 {
3266 struct files_ref_store *refs =
3267 files_downcast(ref_store, REF_STORE_WRITE, "init_db");
refs/iterator.c
+3 -3
@@ -51,8 +51,8 @@ static int empty_ref_iterator_advance(struct ref_iterator *ref_iterator)
51 return ref_iterator_abort(ref_iterator);
52 }
53
54 -static int empty_ref_iterator_peel(struct ref_iterator *UNUSED(ref_iterator),
55 - struct object_id *UNUSED(peeled))
54 +static int empty_ref_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
55 + struct object_id *peeled UNUSED)
56 {
57 BUG("peel called for empty iterator");
58 }
@@ -238,7 +238,7 @@ struct ref_iterator *merge_ref_iterator_begin(
238 */
239 static enum iterator_selection overlay_iterator_select(
240 struct ref_iterator *front, struct ref_iterator *back,
241 - void *UNUSED(cb_data))
241 + void *cb_data UNUSED)
242 {
243 int cmp;
244
refs/packed-backend.c
+8 -8
@@ -726,7 +726,7 @@ static struct snapshot *get_snapshot(struct packed_ref_store *refs)
726 }
727
728 static int packed_read_raw_ref(struct ref_store *ref_store, const char *refname,
729 - struct object_id *oid, struct strbuf *UNUSED(referent),
729 + struct object_id *oid, struct strbuf *referent UNUSED,
730 unsigned int *type, int *failure_errno)
731 {
732 struct packed_ref_store *refs =
@@ -1078,8 +1078,8 @@ int packed_refs_is_locked(struct ref_store *ref_store)
1078 static const char PACKED_REFS_HEADER[] =
1079 "# pack-refs with: peeled fully-peeled sorted \n";
1080
1081 -static int packed_init_db(struct ref_store *UNUSED(ref_store),
1082 - struct strbuf *UNUSED(err))
1081 +static int packed_init_db(struct ref_store *ref_store UNUSED,
1082 + struct strbuf *err UNUSED)
1083 {
1084 /* Nothing to do. */
1085 return 0;
@@ -1474,7 +1474,7 @@ failure:
1474
1475 static int packed_transaction_abort(struct ref_store *ref_store,
1476 struct ref_transaction *transaction,
1477 - struct strbuf *UNUSED(err))
1477 + struct strbuf *err UNUSED)
1478 {
1479 struct packed_ref_store *refs = packed_downcast(
1480 ref_store,
@@ -1513,7 +1513,7 @@ cleanup:
1513 return ret;
1514 }
1515
1516 -static int packed_initial_transaction_commit(struct ref_store *UNUSED(ref_store),
1516 +static int packed_initial_transaction_commit(struct ref_store *ref_store UNUSED,
1517 struct ref_transaction *transaction,
1518 struct strbuf *err)
1519 {
@@ -1569,8 +1569,8 @@ static int packed_delete_refs(struct ref_store *ref_store, const char *msg,
1569 return ret;
1570 }
1571
1572 -static int packed_pack_refs(struct ref_store *UNUSED(ref_store),
1573 - unsigned int UNUSED(flags))
1572 +static int packed_pack_refs(struct ref_store *ref_store UNUSED,
1573 + unsigned int flags UNUSED)
1574 {
1575 /*
1576 * Packed refs are already packed. It might be that loose refs
@@ -1580,7 +1580,7 @@ static int packed_pack_refs(struct ref_store *UNUSED(ref_store),
1580 return 0;
1581 }
1582
1583 -static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *UNUSED(ref_store))
1583 +static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_store UNUSED)
1584 {
1585 return empty_ref_iterator_begin();
1586 }
remote.c
+12 -12
@@ -86,7 +86,7 @@ struct remotes_hash_key {
86 int len;
87 };
88
89 -static int remotes_hash_cmp(const void *UNUSED(cmp_data),
89 +static int remotes_hash_cmp(const void *cmp_data UNUSED,
90 const struct hashmap_entry *eptr,
91 const struct hashmap_entry *entry_or_key,
92 const void *keydata)
@@ -170,7 +170,7 @@ struct branches_hash_key {
170 int len;
171 };
172
173 -static int branches_hash_cmp(const void *UNUSED(cmp_data),
173 +static int branches_hash_cmp(const void *cmp_data UNUSED,
174 const struct hashmap_entry *eptr,
175 const struct hashmap_entry *entry_or_key,
176 const void *keydata)
@@ -2320,7 +2320,7 @@ 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 UNUSED(flag),
2323 + int flag UNUSED,
2324 void *cb_data)
2325 {
2326 struct ref ***local_tail = cb_data;
@@ -2577,22 +2577,22 @@ struct check_and_collect_until_cb_data {
2577 };
2578
2579 /* Get the timestamp of the latest entry. */
2580 -static int peek_reflog(struct object_id *UNUSED(o_oid),
2581 - struct object_id *UNUSED(n_oid),
2582 - const char *UNUSED(ident),
2583 - timestamp_t timestamp, int UNUSED(tz),
2584 - const char *UNUSED(message), void *cb_data)
2580 +static int peek_reflog(struct object_id *o_oid UNUSED,
2581 + struct object_id *n_oid UNUSED,
2582 + const char *ident UNUSED,
2583 + timestamp_t timestamp, int tz UNUSED,
2584 + const char *message UNUSED, void *cb_data)
2585 {
2586 timestamp_t *ts = cb_data;
2587 *ts = timestamp;
2588 return 1;
2589 }
2590
2591 -static int check_and_collect_until(struct object_id *UNUSED(o_oid),
2591 +static int check_and_collect_until(struct object_id *o_oid UNUSED,
2592 struct object_id *n_oid,
2593 - const char *UNUSED(ident),
2594 - timestamp_t timestamp, int UNUSED(tz),
2595 - const char *UNUSED(message), void *cb_data)
2593 + const char *ident UNUSED,
2594 + timestamp_t timestamp, int tz UNUSED,
2595 + const char *message UNUSED, void *cb_data)
2596 {
2597 struct commit *commit;
2598 struct check_and_collect_until_cb_data *cb = cb_data;
replace-object.c
+2 -2
@@ -9,8 +9,8 @@
9 static int register_replace_ref(struct repository *r,
10 const char *refname,
11 const struct object_id *oid,
12 - int UNUSED(flag),
13 - void *UNUSED(cb_data))
12 + int flag UNUSED,
13 + void *cb_data UNUSED)
14 {
15 /* Get sha1 from refname */
16 const char *slash = strrchr(refname, '/');
revision.c
+9 -9
@@ -119,10 +119,10 @@ struct path_and_oids_entry {
119 struct oidset trees;
120 };
121
122 -static int path_and_oids_cmp(const void *UNUSED(hashmap_cmp_fn_data),
122 +static int path_and_oids_cmp(const void *hashmap_cmp_fn_data UNUSED,
123 const struct hashmap_entry *eptr,
124 const struct hashmap_entry *entry_or_key,
125 - const void *UNUSED(keydata))
125 + const void *keydata UNUSED)
126 {
127 const struct path_and_oids_entry *e1, *e2;
128
@@ -1543,7 +1543,7 @@ 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 UNUSED(flag),
1546 + int flag UNUSED,
1547 void *cb_data)
1548 {
1549 struct all_refs_cb *cb = cb_data;
@@ -1619,10 +1619,10 @@ static void handle_one_reflog_commit(struct object_id *oid, void *cb_data)
1619 }
1620
1621 static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
1622 - const char *UNUSED(email),
1623 - timestamp_t UNUSED(timestamp),
1624 - int UNUSED(tz),
1625 - const char *UNUSED(message),
1622 + const char *email UNUSED,
1623 + timestamp_t timestamp UNUSED,
1624 + int tz UNUSED,
1625 + const char *message UNUSED,
1626 void *cb_data)
1627 {
1628 handle_one_reflog_commit(ooid, cb_data);
@@ -1631,8 +1631,8 @@ static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
1631 }
1632
1633 static int handle_one_reflog(const char *refname_in_wt,
1634 - const struct object_id *UNUSED(oid),
1635 - int UNUSED(flag), void *cb_data)
1634 + const struct object_id *oid UNUSED,
1635 + int flag UNUSED, void *cb_data)
1636 {
1637 struct all_refs_cb *cb = cb_data;
1638 struct strbuf refname = STRBUF_INIT;
send-pack.c
+1 -1
@@ -266,7 +266,7 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
266 return ret;
267 }
268
269 -static int sideband_demux(int UNUSED(in), int out, void *data)
269 +static int sideband_demux(int in UNUSED, int out, void *data)
270 {
271 int *fd = data, ret;
272 if (async_with_fork())
sequencer.c
+2 -2
@@ -5254,7 +5254,7 @@ struct labels_entry {
5254 char label[FLEX_ARRAY];
5255 };
5256
5257 -static int labels_cmp(const void *UNUSED(fndata),
5257 +static int labels_cmp(const void *fndata UNUSED,
5258 const struct hashmap_entry *eptr,
5259 const struct hashmap_entry *entry_or_key, const void *key)
5260 {
@@ -6132,7 +6132,7 @@ struct subject2item_entry {
6132 char subject[FLEX_ARRAY];
6133 };
6134
6135 -static int subject2item_cmp(const void *UNUSED(fndata),
6135 +static int subject2item_cmp(const void *fndata UNUSED,
6136 const struct hashmap_entry *eptr,
6137 const struct hashmap_entry *entry_or_key,
6138 const void *key)
server-info.c
+1 -1
@@ -147,7 +147,7 @@ out:
147 }
148
149 static int add_info_ref(const char *path, const struct object_id *oid,
150 - int UNUSED(flag),
150 + int flag UNUSED,
151 void *cb_data)
152 {
153 struct update_info_ctx *uic = cb_data;
shallow.c
+5 -5
@@ -604,10 +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 *UNUSED(refname),
607 +static int mark_uninteresting(const char *refname UNUSED,
608 const struct object_id *oid,
609 - int UNUSED(flags),
610 - void *UNUSED(cb_data))
609 + int flags UNUSED,
610 + void *cb_data UNUSED)
611 {
612 struct commit *commit = lookup_commit_reference_gently(the_repository,
613 oid, 1);
@@ -717,9 +717,9 @@ struct commit_array {
717 int nr, alloc;
718 };
719
720 -static int add_ref(const char *UNUSED(refname),
720 +static int add_ref(const char *refname UNUSED,
721 const struct object_id *oid,
722 - int UNUSED(flags),
722 + int flags UNUSED,
723 void *cb_data)
724 {
725 struct commit_array *ca = cb_data;
strbuf.c
+1 -1
@@ -436,7 +436,7 @@ void strbuf_expand(struct strbuf *sb, const char *format, expand_fn_t fn,
436
437 size_t strbuf_expand_literal_cb(struct strbuf *sb,
438 const char *placeholder,
439 - void *context)
439 + void *context UNUSED)
440 {
441 int ch;
442
streaming.c
+3 -3
@@ -328,9 +328,9 @@ static int close_istream_pack_non_delta(struct git_istream *st)
328 }
329
330 static int open_istream_pack_non_delta(struct git_istream *st,
331 - struct repository *UNUSED(r),
332 - const struct object_id *UNUSED(oid),
333 - enum object_type *UNUSED(type))
331 + struct repository *r UNUSED,
332 + const struct object_id *oid UNUSED,
333 + enum object_type *type UNUSED)
334 {
335 struct pack_window *window;
336 enum object_type in_pack_type;
strmap.c
+2 -2
@@ -2,10 +2,10 @@
2 #include "strmap.h"
3 #include "mem-pool.h"
4
5 -int cmp_strmap_entry(const void *UNUSED(hashmap_cmp_fn_data),
5 +int cmp_strmap_entry(const void *hashmap_cmp_fn_data UNUSED,
6 const struct hashmap_entry *entry1,
7 const struct hashmap_entry *entry2,
8 - const void *UNUSED(keydata))
8 + const void *keydata UNUSED)
9 {
10 const struct strmap_entry *e1, *e2;
11
sub-process.c
+2 -2
@@ -5,10 +5,10 @@
5 #include "sigchain.h"
6 #include "pkt-line.h"
7
8 -int cmd2process_cmp(const void *UNUSED(cmp_data),
8 +int cmd2process_cmp(const void *cmp_data UNUSED,
9 const struct hashmap_entry *eptr,
10 const struct hashmap_entry *entry_or_key,
11 - const void *UNUSED(keydata))
11 + const void *keydata UNUSED)
12 {
13 const struct subprocess_entry *e1, *e2;
14
submodule-config.c
+4 -4
@@ -38,10 +38,10 @@ enum lookup_type {
38 lookup_path
39 };
40
41 -static int config_path_cmp(const void *UNUSED(cmp_data),
41 +static int config_path_cmp(const void *cmp_data UNUSED,
42 const struct hashmap_entry *eptr,
43 const struct hashmap_entry *entry_or_key,
44 - const void *UNUSED(keydata))
44 + const void *keydata UNUSED)
45 {
46 const struct submodule_entry *a, *b;
47
@@ -52,10 +52,10 @@ static int config_path_cmp(const void *UNUSED(cmp_data),
52 !oideq(&a->config->gitmodules_oid, &b->config->gitmodules_oid);
53 }
54
55 -static int config_name_cmp(const void *UNUSED(cmp_data),
55 +static int config_name_cmp(const void *cmp_data UNUSED,
56 const struct hashmap_entry *eptr,
57 const struct hashmap_entry *entry_or_key,
58 - const void *UNUSED(keydata))
58 + const void *keydata UNUSED)
59 {
60 const struct submodule_entry *a, *b;
61
submodule.c
+6 -6
@@ -214,7 +214,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
214
215 /* Cheap function that only determines if we're interested in submodules at all */
216 int git_default_submodule_config(const char *var, const char *value,
217 - void *UNUSED(cb))
217 + void *cb UNUSED)
218 {
219 if (!strcmp(var, "submodule.recurse")) {
220 int v = git_config_bool(var, value) ?
@@ -941,9 +941,9 @@ static void free_submodules_data(struct string_list *submodules)
941 string_list_clear(submodules, 1);
942 }
943
944 -static int has_remote(const char *UNUSED(refname),
945 - const struct object_id *UNUSED(oid),
946 - int UNUSED(flags), void *UNUSED(cb_data))
944 +static int has_remote(const char *refname UNUSED,
945 + const struct object_id *oid UNUSED,
946 + int flags UNUSED, void *cb_data UNUSED)
947 {
948 return 1;
949 }
@@ -1245,9 +1245,9 @@ int push_unpushed_submodules(struct repository *r,
1245 return ret;
1246 }
1247
1248 -static int append_oid_to_array(const char *UNUSED(ref),
1248 +static int append_oid_to_array(const char *ref UNUSED,
1249 const struct object_id *oid,
1250 - int UNUSED(flags), void *data)
1250 + int flags UNUSED, void *data)
1251 {
1252 struct oid_array *array = data;
1253 oid_array_append(array, oid);
t/helper/test-config.c
+1 -1
@@ -37,7 +37,7 @@
37 *
38 */
39
40 -static int iterate_cb(const char *var, const char *value, void *UNUSED(data))
40 +static int iterate_cb(const char *var, const char *value, void *data UNUSED)
41 {
42 static int nr;
43
t/helper/test-ref-store.c
+2 -2
@@ -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 *UNUSED(cb_data))
164 + int flags, void *cb_data UNUSED)
165 {
166 printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
167 return 0;
@@ -207,7 +207,7 @@ static int cmd_for_each_reflog(struct ref_store *refs, const char **argv)
207
208 static int each_reflog(struct object_id *old_oid, struct object_id *new_oid,
209 const char *committer, timestamp_t timestamp,
210 - int tz, const char *msg, void *UNUSED(cb_data))
210 + int tz, const char *msg, void *cb_data UNUSED)
211 {
212 printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid),
213 oid_to_hex(new_oid), committer, timestamp, tz,
t/helper/test-userdiff.c
+1 -1
@@ -12,7 +12,7 @@ static int driver_cb(struct userdiff_driver *driver,
12 return 0;
13 }
14
15 -static int cmd__userdiff_config(const char *var, const char *value, void *UNUSED(cb))
15 +static int cmd__userdiff_config(const char *var, const char *value, void *cb UNUSED)
16 {
17 if (userdiff_config(var, value) < 0)
18 return -1;
trailer.c
+2 -2
@@ -479,7 +479,7 @@ static struct {
479 };
480
481 static int git_trailer_default_config(const char *conf_key, const char *value,
482 - void *UNUSED(cb))
482 + void *cb UNUSED)
483 {
484 const char *trailer_item, *variable_name;
485
@@ -511,7 +511,7 @@ static int git_trailer_default_config(const char *conf_key, const char *value,
511 }
512
513 static int git_trailer_config(const char *conf_key, const char *value,
514 - void *UNUSED(cb))
514 + void *cb UNUSED)
515 {
516 const char *trailer_item, *variable_name;
517 struct arg_item *item;
transport.c
+1 -1
@@ -142,7 +142,7 @@ static void get_refs_from_bundle_inner(struct transport *transport)
142
143 static struct ref *get_refs_from_bundle(struct transport *transport,
144 int for_push,
145 - struct transport_ls_refs_options *UNUSED(transport_options))
145 + struct transport_ls_refs_options *transport_options UNUSED)
146 {
147 struct bundle_transport_data *data = transport->data;
148 struct ref *result = NULL;
upload-pack.c
+3 -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 UNUSED(flag), void *UNUSED(cb_data))
1173 + int flag UNUSED, void *cb_data UNUSED)
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 UNUSED(flag), void *cb_data)
1197 + int flag UNUSED, 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"
@@ -1237,7 +1237,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
1237 }
1238
1239 static int find_symref(const char *refname,
1240 - const struct object_id *UNUSED(oid),
1240 + const struct object_id *oid UNUSED,
1241 int flag, void *cb_data)
1242 {
1243 const char *symref_target;
walker.c
+3 -3
@@ -215,10 +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 *UNUSED(path),
218 +static int mark_complete(const char *path UNUSED,
219 const struct object_id *oid,
220 - int UNUSED(flag),
221 - void *UNUSED(cb_data))
220 + int flag UNUSED,
221 + void *cb_data UNUSED)
222 {
223 struct commit *commit = lookup_commit_reference_gently(the_repository,
224 oid, 1);
wt-status.c
+8 -8
@@ -947,11 +947,11 @@ static void wt_longstatus_print_changed(struct wt_status *s)
947 wt_longstatus_print_trailer(s);
948 }
949
950 -static int stash_count_refs(struct object_id *UNUSED(ooid),
951 - struct object_id *UNUSED(noid),
952 - const char *UNUSED(email),
953 - timestamp_t UNUSED(timestamp), int UNUSED(tz),
954 - const char *UNUSED(message), void *cb_data)
950 +static int stash_count_refs(struct object_id *ooid UNUSED,
951 + struct object_id *noid UNUSED,
952 + const char *email UNUSED,
953 + timestamp_t timestamp UNUSED, int tz UNUSED,
954 + const char *message UNUSED, void *cb_data)
955 {
956 int *c = cb_data;
957 (*c)++;
@@ -1614,10 +1614,10 @@ struct grab_1st_switch_cbdata {
1614 struct object_id noid;
1615 };
1616
1617 -static int grab_1st_switch(struct object_id *UNUSED(ooid),
1617 +static int grab_1st_switch(struct object_id *ooid UNUSED,
1618 struct object_id *noid,
1619 - const char *UNUSED(email),
1620 - timestamp_t UNUSED(timestamp), int UNUSED(tz),
1619 + const char *email UNUSED,
1620 + timestamp_t timestamp UNUSED, int tz UNUSED,
1621 const char *message, void *cb_data)
1622 {
1623 struct grab_1st_switch_cbdata *cb = cb_data;