Git fork

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>

authored by

Ævar Arnfjörð Bjarmason and committed by
Junio C Hamano
5cf88fd8 776515ef

+269 -269
+1 -1
add-interactive.c
··· 430 430 struct file_item *item; 431 431 }; 432 432 433 - static int pathname_entry_cmp(const void *UNUSED(cmp_data), 433 + static int pathname_entry_cmp(const void *cmp_data UNUSED, 434 434 const struct hashmap_entry *he1, 435 435 const struct hashmap_entry *he2, 436 436 const void *name)
+2 -2
archive-tar.c
··· 367 367 } 368 368 369 369 static int tar_filter_config(const char *var, const char *value, 370 - void *UNUSED(data)) 370 + void *data UNUSED) 371 371 { 372 372 struct archiver *ar; 373 373 const char *name; ··· 421 421 return tar_filter_config(var, value, cb); 422 422 } 423 423 424 - static int write_tar_archive(const struct archiver *UNUSED(ar), 424 + static int write_tar_archive(const struct archiver *ar UNUSED, 425 425 struct archiver_args *args) 426 426 { 427 427 int err = 0;
+2 -2
archive-zip.c
··· 613 613 } 614 614 615 615 static int archive_zip_config(const char *var, const char *value, 616 - void *UNUSED(data)) 616 + void *data UNUSED) 617 617 { 618 618 return userdiff_config(var, value); 619 619 } 620 620 621 - static int write_zip_archive(const struct archiver *UNUSED(ar), 621 + static int write_zip_archive(const struct archiver *ar UNUSED, 622 622 struct archiver_args *args) 623 623 { 624 624 int err;
+1 -1
archive.c
··· 382 382 struct archiver_args *args; 383 383 }; 384 384 385 - static int reject_entry(const struct object_id *UNUSED(oid), 385 + static int reject_entry(const struct object_id *oid UNUSED, 386 386 struct strbuf *base, 387 387 const char *filename, unsigned mode, 388 388 void *context)
+2 -2
attr.c
··· 61 61 }; 62 62 63 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 65 const struct hashmap_entry *eptr, 66 66 const struct hashmap_entry *entry_or_key, 67 - const void *UNUSED(keydata)) 67 + const void *keydata UNUSED) 68 68 { 69 69 const struct attr_hash_entry *a, *b; 70 70
+3 -3
bisect.c
··· 441 441 } 442 442 443 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 445 { 446 446 struct strbuf good_prefix = STRBUF_INIT; 447 447 strbuf_addstr(&good_prefix, term_good); ··· 1161 1161 } 1162 1162 1163 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 1166 { 1167 1167 struct string_list *refs = cb_data; 1168 1168 char *ref = xstrfmt("refs/bisect%s", refname);
+2 -2
bloom.c
··· 163 163 init_bloom_filter_slab(&bloom_filters); 164 164 } 165 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 167 const struct hashmap_entry *eptr, 168 168 const struct hashmap_entry *entry_or_key, 169 - const void *UNUSED(keydata)) 169 + const void *keydata UNUSED) 170 170 { 171 171 const struct pathmap_hash_entry *e1, *e2; 172 172
+1 -1
builtin/am.c
··· 2301 2301 return 0; 2302 2302 } 2303 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 2305 { 2306 2306 int status; 2307 2307
+6 -6
builtin/bisect--helper.c
··· 329 329 return 0; 330 330 } 331 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 335 { 336 336 unsigned int *nr = (unsigned int *)cb_data; 337 337 (*nr)++; ··· 519 519 } 520 520 521 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 523 { 524 524 struct add_bisect_ref_data *data = cb; 525 525 ··· 1135 1135 return res; 1136 1136 } 1137 1137 1138 - static int get_first_good(const char *UNUSED(refname), 1138 + static int get_first_good(const char *refname UNUSED, 1139 1139 const struct object_id *oid, 1140 - int UNUSED(flag), void *cb_data) 1140 + int flag UNUSED, void *cb_data) 1141 1141 { 1142 1142 oidcpy(cb_data, oid); 1143 1143 return 1;
+2 -2
builtin/checkout.c
··· 125 125 } 126 126 127 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 129 { 130 130 int len; 131 131 struct cache_entry *ce; ··· 990 990 991 991 static int add_pending_uninteresting_ref(const char *refname, 992 992 const struct object_id *oid, 993 - int UNUSED(flags), void *cb_data) 993 + int flags UNUSED, void *cb_data) 994 994 { 995 995 add_pending_oid(cb_data, refname, oid, UNINTERESTING); 996 996 return 0;
+1 -1
builtin/commit-graph.c
··· 179 179 } 180 180 181 181 static int git_commit_graph_write_config(const char *var, const char *value, 182 - void *UNUSED(cb)) 182 + void *cb UNUSED) 183 183 { 184 184 if (!strcmp(var, "commitgraph.maxnewfilters")) 185 185 write_opts.max_new_filters = git_config_int(var, value);
+3 -3
builtin/config.c
··· 208 208 } 209 209 210 210 static int show_all_config(const char *key_, const char *value_, 211 - void *UNUSED(cb)) 211 + void *cb UNUSED) 212 212 { 213 213 if (show_origin || show_scope) { 214 214 struct strbuf buf = STRBUF_INIT; ··· 460 460 static char parsed_color[COLOR_MAXLEN]; 461 461 462 462 static int git_get_color_config(const char *var, const char *value, 463 - void *UNUSED(cb)) 463 + void *cb UNUSED) 464 464 { 465 465 if (!strcmp(var, get_color_slot)) { 466 466 if (!value) ··· 492 492 static int get_diff_color_found; 493 493 static int get_color_ui_found; 494 494 static int git_get_colorbool_config(const char *var, const char *value, 495 - void *UNUSED(data)) 495 + void *data UNUSED) 496 496 { 497 497 if (!strcmp(var, get_colorbool_slot)) 498 498 get_colorbool_found = git_config_colorbool(var, value);
+2 -2
builtin/describe.c
··· 63 63 N_("head"), N_("lightweight"), N_("annotated"), 64 64 }; 65 65 66 - static int commit_name_neq(const void *UNUSED(cmp_data), 66 + static int commit_name_neq(const void *cmp_data UNUSED, 67 67 const struct hashmap_entry *eptr, 68 68 const struct hashmap_entry *entry_or_key, 69 69 const void *peeled) ··· 141 141 } 142 142 143 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 145 { 146 146 int is_tag = 0; 147 147 struct object_id peeled;
+5 -5
builtin/difftool.c
··· 125 125 char path[FLEX_ARRAY]; 126 126 }; 127 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 129 const struct hashmap_entry *eptr, 130 130 const struct hashmap_entry *entry_or_key, 131 - const void *UNUSED(keydata)) 131 + const void *keydata UNUSED) 132 132 { 133 133 const struct working_tree_entry *a, *b; 134 134 ··· 148 148 const char path[FLEX_ARRAY]; 149 149 }; 150 150 151 - static int pair_cmp(const void *UNUSED(cmp_data), 151 + static int pair_cmp(const void *cmp_data UNUSED, 152 152 const struct hashmap_entry *eptr, 153 153 const struct hashmap_entry *entry_or_key, 154 - const void *UNUSED(keydata)) 154 + const void *keydata UNUSED) 155 155 { 156 156 const struct pair_entry *a, *b; 157 157 ··· 184 184 char path[FLEX_ARRAY]; 185 185 }; 186 186 187 - static int path_entry_cmp(const void *UNUSED(cmp_data), 187 + static int path_entry_cmp(const void *cmp_data UNUSED, 188 188 const struct hashmap_entry *eptr, 189 189 const struct hashmap_entry *entry_or_key, 190 190 const void *key)
+1 -1
builtin/fast-export.c
··· 119 119 size_t orig_len; 120 120 }; 121 121 122 - static int anonymized_entry_cmp(const void *UNUSED(cmp_data), 122 + static int anonymized_entry_cmp(const void *cmp_data UNUSED, 123 123 const struct hashmap_entry *eptr, 124 124 const struct hashmap_entry *entry_or_key, 125 125 const void *keydata)
+1 -1
builtin/fast-import.c
··· 46 46 depth : DEPTH_BITS; 47 47 }; 48 48 49 - static int object_entry_hashcmp(const void *UNUSED(map_data), 49 + static int object_entry_hashcmp(const void *map_data UNUSED, 50 50 const struct hashmap_entry *eptr, 51 51 const struct hashmap_entry *entry_or_key, 52 52 const void *keydata)
+4 -4
builtin/fetch.c
··· 301 301 char refname[FLEX_ARRAY]; 302 302 }; 303 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 305 const struct hashmap_entry *eptr, 306 306 const struct hashmap_entry *entry_or_key, 307 307 const void *keydata) ··· 329 329 330 330 static int add_one_refname(const char *refname, 331 331 const struct object_id *oid, 332 - int UNUSED(flag), void *cbdata) 332 + int flag UNUSED, void *cbdata) 333 333 { 334 334 struct hashmap *refname_map = cbdata; 335 335 ··· 1462 1462 } 1463 1463 1464 1464 1465 - static int add_oid(const char *UNUSED(refname), 1465 + static int add_oid(const char *refname UNUSED, 1466 1466 const struct object_id *oid, 1467 - int UNUSED(flags), void *cb_data) 1467 + int flags UNUSED, void *cb_data) 1468 1468 { 1469 1469 struct oid_array *oids = cb_data; 1470 1470
+6 -6
builtin/fsck.c
··· 488 488 } 489 489 490 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 494 { 495 495 const char *refname = cb_data; 496 496 ··· 504 504 } 505 505 506 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 509 { 510 510 struct strbuf refname = STRBUF_INIT; 511 511 ··· 516 516 } 517 517 518 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 520 { 521 521 struct object *obj; 522 522
+2 -2
builtin/gc.c
··· 782 782 int limit; 783 783 }; 784 784 785 - static int dfs_on_ref(const char *UNUSED(refname), 785 + static int dfs_on_ref(const char *refname UNUSED, 786 786 const struct object_id *oid, 787 - int UNUSED(flags), 787 + int flags UNUSED, 788 788 void *cb_data) 789 789 { 790 790 struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
+2 -2
builtin/log.c
··· 645 645 return 0; 646 646 } 647 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 650 const char *pathname, unsigned mode, 651 651 void *context) 652 652 {
+5 -5
builtin/ls-tree.c
··· 142 142 } 143 143 144 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 146 { 147 147 size_t baselen; 148 148 int recurse = 0; ··· 213 213 214 214 static int show_tree_default(const struct object_id *oid, struct strbuf *base, 215 215 const char *pathname, unsigned mode, 216 - void *UNUSED(context)) 216 + void *context UNUSED) 217 217 { 218 218 int early; 219 219 int recurse; ··· 231 231 232 232 static int show_tree_long(const struct object_id *oid, struct strbuf *base, 233 233 const char *pathname, unsigned mode, 234 - void *UNUSED(context)) 234 + void *context UNUSED) 235 235 { 236 236 int early; 237 237 int recurse; ··· 261 261 262 262 static int show_tree_name_only(const struct object_id *oid, struct strbuf *base, 263 263 const char *pathname, unsigned mode, 264 - void *UNUSED(context)) 264 + void *context UNUSED) 265 265 { 266 266 int early; 267 267 int recurse; ··· 282 282 283 283 static int show_tree_object(const struct object_id *oid, struct strbuf *base, 284 284 const char *pathname, unsigned mode, 285 - void *UNUSED(context)) 285 + void *context UNUSED) 286 286 { 287 287 int early; 288 288 int recurse;
+1 -1
builtin/multi-pack-index.c
··· 78 78 } 79 79 80 80 static int git_multi_pack_index_write_config(const char *var, const char *value, 81 - void *UNUSED(cb)) 81 + void *cb UNUSED) 82 82 { 83 83 if (!strcmp(var, "pack.writebitmaphashcache")) { 84 84 if (git_config_bool(var, value))
+1 -1
builtin/name-rev.c
··· 345 345 } 346 346 347 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 349 { 350 350 struct object *o = parse_object(the_repository, oid); 351 351 struct name_ref_data *data = cb_data;
+6 -6
builtin/pack-objects.c
··· 759 759 return WRITE_ONE_WRITTEN; 760 760 } 761 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 764 { 765 765 struct object_id peeled; 766 766 struct object_entry *entry = packlist_find(&to_pack, oid); ··· 3035 3035 } 3036 3036 } 3037 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 3040 { 3041 3041 struct object_id peeled; 3042 3042 ··· 3952 3952 3953 3953 static int mark_bitmap_preferred_tip(const char *refname, 3954 3954 const struct object_id *oid, 3955 - int UNUSED(flags), 3956 - void *UNUSED(data)) 3955 + int flags UNUSED, 3956 + void *data UNUSED) 3957 3957 { 3958 3958 struct object_id peeled; 3959 3959 struct object *object;
+2 -2
builtin/receive-pack.c
··· 291 291 } 292 292 293 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 295 { 296 296 struct oidset *seen = data; 297 297 const char *path = strip_namespace(path_full); ··· 465 465 va_end(params); 466 466 } 467 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 469 { 470 470 char data[128]; 471 471 int keepalive_active = 0;
+2 -2
builtin/reflog.c
··· 56 56 struct string_list reflogs; 57 57 }; 58 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 61 { 62 62 struct worktree_reflogs *cb = cb_data; 63 63 struct worktree *worktree = cb->worktree;
+7 -7
builtin/remote.c
··· 265 265 #define abbrev_branch(name) abbrev_ref((name), "refs/heads/") 266 266 267 267 static int config_read_branches(const char *key, const char *value, 268 - void *UNUSED(data)) 268 + void *data UNUSED) 269 269 { 270 270 const char *orig_key = key; 271 271 char *name; ··· 539 539 }; 540 540 541 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 544 { 545 545 struct branches_for_remote *branches = cb_data; 546 546 struct refspec_item refspec; ··· 582 582 }; 583 583 584 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 587 { 588 588 struct rename_info *rename = cb_data; 589 589 struct strbuf buf = STRBUF_INIT; ··· 956 956 } 957 957 958 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 960 int flags, void *cb_data) 961 961 { 962 962 struct ref_states *states = cb_data; ··· 1486 1486 return result; 1487 1487 } 1488 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 1490 { 1491 1491 if (strcmp(key, "remotes.default") == 0) { 1492 1492 int *found = priv;
+2 -2
builtin/repack.c
··· 514 514 int preferred; 515 515 }; 516 516 517 - static int midx_snapshot_ref_one(const char *UNUSED(refname), 517 + static int midx_snapshot_ref_one(const char *refname UNUSED, 518 518 const struct object_id *oid, 519 - int UNUSED(flag), void *_data) 519 + int flag UNUSED, void *_data) 520 520 { 521 521 struct midx_snapshot_ref_data *data = _data; 522 522 struct object_id peeled;
+2 -2
builtin/rev-parse.c
··· 196 196 } 197 197 198 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 200 { 201 201 if (ref_excluded(ref_excludes, refname)) 202 202 return 0; ··· 205 205 } 206 206 207 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 209 { 210 210 show_rev(REVERSED, oid, refname); 211 211 return 0;
+3 -3
builtin/show-branch.c
··· 404 404 } 405 405 406 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 408 { 409 409 struct object_id tmp; 410 410 int ofs = 11; ··· 419 419 } 420 420 421 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 423 { 424 424 struct object_id tmp; 425 425 int ofs = 13; ··· 434 434 } 435 435 436 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 438 { 439 439 if (!starts_with(refname, "refs/tags/")) 440 440 return 0;
+3 -3
builtin/show-ref.c
··· 47 47 } 48 48 49 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 51 { 52 52 if (show_head && !strcmp(refname, "HEAD")) 53 53 goto match; ··· 78 78 } 79 79 80 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 83 { 84 84 struct string_list *list = (struct string_list *)cbdata; 85 85 string_list_insert(list, refname);
+6 -6
builtin/stash.c
··· 638 638 return ret; 639 639 } 640 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 647 { 648 648 return 1; 649 649 }
+2 -2
builtin/submodule--helper.c
··· 622 622 printf("\n"); 623 623 } 624 624 625 - static int handle_submodule_head_ref(const char *UNUSED(refname), 625 + static int handle_submodule_head_ref(const char *refname UNUSED, 626 626 const struct object_id *oid, 627 - int UNUSED(flags), 627 + int flags UNUSED, 628 628 void *cb_data) 629 629 { 630 630 struct object_id *output = cb_data;
+1 -1
color.c
··· 415 415 return var; 416 416 } 417 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 419 { 420 420 if (!strcmp(var, "color.ui")) { 421 421 git_use_color_default = git_config_colorbool(var, value);
+2 -2
commit-graph.c
··· 1639 1639 struct progress *progress; 1640 1640 }; 1641 1641 1642 - static int add_ref_to_set(const char *UNUSED(refname), 1642 + static int add_ref_to_set(const char *refname UNUSED, 1643 1643 const struct object_id *oid, 1644 - int UNUSED(flags), void *cb_data) 1644 + int flags UNUSED, void *cb_data) 1645 1645 { 1646 1646 struct object_id peeled; 1647 1647 struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
+3 -3
commit.c
··· 951 951 } 952 952 953 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 957 { 958 958 struct rev_collect *revs = cbdata; 959 959
+1 -1
compat/terminal.c
··· 477 477 char sequence[FLEX_ARRAY]; 478 478 }; 479 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 481 const struct escape_sequence_entry *e1, 482 482 const struct escape_sequence_entry *e2, 483 483 const void *keydata)
+4 -4
config.c
··· 362 362 current_parsing_scope = store_scope; 363 363 } 364 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 367 { 368 368 const char *remote_name; 369 369 size_t remote_name_len; ··· 2338 2338 return 0; 2339 2339 } 2340 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 2342 const struct hashmap_entry *eptr, 2343 2343 const struct hashmap_entry *entry_or_key, 2344 - const void *UNUSED(keydata)) 2344 + const void *keydata UNUSED) 2345 2345 { 2346 2346 const struct config_set_element *e1, *e2; 2347 2347
+2 -2
convert.c
··· 619 619 const char *path; 620 620 }; 621 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 623 { 624 624 /* 625 625 * Spawn cmd and feed the buffer contents through its stdin. ··· 1008 1008 return 0; 1009 1009 } 1010 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 1012 { 1013 1013 const char *key, *name; 1014 1014 size_t namelen;
+2 -2
delta-islands.c
··· 316 316 static unsigned int island_regexes_alloc, island_regexes_nr; 317 317 static const char *core_island_name; 318 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 320 { 321 321 if (!strcmp(k, "pack.island")) { 322 322 struct strbuf re = STRBUF_INIT; ··· 365 365 } 366 366 367 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 369 { 370 370 /* 371 371 * We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
+2 -2
diff.c
··· 265 265 } 266 266 267 267 int git_diff_heuristic_config(const char *var, const char *value, 268 - void *UNUSED(cb)) 268 + void *cb UNUSED) 269 269 { 270 270 if (!strcmp(var, "diff.indentheuristic")) 271 271 diff_indent_heuristic = git_config_bool(var, value); ··· 917 917 static int interned_diff_symbol_cmp(const void *hashmap_cmp_fn_data, 918 918 const struct hashmap_entry *eptr, 919 919 const struct hashmap_entry *entry_or_key, 920 - const void *UNUSED(keydata)) 920 + const void *keydata UNUSED) 921 921 { 922 922 const struct diff_options *diffopt = hashmap_cmp_fn_data; 923 923 const struct emitted_diff_symbol *a, *b;
+2 -2
dir.c
··· 655 655 *patternlen = len; 656 656 } 657 657 658 - int pl_hashmap_cmp(const void *UNUSED(cmp_data), 658 + int pl_hashmap_cmp(const void *cmp_data UNUSED, 659 659 const struct hashmap_entry *a, 660 660 const struct hashmap_entry *b, 661 - const void *UNUSED(key)) 661 + const void *key UNUSED) 662 662 { 663 663 const struct pattern_entry *ee1 = 664 664 container_of(a, struct pattern_entry, ent);
+2 -2
environment.c
··· 333 333 setup_git_env(path); 334 334 } 335 335 336 - static void update_relative_gitdir(const char *UNUSED(name), 336 + static void update_relative_gitdir(const char *name UNUSED, 337 337 const char *old_cwd, 338 338 const char *new_cwd, 339 - void *UNUSED(data)) 339 + void *data UNUSED) 340 340 { 341 341 char *path = reparent_relative_path(old_cwd, new_cwd, get_git_dir()); 342 342 struct tmp_objdir *tmp_objdir = tmp_objdir_unapply_primary_odb();
+6 -6
fetch-pack.c
··· 176 176 return 0; 177 177 } 178 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 180 const struct object_id *oid, 181 - int UNUSED(flag), 181 + int flag UNUSED, 182 182 void *cb_data) 183 183 { 184 184 return rev_list_insert_ref(cb_data, oid); ··· 582 582 return 0; 583 583 } 584 584 585 - static int mark_complete_oid(const char *UNUSED(refname), 585 + static int mark_complete_oid(const char *refname UNUSED, 586 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 589 { 590 590 return mark_complete(oid); 591 591 } ··· 823 823 return retval; 824 824 } 825 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 827 { 828 828 int *xd = data; 829 829 int ret;
+6 -6
git-compat-util.h
··· 190 190 #define _SGI_SOURCE 1 191 191 192 192 #if defined(__GNUC__) 193 - #define UNUSED(var) UNUSED_##var __attribute__((unused)) 193 + #define UNUSED __attribute__((unused)) 194 194 #else 195 - #define UNUSED(var) UNUSED_##var 195 + #define UNUSED 196 196 #endif 197 197 198 198 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */ ··· 403 403 #endif 404 404 405 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 409 { 410 410 return 0; 411 411 } ··· 499 499 } 500 500 501 501 static inline int is_path_owned_by_current_uid(const char *path, 502 - struct strbuf *UNUSED(report)) 502 + struct strbuf *report UNUSED) 503 503 { 504 504 struct stat st; 505 505 uid_t euid;
+1 -1
gpg-interface.c
··· 699 699 configured_signing_key = xstrdup(key); 700 700 } 701 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 703 { 704 704 struct gpg_format *fmt = NULL; 705 705 char *fmtname = NULL;
+5 -5
hashmap.c
··· 142 142 return e; 143 143 } 144 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 149 { 150 150 return 0; 151 151 } ··· 313 313 unsigned char data[FLEX_ARRAY]; 314 314 }; 315 315 316 - static int pool_entry_cmp(const void *UNUSED(cmp_data), 316 + static int pool_entry_cmp(const void *cmp_data UNUSED, 317 317 const struct hashmap_entry *eptr, 318 318 const struct hashmap_entry *entry_or_key, 319 319 const void *keydata)
+2 -2
help.c
··· 782 782 }; 783 783 784 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 787 { 788 788 struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data); 789 789 char *branch = strrchr(refname, '/') + 1;
+1 -1
http-backend.c
··· 505 505 } 506 506 507 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 509 { 510 510 const char *name_nons = strip_namespace(name); 511 511 struct strbuf *buf = cb_data;
+1 -1
ident.c
··· 668 668 return 0; 669 669 } 670 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 672 { 673 673 if (!strcmp(var, "user.useconfigonly")) { 674 674 ident_use_config_only = git_config_bool(var, value);
+1 -1
ll-merge.c
··· 250 250 static const char *default_ll_merge; 251 251 252 252 static int read_merge_config(const char *var, const char *value, 253 - void *UNUSED(cb)) 253 + void *cb UNUSED) 254 254 { 255 255 struct ll_merge_driver *fn; 256 256 const char *key, *name;
+1 -1
log-tree.c
··· 135 135 } 136 136 137 137 static int add_ref_decoration(const char *refname, const struct object_id *oid, 138 - int UNUSED(flags), 138 + int flags UNUSED, 139 139 void *cb_data) 140 140 { 141 141 struct object *obj;
+1 -1
ls-refs.c
··· 137 137 } 138 138 139 139 static int ls_refs_config(const char *var, const char *value, 140 - void *UNUSED(data)) 140 + void *data UNUSED) 141 141 { 142 142 /* 143 143 * We only serve fetches over v2 for now, so respect only "uploadpack"
+6 -6
merge-recursive.c
··· 45 45 char path[FLEX_ARRAY]; 46 46 }; 47 47 48 - static int path_hashmap_cmp(const void *UNUSED(cmp_data), 48 + static int path_hashmap_cmp(const void *cmp_data UNUSED, 49 49 const struct hashmap_entry *eptr, 50 50 const struct hashmap_entry *entry_or_key, 51 51 const void *keydata) ··· 89 89 return hashmap_get_entry(hashmap, &key, ent, NULL); 90 90 } 91 91 92 - static int dir_rename_cmp(const void *UNUSED(cmp_data), 92 + static int dir_rename_cmp(const void *cmp_data UNUSED, 93 93 const struct hashmap_entry *eptr, 94 94 const struct hashmap_entry *entry_or_key, 95 - const void *UNUSED(keydata)) 95 + const void *keydata UNUSED) 96 96 { 97 97 const struct dir_rename_entry *e1, *e2; 98 98 ··· 134 134 return hashmap_get_entry(hashmap, &key, ent, NULL); 135 135 } 136 136 137 - static int collision_cmp(const void *UNUSED(cmp_data), 137 + static int collision_cmp(const void *cmp_data UNUSED, 138 138 const struct hashmap_entry *eptr, 139 139 const struct hashmap_entry *entry_or_key, 140 - const void *UNUSED(keydata)) 140 + const void *keydata UNUSED) 141 141 { 142 142 const struct collision_entry *e1, *e2; 143 143 ··· 456 456 clear_unpack_trees_porcelain(&opt->priv->unpack_opts); 457 457 } 458 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 460 struct strbuf *base, const char *path, 461 461 unsigned int mode, void *context) 462 462 {
+2 -2
name-hash.c
··· 18 18 char name[FLEX_ARRAY]; 19 19 }; 20 20 21 - static int dir_entry_cmp(const void *UNUSED(cmp_data), 21 + static int dir_entry_cmp(const void *cmp_data UNUSED, 22 22 const struct hashmap_entry *eptr, 23 23 const struct hashmap_entry *entry_or_key, 24 24 const void *keydata) ··· 120 120 add_dir_entry(istate, ce); 121 121 } 122 122 123 - static int cache_entry_cmp(const void *UNUSED(cmp_data), 123 + static int cache_entry_cmp(const void *cmp_data UNUSED, 124 124 const struct hashmap_entry *eptr, 125 125 const struct hashmap_entry *entry_or_key, 126 126 const void *remove)
+2 -2
negotiator/default.c
··· 36 36 } 37 37 38 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 41 { 42 42 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0); 43 43
+2 -2
negotiator/skipping.c
··· 72 72 } 73 73 74 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 77 { 78 78 struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0); 79 79
+2 -2
notes.c
··· 925 925 } 926 926 927 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 930 { 931 931 struct string_list *refs = cb; 932 932 if (!unsorted_string_list_has_string(refs, refname))
+6 -6
object-name.c
··· 1306 1306 }; 1307 1307 1308 1308 static int handle_one_ref(const char *path, const struct object_id *oid, 1309 - int UNUSED(flag), 1309 + int flag UNUSED, 1310 1310 void *cb_data) 1311 1311 { 1312 1312 struct handle_one_ref_cb *cb = cb_data; ··· 1385 1385 struct strbuf *sb; 1386 1386 }; 1387 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 1393 const char *message, void *cb_data) 1394 1394 { 1395 1395 struct grab_nth_branch_switch_cbdata *cb = cb_data;
+1 -1
object-store.h
··· 141 141 142 142 struct multi_pack_index; 143 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 145 const struct hashmap_entry *entry, 146 146 const struct hashmap_entry *entry2, 147 147 const void *keydata)
+1 -1
oidmap.c
··· 1 1 #include "cache.h" 2 2 #include "oidmap.h" 3 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 5 const struct hashmap_entry *e1, 6 6 const struct hashmap_entry *e2, 7 7 const void *keydata)
+1 -1
packfile.c
··· 1392 1392 return a->p == b->p && a->base_offset == b->base_offset; 1393 1393 } 1394 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 1396 const struct hashmap_entry *va, 1397 1397 const struct hashmap_entry *vb, 1398 1398 const void *vkey)
+1 -1
pager.c
··· 39 39 } 40 40 41 41 static int core_pager_config(const char *var, const char *value, 42 - void *UNUSED(data)) 42 + void *data UNUSED) 43 43 { 44 44 if (!strcmp(var, "core.pager")) 45 45 return git_config_string(&pager_program, var, value);
+1 -1
patch-ids.c
··· 38 38 static int patch_id_neq(const void *cmpfn_data, 39 39 const struct hashmap_entry *eptr, 40 40 const struct hashmap_entry *entry_or_key, 41 - const void *UNUSED(keydata)) 41 + const void *keydata UNUSED) 42 42 { 43 43 /* NEEDSWORK: const correctness? */ 44 44 struct diff_options *opt = (void *)cmpfn_data;
+1 -1
pretty.c
··· 44 44 } 45 45 46 46 static int git_pretty_formats_config(const char *var, const char *value, 47 - void *UNUSED(cb)) 47 + void *cb UNUSED) 48 48 { 49 49 struct cmt_fmt_map *commit_format = NULL; 50 50 const char *name;
+1 -1
range-diff.c
··· 224 224 return ret; 225 225 } 226 226 227 - static int patch_util_cmp(const void *UNUSED(cmp_data), 227 + static int patch_util_cmp(const void *cmp_data UNUSED, 228 228 const struct patch_util *a, 229 229 const struct patch_util *b, 230 230 const char *keydata)
+1 -1
ref-filter.c
··· 89 89 struct worktree *wt; /* key is wt->head_ref */ 90 90 }; 91 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 93 const struct hashmap_entry *eptr, 94 94 const struct hashmap_entry *kptr, 95 95 const void *keydata_aka_refname)
+9 -9
reflog.c
··· 240 240 * Return true iff the specified reflog entry should be expired. 241 241 */ 242 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 246 { 247 247 struct expire_reflog_policy_cb *cb = cb_data; 248 248 struct commit *old_commit, *new_commit; ··· 295 295 return expire; 296 296 } 297 297 298 - static int push_tip_to_list(const char *UNUSED(refname), 298 + static int push_tip_to_list(const char *refname UNUSED, 299 299 const struct object_id *oid, 300 300 int flags, void *cb_data) 301 301 { ··· 380 380 } 381 381 } 382 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 388 { 389 389 struct cmd_reflog_expire_cb *cb = cb_data; 390 390 if (!cb->expire_total || timestamp < cb->expire_total)
+6 -6
refs.c
··· 359 359 }; 360 360 361 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 363 int flags, void *cb_data) 364 364 { 365 365 struct warn_if_dangling_data *d = cb_data; ··· 894 894 } 895 895 896 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 898 timestamp_t timestamp, int tz, 899 899 const char *message, void *cb_data) 900 900 { ··· 936 936 return cb->found_it; 937 937 } 938 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 940 struct object_id *noid, 941 - const char *UNUSED(email), 941 + const char *email UNUSED, 942 942 timestamp_t timestamp, int tz, 943 943 const char *message, void *cb_data) 944 944 { ··· 951 951 } 952 952 953 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 955 timestamp_t timestamp, int tz, 956 956 const char *message, void *cb_data) 957 957 { ··· 1815 1815 char name[FLEX_ARRAY]; 1816 1816 }; 1817 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 1819 const struct hashmap_entry *eptr, 1820 1820 const struct hashmap_entry *entry_or_key, 1821 1821 const void *keydata)
+7 -7
refs/files-backend.c
··· 2202 2202 return ok; 2203 2203 } 2204 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 2207 { 2208 2208 BUG("ref_iterator_peel() called for reflog_iterator"); 2209 2209 } ··· 2257 2257 static enum iterator_selection reflog_iterator_select( 2258 2258 struct ref_iterator *iter_worktree, 2259 2259 struct ref_iterator *iter_common, 2260 - void *UNUSED(cb_data)) 2260 + void *cb_data UNUSED) 2261 2261 { 2262 2262 if (iter_worktree) { 2263 2263 /* ··· 2985 2985 2986 2986 static int files_transaction_abort(struct ref_store *ref_store, 2987 2987 struct ref_transaction *transaction, 2988 - struct strbuf *UNUSED(err)) 2988 + struct strbuf *err UNUSED) 2989 2989 { 2990 2990 struct files_ref_store *refs = 2991 2991 files_downcast(ref_store, 0, "ref_transaction_abort"); ··· 2995 2995 } 2996 2996 2997 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 3000 void *cb_data) 3001 3001 { 3002 3002 struct string_list *affected_refnames = cb_data; ··· 3261 3261 return -1; 3262 3262 } 3263 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 3265 { 3266 3266 struct files_ref_store *refs = 3267 3267 files_downcast(ref_store, REF_STORE_WRITE, "init_db");
+3 -3
refs/iterator.c
··· 51 51 return ref_iterator_abort(ref_iterator); 52 52 } 53 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 56 { 57 57 BUG("peel called for empty iterator"); 58 58 } ··· 238 238 */ 239 239 static enum iterator_selection overlay_iterator_select( 240 240 struct ref_iterator *front, struct ref_iterator *back, 241 - void *UNUSED(cb_data)) 241 + void *cb_data UNUSED) 242 242 { 243 243 int cmp; 244 244
+8 -8
refs/packed-backend.c
··· 726 726 } 727 727 728 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 730 unsigned int *type, int *failure_errno) 731 731 { 732 732 struct packed_ref_store *refs = ··· 1078 1078 static const char PACKED_REFS_HEADER[] = 1079 1079 "# pack-refs with: peeled fully-peeled sorted \n"; 1080 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 1083 { 1084 1084 /* Nothing to do. */ 1085 1085 return 0; ··· 1474 1474 1475 1475 static int packed_transaction_abort(struct ref_store *ref_store, 1476 1476 struct ref_transaction *transaction, 1477 - struct strbuf *UNUSED(err)) 1477 + struct strbuf *err UNUSED) 1478 1478 { 1479 1479 struct packed_ref_store *refs = packed_downcast( 1480 1480 ref_store, ··· 1513 1513 return ret; 1514 1514 } 1515 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 1517 struct ref_transaction *transaction, 1518 1518 struct strbuf *err) 1519 1519 { ··· 1569 1569 return ret; 1570 1570 } 1571 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 1574 { 1575 1575 /* 1576 1576 * Packed refs are already packed. It might be that loose refs ··· 1580 1580 return 0; 1581 1581 } 1582 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 1584 { 1585 1585 return empty_ref_iterator_begin(); 1586 1586 }
+12 -12
remote.c
··· 86 86 int len; 87 87 }; 88 88 89 - static int remotes_hash_cmp(const void *UNUSED(cmp_data), 89 + static int remotes_hash_cmp(const void *cmp_data UNUSED, 90 90 const struct hashmap_entry *eptr, 91 91 const struct hashmap_entry *entry_or_key, 92 92 const void *keydata) ··· 170 170 int len; 171 171 }; 172 172 173 - static int branches_hash_cmp(const void *UNUSED(cmp_data), 173 + static int branches_hash_cmp(const void *cmp_data UNUSED, 174 174 const struct hashmap_entry *eptr, 175 175 const struct hashmap_entry *entry_or_key, 176 176 const void *keydata) ··· 2320 2320 } 2321 2321 2322 2322 static int one_local_ref(const char *refname, const struct object_id *oid, 2323 - int UNUSED(flag), 2323 + int flag UNUSED, 2324 2324 void *cb_data) 2325 2325 { 2326 2326 struct ref ***local_tail = cb_data; ··· 2577 2577 }; 2578 2578 2579 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 2585 { 2586 2586 timestamp_t *ts = cb_data; 2587 2587 *ts = timestamp; 2588 2588 return 1; 2589 2589 } 2590 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 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 2596 { 2597 2597 struct commit *commit; 2598 2598 struct check_and_collect_until_cb_data *cb = cb_data;
+2 -2
replace-object.c
··· 9 9 static int register_replace_ref(struct repository *r, 10 10 const char *refname, 11 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 14 { 15 15 /* Get sha1 from refname */ 16 16 const char *slash = strrchr(refname, '/');
+9 -9
revision.c
··· 119 119 struct oidset trees; 120 120 }; 121 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 123 const struct hashmap_entry *eptr, 124 124 const struct hashmap_entry *entry_or_key, 125 - const void *UNUSED(keydata)) 125 + const void *keydata UNUSED) 126 126 { 127 127 const struct path_and_oids_entry *e1, *e2; 128 128 ··· 1543 1543 } 1544 1544 1545 1545 static int handle_one_ref(const char *path, const struct object_id *oid, 1546 - int UNUSED(flag), 1546 + int flag UNUSED, 1547 1547 void *cb_data) 1548 1548 { 1549 1549 struct all_refs_cb *cb = cb_data; ··· 1619 1619 } 1620 1620 1621 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 1626 void *cb_data) 1627 1627 { 1628 1628 handle_one_reflog_commit(ooid, cb_data); ··· 1631 1631 } 1632 1632 1633 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 1636 { 1637 1637 struct all_refs_cb *cb = cb_data; 1638 1638 struct strbuf refname = STRBUF_INIT;
+1 -1
send-pack.c
··· 266 266 return ret; 267 267 } 268 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 270 { 271 271 int *fd = data, ret; 272 272 if (async_with_fork())
+2 -2
sequencer.c
··· 5254 5254 char label[FLEX_ARRAY]; 5255 5255 }; 5256 5256 5257 - static int labels_cmp(const void *UNUSED(fndata), 5257 + static int labels_cmp(const void *fndata UNUSED, 5258 5258 const struct hashmap_entry *eptr, 5259 5259 const struct hashmap_entry *entry_or_key, const void *key) 5260 5260 { ··· 6132 6132 char subject[FLEX_ARRAY]; 6133 6133 }; 6134 6134 6135 - static int subject2item_cmp(const void *UNUSED(fndata), 6135 + static int subject2item_cmp(const void *fndata UNUSED, 6136 6136 const struct hashmap_entry *eptr, 6137 6137 const struct hashmap_entry *entry_or_key, 6138 6138 const void *key)
+1 -1
server-info.c
··· 147 147 } 148 148 149 149 static int add_info_ref(const char *path, const struct object_id *oid, 150 - int UNUSED(flag), 150 + int flag UNUSED, 151 151 void *cb_data) 152 152 { 153 153 struct update_info_ctx *uic = cb_data;
+5 -5
shallow.c
··· 604 604 free(tmp); 605 605 } 606 606 607 - static int mark_uninteresting(const char *UNUSED(refname), 607 + static int mark_uninteresting(const char *refname UNUSED, 608 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 611 { 612 612 struct commit *commit = lookup_commit_reference_gently(the_repository, 613 613 oid, 1); ··· 717 717 int nr, alloc; 718 718 }; 719 719 720 - static int add_ref(const char *UNUSED(refname), 720 + static int add_ref(const char *refname UNUSED, 721 721 const struct object_id *oid, 722 - int UNUSED(flags), 722 + int flags UNUSED, 723 723 void *cb_data) 724 724 { 725 725 struct commit_array *ca = cb_data;
+1 -1
strbuf.c
··· 436 436 437 437 size_t strbuf_expand_literal_cb(struct strbuf *sb, 438 438 const char *placeholder, 439 - void *context) 439 + void *context UNUSED) 440 440 { 441 441 int ch; 442 442
+3 -3
streaming.c
··· 328 328 } 329 329 330 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 334 { 335 335 struct pack_window *window; 336 336 enum object_type in_pack_type;
+2 -2
strmap.c
··· 2 2 #include "strmap.h" 3 3 #include "mem-pool.h" 4 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 6 const struct hashmap_entry *entry1, 7 7 const struct hashmap_entry *entry2, 8 - const void *UNUSED(keydata)) 8 + const void *keydata UNUSED) 9 9 { 10 10 const struct strmap_entry *e1, *e2; 11 11
+2 -2
sub-process.c
··· 5 5 #include "sigchain.h" 6 6 #include "pkt-line.h" 7 7 8 - int cmd2process_cmp(const void *UNUSED(cmp_data), 8 + int cmd2process_cmp(const void *cmp_data UNUSED, 9 9 const struct hashmap_entry *eptr, 10 10 const struct hashmap_entry *entry_or_key, 11 - const void *UNUSED(keydata)) 11 + const void *keydata UNUSED) 12 12 { 13 13 const struct subprocess_entry *e1, *e2; 14 14
+4 -4
submodule-config.c
··· 38 38 lookup_path 39 39 }; 40 40 41 - static int config_path_cmp(const void *UNUSED(cmp_data), 41 + static int config_path_cmp(const void *cmp_data UNUSED, 42 42 const struct hashmap_entry *eptr, 43 43 const struct hashmap_entry *entry_or_key, 44 - const void *UNUSED(keydata)) 44 + const void *keydata UNUSED) 45 45 { 46 46 const struct submodule_entry *a, *b; 47 47 ··· 52 52 !oideq(&a->config->gitmodules_oid, &b->config->gitmodules_oid); 53 53 } 54 54 55 - static int config_name_cmp(const void *UNUSED(cmp_data), 55 + static int config_name_cmp(const void *cmp_data UNUSED, 56 56 const struct hashmap_entry *eptr, 57 57 const struct hashmap_entry *entry_or_key, 58 - const void *UNUSED(keydata)) 58 + const void *keydata UNUSED) 59 59 { 60 60 const struct submodule_entry *a, *b; 61 61
+6 -6
submodule.c
··· 214 214 215 215 /* Cheap function that only determines if we're interested in submodules at all */ 216 216 int git_default_submodule_config(const char *var, const char *value, 217 - void *UNUSED(cb)) 217 + void *cb UNUSED) 218 218 { 219 219 if (!strcmp(var, "submodule.recurse")) { 220 220 int v = git_config_bool(var, value) ? ··· 941 941 string_list_clear(submodules, 1); 942 942 } 943 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 947 { 948 948 return 1; 949 949 } ··· 1245 1245 return ret; 1246 1246 } 1247 1247 1248 - static int append_oid_to_array(const char *UNUSED(ref), 1248 + static int append_oid_to_array(const char *ref UNUSED, 1249 1249 const struct object_id *oid, 1250 - int UNUSED(flags), void *data) 1250 + int flags UNUSED, void *data) 1251 1251 { 1252 1252 struct oid_array *array = data; 1253 1253 oid_array_append(array, oid);
+1 -1
t/helper/test-config.c
··· 37 37 * 38 38 */ 39 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 41 { 42 42 static int nr; 43 43
+2 -2
t/helper/test-ref-store.c
··· 161 161 } 162 162 163 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 165 { 166 166 printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags); 167 167 return 0; ··· 207 207 208 208 static int each_reflog(struct object_id *old_oid, struct object_id *new_oid, 209 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 211 { 212 212 printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid), 213 213 oid_to_hex(new_oid), committer, timestamp, tz,
+1 -1
t/helper/test-userdiff.c
··· 12 12 return 0; 13 13 } 14 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 16 { 17 17 if (userdiff_config(var, value) < 0) 18 18 return -1;
+2 -2
trailer.c
··· 479 479 }; 480 480 481 481 static int git_trailer_default_config(const char *conf_key, const char *value, 482 - void *UNUSED(cb)) 482 + void *cb UNUSED) 483 483 { 484 484 const char *trailer_item, *variable_name; 485 485 ··· 511 511 } 512 512 513 513 static int git_trailer_config(const char *conf_key, const char *value, 514 - void *UNUSED(cb)) 514 + void *cb UNUSED) 515 515 { 516 516 const char *trailer_item, *variable_name; 517 517 struct arg_item *item;
+1 -1
transport.c
··· 142 142 143 143 static struct ref *get_refs_from_bundle(struct transport *transport, 144 144 int for_push, 145 - struct transport_ls_refs_options *UNUSED(transport_options)) 145 + struct transport_ls_refs_options *transport_options UNUSED) 146 146 { 147 147 struct bundle_transport_data *data = transport->data; 148 148 struct ref *result = NULL;
+3 -3
upload-pack.c
··· 1170 1170 } 1171 1171 1172 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 1174 { 1175 1175 const char *refname = strip_namespace(refname_full); 1176 1176 ··· 1194 1194 } 1195 1195 1196 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 1198 { 1199 1199 static const char *capabilities = "multi_ack thin-pack side-band" 1200 1200 " side-band-64k ofs-delta shallow deepen-since deepen-not" ··· 1237 1237 } 1238 1238 1239 1239 static int find_symref(const char *refname, 1240 - const struct object_id *UNUSED(oid), 1240 + const struct object_id *oid UNUSED, 1241 1241 int flag, void *cb_data) 1242 1242 { 1243 1243 const char *symref_target;
+3 -3
walker.c
··· 215 215 return -1; 216 216 } 217 217 218 - static int mark_complete(const char *UNUSED(path), 218 + static int mark_complete(const char *path UNUSED, 219 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 222 { 223 223 struct commit *commit = lookup_commit_reference_gently(the_repository, 224 224 oid, 1);
+8 -8
wt-status.c
··· 947 947 wt_longstatus_print_trailer(s); 948 948 } 949 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 955 { 956 956 int *c = cb_data; 957 957 (*c)++; ··· 1614 1614 struct object_id noid; 1615 1615 }; 1616 1616 1617 - static int grab_1st_switch(struct object_id *UNUSED(ooid), 1617 + static int grab_1st_switch(struct object_id *ooid UNUSED, 1618 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 1621 const char *message, void *cb_data) 1622 1622 { 1623 1623 struct grab_1st_switch_cbdata *cb = cb_data;