]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs: mark unused each_ref_fn parameters
authorJeff King <peff@peff.net>
Fri, 19 Aug 2022 10:08:32 +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_ref(), etc, need to conform to the
each_ref_fn interface. But most of them don't need every parameter;
let's annotate the unused ones to quiet -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
39 files changed:
bisect.c
builtin/bisect--helper.c
builtin/checkout.c
builtin/describe.c
builtin/fetch.c
builtin/fsck.c
builtin/gc.c
builtin/name-rev.c
builtin/pack-objects.c
builtin/receive-pack.c
builtin/reflog.c
builtin/remote.c
builtin/repack.c
builtin/rev-parse.c
builtin/show-branch.c
builtin/show-ref.c
builtin/submodule--helper.c
commit-graph.c
delta-islands.c
fetch-pack.c
help.c
http-backend.c
log-tree.c
negotiator/default.c
negotiator/skipping.c
notes.c
object-name.c
reflog.c
refs.c
refs/files-backend.c
remote.c
replace-object.c
revision.c
server-info.c
shallow.c
submodule.c
t/helper/test-ref-store.c
upload-pack.c
walker.c

index 38b3891f3a6209d24b8f891ccbd274f829919c4c..07ccd1bce614137c2f5c8d0684a9004f9eb7534f 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -441,7 +441,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
 }
 
 static int register_ref(const char *refname, const struct object_id *oid,
-                       int flags, void *cb_data)
+                       int UNUSED(flags), void *UNUSED(cb_data))
 {
        struct strbuf good_prefix = STRBUF_INIT;
        strbuf_addstr(&good_prefix, term_good);
@@ -1160,8 +1160,9 @@ int estimate_bisect_steps(int all)
        return (e < 3 * x) ? n : n - 1;
 }
 
-static int mark_for_removal(const char *refname, const struct object_id *oid,
-                           int flag, void *cb_data)
+static int mark_for_removal(const char *refname,
+                           const struct object_id *UNUSED(oid),
+                           int UNUSED(flag), void *cb_data)
 {
        struct string_list *refs = cb_data;
        char *ref = xstrfmt("refs/bisect%s", refname);
index 8a052c7111f97f02690a31e98ef4102961796800..87c8b2d818b7fb837c676b5ed3044d76d0a4bbcb 100644 (file)
@@ -329,8 +329,9 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
        return 0;
 }
 
-static int inc_nr(const char *refname, const struct object_id *oid,
-                 int flag, void *cb_data)
+static int inc_nr(const char *UNUSED(refname),
+                 const struct object_id *UNUSED(oid),
+                 int UNUSED(flag), void *cb_data)
 {
        unsigned int *nr = (unsigned int *)cb_data;
        (*nr)++;
@@ -518,7 +519,7 @@ finish:
 }
 
 static int add_bisect_ref(const char *refname, const struct object_id *oid,
-                         int flags, void *cb)
+                         int UNUSED(flags), void *cb)
 {
        struct add_bisect_ref_data *data = cb;
 
@@ -1134,8 +1135,9 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a
        return res;
 }
 
-static int get_first_good(const char *refname, const struct object_id *oid,
-                         int flag, void *cb_data)
+static int get_first_good(const char *UNUSED(refname),
+                         const struct object_id *oid,
+                         int UNUSED(flag), void *cb_data)
 {
        oidcpy(cb_data, oid);
        return 1;
index f9d63d80b926c783265beb459962954128f6ea4c..713410ce2c7d536e741bc81f75bab06a7eb58379 100644 (file)
@@ -990,7 +990,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
 
 static int add_pending_uninteresting_ref(const char *refname,
                                         const struct object_id *oid,
-                                        int flags, void *cb_data)
+                                        int UNUSED(flags), void *cb_data)
 {
        add_pending_oid(cb_data, refname, oid, UNINTERESTING);
        return 0;
index a76f1a1a7a7004cc95f392024cc1a27d54c870df..3af36483f2409c69d247d79870042f072126ef3d 100644 (file)
@@ -140,7 +140,8 @@ static void add_to_known_names(const char *path,
        }
 }
 
-static int get_name(const char *path, const struct object_id *oid, int flag, void *cb_data)
+static int get_name(const char *path, const struct object_id *oid,
+                   int UNUSED(flag), void *UNUSED(cb_data))
 {
        int is_tag = 0;
        struct object_id peeled;
index fc5cecb48356ffccd4251670bd779d52ab3d392c..9e7c8099fed83753d76e0fc21cbac19ccfa9a8c2 100644 (file)
@@ -329,7 +329,7 @@ static struct refname_hash_entry *refname_hash_add(struct hashmap *map,
 
 static int add_one_refname(const char *refname,
                           const struct object_id *oid,
-                          int flag, void *cbdata)
+                          int UNUSED(flag), void *cbdata)
 {
        struct hashmap *refname_map = cbdata;
 
@@ -1462,8 +1462,9 @@ static void set_option(struct transport *transport, const char *name, const char
 }
 
 
-static int add_oid(const char *refname, const struct object_id *oid, int flags,
-                  void *cb_data)
+static int add_oid(const char *UNUSED(refname),
+                  const struct object_id *oid,
+                  int UNUSED(flags), void *cb_data)
 {
        struct oid_array *oids = cb_data;
 
index 6c73092f10dedd64a53090847c16b65232bc0c86..36f15246140bcb65dd62c928c4261bf1537f54bb 100644 (file)
@@ -502,8 +502,9 @@ static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid
        return 0;
 }
 
-static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
-                             int flag, void *cb_data)
+static int fsck_handle_reflog(const char *logname,
+                             const struct object_id *UNUSED(oid),
+                             int UNUSED(flag), void *cb_data)
 {
        struct strbuf refname = STRBUF_INIT;
 
@@ -514,7 +515,7 @@ static int fsck_handle_reflog(const char *logname, const struct object_id *oid,
 }
 
 static int fsck_handle_ref(const char *refname, const struct object_id *oid,
-                          int flag, void *cb_data)
+                          int UNUSED(flag), void *UNUSED(cb_data))
 {
        struct object *obj;
 
index eeff2b760e0cc58978618c791a195df0bca6627b..e4ede128c9237a43c7f2d045b8ce47f07a5c3dc9 100644 (file)
@@ -782,8 +782,9 @@ struct cg_auto_data {
        int limit;
 };
 
-static int dfs_on_ref(const char *refname,
-                     const struct object_id *oid, int flags,
+static int dfs_on_ref(const char *UNUSED(refname),
+                     const struct object_id *oid,
+                     int UNUSED(flags),
                      void *cb_data)
 {
        struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
index 580b1eb170ef5793e8f3f6a231291c87aec47fe1..c4dc143c4b79ec8e8bb56aee7eed0977685ce1e1 100644 (file)
@@ -344,7 +344,8 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
        return a->taggerdate != b->taggerdate;
 }
 
-static int name_ref(const char *path, const struct object_id *oid, int flags, void *cb_data)
+static int name_ref(const char *path, const struct object_id *oid,
+                   int UNUSED(flags), void *cb_data)
 {
        struct object *o = parse_object(the_repository, oid);
        struct name_ref_data *data = cb_data;
index 39e28cfcafc3d361dbea42d4c4f7f4c1ca09728b..eb93e5c8fe92e3d9ec32ebe6a5ea9d82fbb85387 100644 (file)
@@ -759,8 +759,8 @@ static enum write_one_status write_one(struct hashfile *f,
        return WRITE_ONE_WRITTEN;
 }
 
-static int mark_tagged(const char *path, const struct object_id *oid, int flag,
-                      void *cb_data)
+static int mark_tagged(const char *UNUSED(path), const struct object_id *oid,
+                      int UNUSED(flag), void *UNUSED(cb_data))
 {
        struct object_id peeled;
        struct object_entry *entry = packlist_find(&to_pack, oid);
@@ -3035,7 +3035,8 @@ static void add_tag_chain(const struct object_id *oid)
        }
 }
 
-static int add_ref_tag(const char *tag, const struct object_id *oid, int flag, void *cb_data)
+static int add_ref_tag(const char *UNUSED(tag), const struct object_id *oid,
+                      int UNUSED(flag), void *UNUSED(cb_data))
 {
        struct object_id peeled;
 
@@ -3950,8 +3951,9 @@ static void record_recent_commit(struct commit *commit, void *data)
 }
 
 static int mark_bitmap_preferred_tip(const char *refname,
-                                    const struct object_id *oid, int flags,
-                                    void *_data)
+                                    const struct object_id *oid,
+                                    int UNUSED(flags),
+                                    void *UNUSED(data))
 {
        struct object_id peeled;
        struct object *object;
index 31b48e728bedef2fae4c9024726a1222dcc81d7d..afd36c9c5344bfedec2fb158cf9f191adb7665a3 100644 (file)
@@ -291,7 +291,7 @@ static void show_ref(const char *path, const struct object_id *oid)
 }
 
 static int show_ref_cb(const char *path_full, const struct object_id *oid,
-                      int flag, void *data)
+                      int UNUSED(flag), void *data)
 {
        struct oidset *seen = data;
        const char *path = strip_namespace(path_full);
index 4dd297dce86e5212087ee1202d5b9dd1f754f9d1..63f9a233571ee0cb382675b5a6bbf6ce761563bd 100644 (file)
@@ -56,7 +56,8 @@ struct worktree_reflogs {
        struct string_list reflogs;
 };
 
-static int collect_reflog(const char *ref, const struct object_id *oid, int unused, void *cb_data)
+static int collect_reflog(const char *ref, const struct object_id *UNUSED(oid),
+                         int UNUSED(flags), void *cb_data)
 {
        struct worktree_reflogs *cb = cb_data;
        struct worktree *worktree = cb->worktree;
index c713463d89d437916fc87beade4695991b17ed6a..b390360f079ec214126b8544acf5a2c62d42be2a 100644 (file)
@@ -264,7 +264,8 @@ static const char *abbrev_ref(const char *name, const char *prefix)
 }
 #define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
 
-static int config_read_branches(const char *key, const char *value, void *cb)
+static int config_read_branches(const char *key, const char *value,
+                               void *UNUSED(data))
 {
        const char *orig_key = key;
        char *name;
@@ -538,7 +539,8 @@ struct branches_for_remote {
 };
 
 static int add_branch_for_removal(const char *refname,
-       const struct object_id *oid, int flags, void *cb_data)
+                                 const struct object_id *UNUSED(oid),
+                                 int UNUSED(flags), void *cb_data)
 {
        struct branches_for_remote *branches = cb_data;
        struct refspec_item refspec;
@@ -580,7 +582,8 @@ struct rename_info {
 };
 
 static int read_remote_branches(const char *refname,
-       const struct object_id *oid, int flags, void *cb_data)
+                               const struct object_id *UNUSED(oid),
+                               int UNUSED(flags), void *cb_data)
 {
        struct rename_info *rename = cb_data;
        struct strbuf buf = STRBUF_INIT;
@@ -953,7 +956,8 @@ static void free_remote_ref_states(struct ref_states *states)
 }
 
 static int append_ref_to_tracked_list(const char *refname,
-       const struct object_id *oid, int flags, void *cb_data)
+                                     const struct object_id *UNUSED(oid),
+                                     int flags, void *cb_data)
 {
        struct ref_states *states = cb_data;
        struct refspec_item refspec;
index 482b66f57d66b08f359c723fdf65808a34a05766..ff952dec48d28da0e23bdd475b967ae01777a5c4 100644 (file)
@@ -514,9 +514,9 @@ struct midx_snapshot_ref_data {
        int preferred;
 };
 
-static int midx_snapshot_ref_one(const char *refname,
+static int midx_snapshot_ref_one(const char *UNUSED(refname),
                                 const struct object_id *oid,
-                                int flag, void *_data)
+                                int UNUSED(flag), void *_data)
 {
        struct midx_snapshot_ref_data *data = _data;
        struct object_id peeled;
index b259d8990a681d1804d434cea2f1e28193e6693f..3c448d438bcb0346b2de441c7d842a7ee7b5439d 100644 (file)
@@ -195,7 +195,8 @@ static int show_default(void)
        return 0;
 }
 
-static int show_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+static int show_reference(const char *refname, const struct object_id *oid,
+                         int UNUSED(flag), void *UNUSED(cb_data))
 {
        if (ref_excluded(ref_excludes, refname))
                return 0;
@@ -203,7 +204,8 @@ static int show_reference(const char *refname, const struct object_id *oid, int
        return 0;
 }
 
-static int anti_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
+static int anti_reference(const char *refname, const struct object_id *oid,
+                         int UNUSED(flag), void *UNUSED(cb_data))
 {
        show_rev(REVERSED, oid, refname);
        return 0;
index 64c649c6a238605cb847bbf515cbdca58cde990c..3ec011bea431b330d1995405b5fc506cd7e84f88 100644 (file)
@@ -404,7 +404,7 @@ static int append_ref(const char *refname, const struct object_id *oid,
 }
 
 static int append_head_ref(const char *refname, const struct object_id *oid,
-                          int flag, void *cb_data)
+                          int UNUSED(flag), void *UNUSED(cb_data))
 {
        struct object_id tmp;
        int ofs = 11;
@@ -419,7 +419,7 @@ static int append_head_ref(const char *refname, const struct object_id *oid,
 }
 
 static int append_remote_ref(const char *refname, const struct object_id *oid,
-                            int flag, void *cb_data)
+                            int UNUSED(flag), void *UNUSED(cb_data))
 {
        struct object_id tmp;
        int ofs = 13;
@@ -434,7 +434,7 @@ static int append_remote_ref(const char *refname, const struct object_id *oid,
 }
 
 static int append_tag_ref(const char *refname, const struct object_id *oid,
-                         int flag, void *cb_data)
+                         int UNUSED(flag), void *UNUSED(cb_data))
 {
        if (!starts_with(refname, "refs/tags/"))
                return 0;
index 5fa207a044e0691b9f82627b074645595603c2dd..9746537220055fd91f457355602fd894043b5f5e 100644 (file)
@@ -47,7 +47,7 @@ static void show_one(const char *refname, const struct object_id *oid)
 }
 
 static int show_ref(const char *refname, const struct object_id *oid,
-                   int flag, void *cbdata)
+                   int UNUSED(flag), void *UNUSED(cbdata))
 {
        if (show_head && !strcmp(refname, "HEAD"))
                goto match;
@@ -77,8 +77,9 @@ match:
        return 0;
 }
 
-static int add_existing(const char *refname, const struct object_id *oid,
-                       int flag, void *cbdata)
+static int add_existing(const char *refname,
+                       const struct object_id *UNUSED(oid),
+                       int UNUSED(flag), void *cbdata)
 {
        struct string_list *list = (struct string_list *)cbdata;
        string_list_insert(list, refname);
index b63f420ecef3c8f53b6043b7fdacacc945bd99bb..e24e721458d6711cf12f59f77daad6d0affa0fdb 100644 (file)
@@ -622,8 +622,9 @@ static void print_status(unsigned int flags, char state, const char *path,
        printf("\n");
 }
 
-static int handle_submodule_head_ref(const char *refname,
-                                    const struct object_id *oid, int flags,
+static int handle_submodule_head_ref(const char *UNUSED(refname),
+                                    const struct object_id *oid,
+                                    int UNUSED(flags),
                                     void *cb_data)
 {
        struct object_id *output = cb_data;
index f2a36032f84a606474607ede2ff7f0f5e743b7f3..1ab5c3233ffb2027d545501f421d1b90f2ab16d8 100644 (file)
@@ -1639,9 +1639,9 @@ struct refs_cb_data {
        struct progress *progress;
 };
 
-static int add_ref_to_set(const char *refname,
+static int add_ref_to_set(const char *UNUSED(refname),
                          const struct object_id *oid,
-                         int flags, void *cb_data)
+                         int UNUSED(flags), void *cb_data)
 {
        struct object_id peeled;
        struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
index aa98b2e54146f7de1f349f16a9a01e754a3a0b73..13eb96e0c4b3770bad9d4c2e6049c9693545728f 100644 (file)
@@ -365,7 +365,7 @@ static void add_ref_to_island(const char *island_name, const struct object_id *o
 }
 
 static int find_island_for_ref(const char *refname, const struct object_id *oid,
-                              int flags, void *data)
+                              int UNUSED(flags), void *UNUSED(data))
 {
        /*
         * We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
index d35be4177b107768d6af30c5260f16ddc8cbb5a0..bda9d0f43309b445d4d95a48b4a7f438fc8670d3 100644 (file)
@@ -176,8 +176,10 @@ static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
        return 0;
 }
 
-static int rev_list_insert_ref_oid(const char *refname, const struct object_id *oid,
-                                  int flag, void *cb_data)
+static int rev_list_insert_ref_oid(const char *UNUSED(refname),
+                                  const struct object_id *oid,
+                                  int UNUSED(flag),
+                                  void *cb_data)
 {
        return rev_list_insert_ref(cb_data, oid);
 }
@@ -580,8 +582,10 @@ static int mark_complete(const struct object_id *oid)
        return 0;
 }
 
-static int mark_complete_oid(const char *refname, const struct object_id *oid,
-                            int flag, void *cb_data)
+static int mark_complete_oid(const char *UNUSED(refname),
+                            const struct object_id *oid,
+                            int UNUSED(flag),
+                            void *UNUSED(cb_data))
 {
        return mark_complete(oid);
 }
diff --git a/help.c b/help.c
index 991e33f8a6eb1950cff6fa9f9fbaa2a4909d640b..c5b5848188f5aaf3d46ec109ceec66765869b99a 100644 (file)
--- a/help.c
+++ b/help.c
@@ -781,8 +781,9 @@ struct similar_ref_cb {
        struct string_list *similar_refs;
 };
 
-static int append_similar_ref(const char *refname, const struct object_id *oid,
-                             int flags, void *cb_data)
+static int append_similar_ref(const char *refname,
+                             const struct object_id *UNUSED(oid),
+                             int UNUSED(flags), void *cb_data)
 {
        struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
        char *branch = strrchr(refname, '/') + 1;
index 58b83a9f66bc9ffbd44b71f2414e59c647187700..20db0ea620890dd715832cbc4189c23163a1ae60 100644 (file)
@@ -505,7 +505,7 @@ static void run_service(const char **argv, int buffer_input)
 }
 
 static int show_text_ref(const char *name, const struct object_id *oid,
-                        int flag, void *cb_data)
+                        int UNUSED(flag), void *cb_data)
 {
        const char *name_nons = strip_namespace(name);
        struct strbuf *buf = cb_data;
index d0ac0a6327a18f5eeee6fc43f036c9a2618fd672..114bd80365e31b4852effe494e7100c2d2713af8 100644 (file)
@@ -135,7 +135,8 @@ static int ref_filter_match(const char *refname,
 }
 
 static int add_ref_decoration(const char *refname, const struct object_id *oid,
-                             int flags, void *cb_data)
+                             int UNUSED(flags),
+                             void *cb_data)
 {
        struct object *obj;
        enum object_type objtype;
index 434189ae5dc64a2b6bbdac01d82f4f284f9855c6..10f0a46e6240938fa95e03af9c6fbebf6f7e4a5b 100644 (file)
@@ -36,7 +36,8 @@ static void rev_list_push(struct negotiation_state *ns,
 }
 
 static int clear_marks(const char *refname, const struct object_id *oid,
-                      int flag, void *cb_data)
+                      int UNUSED(flag),
+                      void *UNUSED(cb_data))
 {
        struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
 
index 1236e7922484a2d9b98c0d87fb0973c0b6aa6587..f2aa58af9239a3ae3da22bc2b13cb92b6b831bf2 100644 (file)
@@ -72,7 +72,8 @@ static struct entry *rev_list_push(struct data *data, struct commit *commit, int
 }
 
 static int clear_marks(const char *refname, const struct object_id *oid,
-                      int flag, void *cb_data)
+                      int UNUSED(flag),
+                      void *UNUSED(cb_data))
 {
        struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
 
diff --git a/notes.c b/notes.c
index 7452e71cc8dd289c7ace9361a6c6e090b8b113f9..3be98e7085143987924976400b7387d5ea8b9f5f 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -924,8 +924,9 @@ out:
        return ret;
 }
 
-static int string_list_add_one_ref(const char *refname, const struct object_id *oid,
-                                  int flag, void *cb)
+static int string_list_add_one_ref(const char *refname,
+                                  const struct object_id *UNUSED(oid),
+                                  int UNUSED(flag), void *cb)
 {
        struct string_list *refs = cb;
        if (!unsorted_string_list_has_string(refs, refname))
index 4d2746574cde0b813a73772c13d71a30db696128..052644977eb3f6a0a9f4812232ca718e01a49569 100644 (file)
@@ -1306,7 +1306,8 @@ struct handle_one_ref_cb {
 };
 
 static int handle_one_ref(const char *path, const struct object_id *oid,
-                         int flag, void *cb_data)
+                         int UNUSED(flag),
+                         void *cb_data)
 {
        struct handle_one_ref_cb *cb = cb_data;
        struct commit_list **list = cb->list;
index 135a1a6e41cf51afaf2ffc730a225409147f81b0..ee8aaa78f580bf32e06bf134b01c3b403c70425e 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -294,7 +294,8 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
        return expire;
 }
 
-static int push_tip_to_list(const char *refname, const struct object_id *oid,
+static int push_tip_to_list(const char *UNUSED(refname),
+                           const struct object_id *oid,
                            int flags, void *cb_data)
 {
        struct commit_list **list = cb_data;
diff --git a/refs.c b/refs.c
index 90bcb2716873592864e2496951f913618521cb45..34373e8087fecef981159e850651e59561f09773 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -358,7 +358,8 @@ struct warn_if_dangling_data {
        const char *msg_fmt;
 };
 
-static int warn_if_dangling_symref(const char *refname, const struct object_id *oid,
+static int warn_if_dangling_symref(const char *refname,
+                                  const struct object_id *UNUSED(oid),
                                   int flags, void *cb_data)
 {
        struct warn_if_dangling_data *d = cb_data;
@@ -934,9 +935,11 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
        return cb->found_it;
 }
 
-static int read_ref_at_ent_newest(struct object_id *ooid, struct object_id *noid,
-                                 const char *email, timestamp_t timestamp,
-                                 int tz, const char *message, void *cb_data)
+static int read_ref_at_ent_newest(struct object_id *UNUSED(ooid),
+                                 struct object_id *noid,
+                                 const char *UNUSED(email),
+                                 timestamp_t timestamp, int tz,
+                                 const char *message, void *cb_data)
 {
        struct read_ref_at_cb *cb = cb_data;
 
index 8db7882aacb533ebf6635a0457c8b2ac7855c392..972701ce00cfd659921cca106965284ff8017677 100644 (file)
@@ -2995,7 +2995,9 @@ static int files_transaction_abort(struct ref_store *ref_store,
 }
 
 static int ref_present(const char *refname,
-                      const struct object_id *oid, int flags, void *cb_data)
+                      const struct object_id *UNUSED(oid),
+                      int UNUSED(flags),
+                      void *cb_data)
 {
        struct string_list *affected_refnames = cb_data;
 
index 618ad5a0f16aa5eb2359d4c015f8dd476570dcf1..723aa8841c3f7d6ae275ec231f8fe52fbb162ec6 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -2320,7 +2320,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
 }
 
 static int one_local_ref(const char *refname, const struct object_id *oid,
-                        int flag, void *cb_data)
+                        int UNUSED(flag),
+                        void *cb_data)
 {
        struct ref ***local_tail = cb_data;
        struct ref *ref;
index 7bd9aba6ee6c339e02c6fe25262a75a19bfc6e68..17810e5a3acc6fa6e15a2d10b5f00ff671a4790b 100644 (file)
@@ -9,7 +9,8 @@
 static int register_replace_ref(struct repository *r,
                                const char *refname,
                                const struct object_id *oid,
-                               int flag, void *cb_data)
+                               int UNUSED(flag),
+                               void *UNUSED(cb_data))
 {
        /* Get sha1 from refname */
        const char *slash = strrchr(refname, '/');
index f4eee11cc8b424fd92d43bc30bf9c3a0ae1b3492..23c2bba0d84912fadbc1b8f5df8b056d11c3a4de 100644 (file)
@@ -1543,7 +1543,8 @@ int ref_excluded(struct string_list *ref_excludes, const char *path)
 }
 
 static int handle_one_ref(const char *path, const struct object_id *oid,
-                         int flag, void *cb_data)
+                         int UNUSED(flag),
+                         void *cb_data)
 {
        struct all_refs_cb *cb = cb_data;
        struct object *object;
@@ -1627,8 +1628,8 @@ static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
 }
 
 static int handle_one_reflog(const char *refname_in_wt,
-                            const struct object_id *oid,
-                            int flag, void *cb_data)
+                            const struct object_id *UNUSED(oid),
+                            int UNUSED(flag), void *cb_data)
 {
        struct all_refs_cb *cb = cb_data;
        struct strbuf refname = STRBUF_INIT;
index 7701d7c20a12af53d2f91737f12f3dfb97ac59e9..d99d9d5f619023eb78b59978bace2b837588cf24 100644 (file)
@@ -147,7 +147,8 @@ out:
 }
 
 static int add_info_ref(const char *path, const struct object_id *oid,
-                       int flag, void *cb_data)
+                       int UNUSED(flag),
+                       void *cb_data)
 {
        struct update_info_ctx *uic = cb_data;
        struct object *o = parse_object(the_repository, oid);
index 8cb768ee5f886fdafcf16221e5878b8fc080f253..71ab04f935c23873e3598064e9b53795fbe6418e 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -604,8 +604,10 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
        free(tmp);
 }
 
-static int mark_uninteresting(const char *refname, const struct object_id *oid,
-                             int flags, void *cb_data)
+static int mark_uninteresting(const char *UNUSED(refname),
+                             const struct object_id *oid,
+                             int UNUSED(flags),
+                             void *UNUSED(cb_data))
 {
        struct commit *commit = lookup_commit_reference_gently(the_repository,
                                                               oid, 1);
@@ -715,8 +717,10 @@ struct commit_array {
        int nr, alloc;
 };
 
-static int add_ref(const char *refname, const struct object_id *oid,
-                  int flags, void *cb_data)
+static int add_ref(const char *UNUSED(refname),
+                  const struct object_id *oid,
+                  int UNUSED(flags),
+                  void *cb_data)
 {
        struct commit_array *ca = cb_data;
        ALLOC_GROW(ca->commits, ca->nr + 1, ca->alloc);
index 3fa5db3ecdf87f4f02d583cfa66a87a2abbe5d2a..d99c978fa5b4cc80a888c7cbb226df4139eb0e72 100644 (file)
@@ -940,8 +940,9 @@ static void free_submodules_data(struct string_list *submodules)
        string_list_clear(submodules, 1);
 }
 
-static int has_remote(const char *refname, const struct object_id *oid,
-                     int flags, void *cb_data)
+static int has_remote(const char *UNUSED(refname),
+                     const struct object_id *UNUSED(oid),
+                     int UNUSED(flags), void *UNUSED(cb_data))
 {
        return 1;
 }
@@ -1243,8 +1244,9 @@ int push_unpushed_submodules(struct repository *r,
        return ret;
 }
 
-static int append_oid_to_array(const char *ref, const struct object_id *oid,
-                              int flags, void *data)
+static int append_oid_to_array(const char *UNUSED(ref),
+                              const struct object_id *oid,
+                              int UNUSED(flags), void *data)
 {
        struct oid_array *array = data;
        oid_array_append(array, oid);
index 4d18bfb1ca519cff9b498f4035e9526c285a7bee..a98775d1a6ae9458c81560ff04c240e68e7505e9 100644 (file)
@@ -161,7 +161,7 @@ static int cmd_rename_ref(struct ref_store *refs, const char **argv)
 }
 
 static int each_ref(const char *refname, const struct object_id *oid,
-                   int flags, void *cb_data)
+                   int flags, void *UNUSED(cb_data))
 {
        printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
        return 0;
index b217a1f469e8d9b8aaf92a27aba186be83dcfa62..b2cbca1e8bcaf7f024e0c5068ff66e3682cb0680 100644 (file)
@@ -1170,7 +1170,7 @@ static int mark_our_ref(const char *refname, const char *refname_full,
 }
 
 static int check_ref(const char *refname_full, const struct object_id *oid,
-                    int flag, void *cb_data)
+                    int UNUSED(flag), void *UNUSED(cb_data))
 {
        const char *refname = strip_namespace(refname_full);
 
@@ -1194,7 +1194,7 @@ static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {
 }
 
 static int send_ref(const char *refname, const struct object_id *oid,
-                   int flag, void *cb_data)
+                   int UNUSED(flag), void *cb_data)
 {
        static const char *capabilities = "multi_ack thin-pack side-band"
                " side-band-64k ofs-delta shallow deepen-since deepen-not"
@@ -1236,7 +1236,8 @@ static int send_ref(const char *refname, const struct object_id *oid,
        return 0;
 }
 
-static int find_symref(const char *refname, const struct object_id *oid,
+static int find_symref(const char *refname,
+                      const struct object_id *UNUSED(oid),
                       int flag, void *cb_data)
 {
        const char *symref_target;
index c5e292197956487c2a44f84f7839126d3a796cfc..f945d021f8c0cbb37fe480af1e4494e7322ccfe0 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -215,8 +215,10 @@ static int interpret_target(struct walker *walker, char *target, struct object_i
        return -1;
 }
 
-static int mark_complete(const char *path, const struct object_id *oid,
-                        int flag, void *cb_data)
+static int mark_complete(const char *UNUSED(path),
+                        const struct object_id *oid,
+                        int UNUSED(flag),
+                        void *UNUSED(cb_data))
 {
        struct commit *commit = lookup_commit_reference_gently(the_repository,
                                                               oid, 1);