]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs: mark unused reflog callback parameters
authorJeff King <peff@peff.net>
Fri, 19 Aug 2022 10:08:35 +0000 (06:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 19:18:54 +0000 (12:18 -0700)
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>
builtin/fsck.c
builtin/stash.c
commit.c
object-name.c
reflog.c
refs.c
remote.c
revision.c
t/helper/test-ref-store.c
wt-status.c

index 36f15246140bcb65dd62c928c4261bf1537f54bb..31d3da8954bedea1988abc38319a4ca8c87a2189 100644 (file)
@@ -488,8 +488,9 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
 }
 
 static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid,
-               const char *email, timestamp_t timestamp, int tz,
-               const char *message, void *cb_data)
+                                 const char *UNUSED(email),
+                                 timestamp_t timestamp, int UNUSED(tz),
+                                 const char *UNUSED(message), void *cb_data)
 {
        const char *refname = cb_data;
 
index 30fa1014605425b3731d5f65c16338a7164f5140..a741b920b329910c595762942500190d2ef51364 100644 (file)
@@ -638,9 +638,12 @@ cleanup:
        return ret;
 }
 
-static int reject_reflog_ent(struct object_id *ooid, struct object_id *noid,
-                            const char *email, timestamp_t timestamp, int tz,
-                            const char *message, void *cb_data)
+static int reject_reflog_ent(struct object_id *UNUSED(ooid),
+                            struct object_id *UNUSED(noid),
+                            const char *UNUSED(email),
+                            timestamp_t UNUSED(timestamp),
+                            int UNUSED(tz), const char *UNUSED(message),
+                            void *UNUSED(cb_data))
 {
        return 1;
 }
index 0db461f97355d4ae02a2106da0219012ff16efe9..cb20082736ddb7aba41701e76d15e3190478e88a 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -951,8 +951,9 @@ static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
 }
 
 static int collect_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
-                                 const char *ident, timestamp_t timestamp,
-                                 int tz, const char *message, void *cbdata)
+                                 const char *UNUSED(ident),
+                                 timestamp_t UNUSED(timestamp), int UNUSED(tz),
+                                 const char *UNUSED(message), void *cbdata)
 {
        struct rev_collect *revs = cbdata;
 
index 052644977eb3f6a0a9f4812232ca718e01a49569..3f7fce8322438b2a6be26c47af38418592e3654d 100644 (file)
@@ -1385,8 +1385,11 @@ struct grab_nth_branch_switch_cbdata {
        struct strbuf *sb;
 };
 
-static int grab_nth_branch_switch(struct object_id *ooid, struct object_id *noid,
-                                 const char *email, timestamp_t timestamp, int tz,
+static int grab_nth_branch_switch(struct object_id *UNUSED(ooid),
+                                 struct object_id *UNUSED(noid),
+                                 const char *UNUSED(email),
+                                 timestamp_t UNUSED(timestamp),
+                                 int UNUSED(tz),
                                  const char *message, void *cb_data)
 {
        struct grab_nth_branch_switch_cbdata *cb = cb_data;
index ee8aaa78f580bf32e06bf134b01c3b403c70425e..56ea3ba76240266cc2a2a15f6b5928c73d5b293e 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -240,8 +240,9 @@ static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit
  * Return true iff the specified reflog entry should be expired.
  */
 int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
-                            const char *email, timestamp_t timestamp, int tz,
-                            const char *message, void *cb_data)
+                            const char *UNUSED(email),
+                            timestamp_t timestamp, int UNUSED(tz),
+                            const char *UNUSED(message), void *cb_data)
 {
        struct expire_reflog_policy_cb *cb = cb_data;
        struct commit *old_commit, *new_commit;
@@ -379,9 +380,11 @@ void reflog_expiry_cleanup(void *cb_data)
        }
 }
 
-int count_reflog_ent(struct object_id *ooid, struct object_id *noid,
-                    const char *email, timestamp_t timestamp, int tz,
-                    const char *message, void *cb_data)
+int count_reflog_ent(struct object_id *UNUSED(ooid),
+                    struct object_id *UNUSED(noid),
+                    const char *UNUSED(email),
+                    timestamp_t timestamp, int UNUSED(tz),
+                    const char *UNUSED(message), void *cb_data)
 {
        struct cmd_reflog_expire_cb *cb = cb_data;
        if (!cb->expire_total || timestamp < cb->expire_total)
diff --git a/refs.c b/refs.c
index 34373e8087fecef981159e850651e59561f09773..38b1165189f93da4afd16ff741aa81eb32e9809e 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -894,8 +894,9 @@ static void set_read_ref_cutoffs(struct read_ref_at_cb *cb,
 }
 
 static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
-               const char *email, timestamp_t timestamp, int tz,
-               const char *message, void *cb_data)
+                          const char *UNUSED(email),
+                          timestamp_t timestamp, int tz,
+                          const char *message, void *cb_data)
 {
        struct read_ref_at_cb *cb = cb_data;
        int reached_count;
@@ -950,8 +951,9 @@ static int read_ref_at_ent_newest(struct object_id *UNUSED(ooid),
 }
 
 static int read_ref_at_ent_oldest(struct object_id *ooid, struct object_id *noid,
-                                 const char *email, timestamp_t timestamp,
-                                 int tz, const char *message, void *cb_data)
+                                 const char *UNUSED(email),
+                                 timestamp_t timestamp, int tz,
+                                 const char *message, void *cb_data)
 {
        struct read_ref_at_cb *cb = cb_data;
 
index 723aa8841c3f7d6ae275ec231f8fe52fbb162ec6..029fc630b95d030d717671803dcc4195ed25b00b 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -2577,19 +2577,22 @@ struct check_and_collect_until_cb_data {
 };
 
 /* Get the timestamp of the latest entry. */
-static int peek_reflog(struct object_id *o_oid, struct object_id *n_oid,
-                      const char *ident, timestamp_t timestamp,
-                      int tz, const char *message, void *cb_data)
+static int peek_reflog(struct object_id *UNUSED(o_oid),
+                      struct object_id *UNUSED(n_oid),
+                      const char *UNUSED(ident),
+                      timestamp_t timestamp, int UNUSED(tz),
+                      const char *UNUSED(message), void *cb_data)
 {
        timestamp_t *ts = cb_data;
        *ts = timestamp;
        return 1;
 }
 
-static int check_and_collect_until(struct object_id *o_oid,
+static int check_and_collect_until(struct object_id *UNUSED(o_oid),
                                   struct object_id *n_oid,
-                                  const char *ident, timestamp_t timestamp,
-                                  int tz, const char *message, void *cb_data)
+                                  const char *UNUSED(ident),
+                                  timestamp_t timestamp, int UNUSED(tz),
+                                  const char *UNUSED(message), void *cb_data)
 {
        struct commit *commit;
        struct check_and_collect_until_cb_data *cb = cb_data;
index 23c2bba0d84912fadbc1b8f5df8b056d11c3a4de..6c7250d6a8b350de31fc089978abe022bbbed93b 100644 (file)
@@ -1619,8 +1619,11 @@ static void handle_one_reflog_commit(struct object_id *oid, void *cb_data)
 }
 
 static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
-               const char *email, timestamp_t timestamp, int tz,
-               const char *message, void *cb_data)
+                                const char *UNUSED(email),
+                                timestamp_t UNUSED(timestamp),
+                                int UNUSED(tz),
+                                const char *UNUSED(message),
+                                void *cb_data)
 {
        handle_one_reflog_commit(ooid, cb_data);
        handle_one_reflog_commit(noid, cb_data);
index a98775d1a6ae9458c81560ff04c240e68e7505e9..8f930ad358c335818f29899bf94f1ca66012d5e8 100644 (file)
@@ -207,7 +207,7 @@ static int cmd_for_each_reflog(struct ref_store *refs, const char **argv)
 
 static int each_reflog(struct object_id *old_oid, struct object_id *new_oid,
                       const char *committer, timestamp_t timestamp,
-                      int tz, const char *msg, void *cb_data)
+                      int tz, const char *msg, void *UNUSED(cb_data))
 {
        printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid),
               oid_to_hex(new_oid), committer, timestamp, tz,
index 867e3e417e9d4d26036a15a2034018529ce6dec7..38d0900aa9421913fa45bc924cc4deb8af5de78c 100644 (file)
@@ -947,9 +947,11 @@ static void wt_longstatus_print_changed(struct wt_status *s)
        wt_longstatus_print_trailer(s);
 }
 
-static int stash_count_refs(struct object_id *ooid, struct object_id *noid,
-                           const char *email, timestamp_t timestamp, int tz,
-                           const char *message, void *cb_data)
+static int stash_count_refs(struct object_id *UNUSED(ooid),
+                           struct object_id *UNUSED(noid),
+                           const char *UNUSED(email),
+                           timestamp_t UNUSED(timestamp), int UNUSED(tz),
+                           const char *UNUSED(message), void *cb_data)
 {
        int *c = cb_data;
        (*c)++;
@@ -1612,8 +1614,10 @@ struct grab_1st_switch_cbdata {
        struct object_id noid;
 };
 
-static int grab_1st_switch(struct object_id *ooid, struct object_id *noid,
-                          const char *email, timestamp_t timestamp, int tz,
+static int grab_1st_switch(struct object_id *UNUSED(ooid),
+                          struct object_id *noid,
+                          const char *UNUSED(email),
+                          timestamp_t UNUSED(timestamp), int UNUSED(tz),
                           const char *message, void *cb_data)
 {
        struct grab_1st_switch_cbdata *cb = cb_data;