refs: mark unused reflog callback parameters

Functions used with for_each_reflog_ent() need to conform to a particular interface, but not every function needs all of the parameters. Mark the unused ones to make -Wunused-parameter happy. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 19, 2022 at 06:08 UTC c006e9fa59c02261738e20890f1aecd78f9db707
10 files changed +55 -32
builtin/fsck.c
+3 -2
@@ -488,8 +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 *email, timestamp_t timestamp, int tz,
492 - const char *message, void *cb_data)
491 + const char *UNUSED(email),
492 + timestamp_t timestamp, int UNUSED(tz),
493 + const char *UNUSED(message), void *cb_data)
494 {
495 const char *refname = cb_data;
496
builtin/stash.c
+6 -3
@@ -638,9 +638,12 @@ cleanup:
638 return ret;
639 }
640
641 -static int reject_reflog_ent(struct object_id *ooid, struct object_id *noid,
642 - const char *email, timestamp_t timestamp, int tz,
643 - const char *message, void *cb_data)
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))
647 {
648 return 1;
649 }
commit.c
+3 -2
@@ -951,8 +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 *ident, timestamp_t timestamp,
955 - int tz, const char *message, void *cbdata)
954 + const char *UNUSED(ident),
955 + timestamp_t UNUSED(timestamp), int UNUSED(tz),
956 + const char *UNUSED(message), void *cbdata)
957 {
958 struct rev_collect *revs = cbdata;
959
object-name.c
+5 -2
@@ -1385,8 +1385,11 @@ struct grab_nth_branch_switch_cbdata {
1385 struct strbuf *sb;
1386 };
1387
1388 -static int grab_nth_branch_switch(struct object_id *ooid, struct object_id *noid,
1389 - const char *email, timestamp_t timestamp, int tz,
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),
1393 const char *message, void *cb_data)
1394 {
1395 struct grab_nth_branch_switch_cbdata *cb = cb_data;
reflog.c
+8 -5
@@ -240,8 +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 *email, timestamp_t timestamp, int tz,
244 - const char *message, void *cb_data)
243 + const char *UNUSED(email),
244 + timestamp_t timestamp, int UNUSED(tz),
245 + const char *UNUSED(message), void *cb_data)
246 {
247 struct expire_reflog_policy_cb *cb = cb_data;
248 struct commit *old_commit, *new_commit;
@@ -379,9 +380,11 @@ void reflog_expiry_cleanup(void *cb_data)
380 }
381 }
382
382 -int count_reflog_ent(struct object_id *ooid, struct object_id *noid,
383 - const char *email, timestamp_t timestamp, int tz,
384 - const char *message, void *cb_data)
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)
388 {
389 struct cmd_reflog_expire_cb *cb = cb_data;
390 if (!cb->expire_total || timestamp < cb->expire_total)
refs.c
+6 -4
@@ -894,8 +894,9 @@ 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 *email, timestamp_t timestamp, int tz,
898 - const char *message, void *cb_data)
897 + const char *UNUSED(email),
898 + timestamp_t timestamp, int tz,
899 + const char *message, void *cb_data)
900 {
901 struct read_ref_at_cb *cb = cb_data;
902 int reached_count;
@@ -950,8 +951,9 @@ 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,
953 - const char *email, timestamp_t timestamp,
954 - int tz, const char *message, void *cb_data)
954 + const char *UNUSED(email),
955 + timestamp_t timestamp, int tz,
956 + const char *message, void *cb_data)
957 {
958 struct read_ref_at_cb *cb = cb_data;
959
remote.c
+9 -6
@@ -2577,19 +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 *o_oid, struct object_id *n_oid,
2581 - const char *ident, timestamp_t timestamp,
2582 - int tz, const char *message, void *cb_data)
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)
2585 {
2586 timestamp_t *ts = cb_data;
2587 *ts = timestamp;
2588 return 1;
2589 }
2590
2589 -static int check_and_collect_until(struct object_id *o_oid,
2591 +static int check_and_collect_until(struct object_id *UNUSED(o_oid),
2592 struct object_id *n_oid,
2591 - const char *ident, timestamp_t timestamp,
2592 - int tz, const char *message, void *cb_data)
2593 + const char *UNUSED(ident),
2594 + timestamp_t timestamp, int UNUSED(tz),
2595 + const char *UNUSED(message), void *cb_data)
2596 {
2597 struct commit *commit;
2598 struct check_and_collect_until_cb_data *cb = cb_data;
revision.c
+5 -2
@@ -1619,8 +1619,11 @@ 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 *email, timestamp_t timestamp, int tz,
1623 - const char *message, void *cb_data)
1622 + const char *UNUSED(email),
1623 + timestamp_t UNUSED(timestamp),
1624 + int UNUSED(tz),
1625 + const char *UNUSED(message),
1626 + void *cb_data)
1627 {
1628 handle_one_reflog_commit(ooid, cb_data);
1629 handle_one_reflog_commit(noid, cb_data);
t/helper/test-ref-store.c
+1 -1
@@ -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 *cb_data)
210 + int tz, const char *msg, void *UNUSED(cb_data))
211 {
212 printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid),
213 oid_to_hex(new_oid), committer, timestamp, tz,
wt-status.c
+9 -5
@@ -947,9 +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 *ooid, struct object_id *noid,
951 - const char *email, timestamp_t timestamp, int tz,
952 - const char *message, void *cb_data)
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)
955 {
956 int *c = cb_data;
957 (*c)++;
@@ -1612,8 +1614,10 @@ struct grab_1st_switch_cbdata {
1614 struct object_id noid;
1615 };
1616
1615 -static int grab_1st_switch(struct object_id *ooid, struct object_id *noid,
1616 - const char *email, timestamp_t timestamp, int tz,
1617 +static int grab_1st_switch(struct object_id *UNUSED(ooid),
1618 + struct object_id *noid,
1619 + const char *UNUSED(email),
1620 + timestamp_t UNUSED(timestamp), int UNUSED(tz),
1621 const char *message, void *cb_data)
1622 {
1623 struct grab_1st_switch_cbdata *cb = cb_data;