]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-compat-util.h: use "UNUSED", not "UNUSED(var)"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 25 Aug 2022 17:09:48 +0000 (19:09 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Sep 2022 17:49:48 +0000 (10:49 -0700)
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>
93 files changed:
add-interactive.c
archive-tar.c
archive-zip.c
archive.c
attr.c
bisect.c
bloom.c
builtin/am.c
builtin/bisect--helper.c
builtin/checkout.c
builtin/commit-graph.c
builtin/config.c
builtin/describe.c
builtin/difftool.c
builtin/fast-export.c
builtin/fast-import.c
builtin/fetch.c
builtin/fsck.c
builtin/gc.c
builtin/log.c
builtin/ls-tree.c
builtin/multi-pack-index.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/stash.c
builtin/submodule--helper.c
color.c
commit-graph.c
commit.c
compat/terminal.c
config.c
convert.c
delta-islands.c
diff.c
dir.c
environment.c
fetch-pack.c
git-compat-util.h
gpg-interface.c
hashmap.c
help.c
http-backend.c
ident.c
ll-merge.c
log-tree.c
ls-refs.c
merge-recursive.c
name-hash.c
negotiator/default.c
negotiator/skipping.c
notes.c
object-name.c
object-store.h
oidmap.c
packfile.c
pager.c
patch-ids.c
pretty.c
range-diff.c
ref-filter.c
reflog.c
refs.c
refs/files-backend.c
refs/iterator.c
refs/packed-backend.c
remote.c
replace-object.c
revision.c
send-pack.c
sequencer.c
server-info.c
shallow.c
strbuf.c
streaming.c
strmap.c
sub-process.c
submodule-config.c
submodule.c
t/helper/test-config.c
t/helper/test-ref-store.c
t/helper/test-userdiff.c
trailer.c
transport.c
upload-pack.c
walker.c
wt-status.c

index 2fcad676544480913984ef999c6ef93b0627a30d..f071b2a1b4f2ee8bf1959706d1778c3697d81ba7 100644 (file)
@@ -430,7 +430,7 @@ struct pathname_entry {
        struct file_item *item;
 };
 
-static int pathname_entry_cmp(const void *UNUSED(cmp_data),
+static int pathname_entry_cmp(const void *cmp_data UNUSED,
                              const struct hashmap_entry *he1,
                              const struct hashmap_entry *he2,
                              const void *name)
index 0d66a1e0a859e9878acbfa73bfda76c8fe73ed25..3e4822b68409b85d36436bd42da862991274cd81 100644 (file)
@@ -367,7 +367,7 @@ static struct archiver *find_tar_filter(const char *name, size_t len)
 }
 
 static int tar_filter_config(const char *var, const char *value,
-                            void *UNUSED(data))
+                            void *data UNUSED)
 {
        struct archiver *ar;
        const char *name;
@@ -421,7 +421,7 @@ static int git_tar_config(const char *var, const char *value, void *cb)
        return tar_filter_config(var, value, cb);
 }
 
-static int write_tar_archive(const struct archiver *UNUSED(ar),
+static int write_tar_archive(const struct archiver *ar UNUSED,
                             struct archiver_args *args)
 {
        int err = 0;
index d63782dc31b19202c5f9b5df1935a01aaf8cdfe1..0456f1ebf15c839639f4759c329cb957b0a64feb 100644 (file)
@@ -613,12 +613,12 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
 }
 
 static int archive_zip_config(const char *var, const char *value,
-                             void *UNUSED(data))
+                             void *data UNUSED)
 {
        return userdiff_config(var, value);
 }
 
-static int write_zip_archive(const struct archiver *UNUSED(ar),
+static int write_zip_archive(const struct archiver *ar UNUSED,
                             struct archiver_args *args)
 {
        int err;
index 8b165e935bd8e139deef5a37e9c4eef8bbe556b3..61a79e4a2270dfc0e738ee97dd5cb5a9054ba79f 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -382,7 +382,7 @@ struct path_exists_context {
        struct archiver_args *args;
 };
 
-static int reject_entry(const struct object_id *UNUSED(oid),
+static int reject_entry(const struct object_id *oid UNUSED,
                        struct strbuf *base,
                        const char *filename, unsigned mode,
                        void *context)
diff --git a/attr.c b/attr.c
index 375b5c0dbf7c200f1efb5423dda195af65ab1db5..0b599334dd885978cbbc8fa7ac20063ad8fcfde5 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -61,10 +61,10 @@ struct attr_hash_entry {
 };
 
 /* attr_hashmap comparison function */
-static int attr_hash_entry_cmp(const void *UNUSED(cmp_data),
+static int attr_hash_entry_cmp(const void *cmp_data UNUSED,
                               const struct hashmap_entry *eptr,
                               const struct hashmap_entry *entry_or_key,
-                              const void *UNUSED(keydata))
+                              const void *keydata UNUSED)
 {
        const struct attr_hash_entry *a, *b;
 
index 07ccd1bce614137c2f5c8d0684a9004f9eb7534f..fd581b85a72cc6d1f9b447893f9a3b345a8ce9da 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 UNUSED(flags), void *UNUSED(cb_data))
+                       int flags UNUSED, void *cb_data UNUSED)
 {
        struct strbuf good_prefix = STRBUF_INIT;
        strbuf_addstr(&good_prefix, term_good);
@@ -1161,8 +1161,8 @@ int estimate_bisect_steps(int all)
 }
 
 static int mark_for_removal(const char *refname,
-                           const struct object_id *UNUSED(oid),
-                           int UNUSED(flag), void *cb_data)
+                           const struct object_id *oid UNUSED,
+                           int flag UNUSED, void *cb_data)
 {
        struct string_list *refs = cb_data;
        char *ref = xstrfmt("refs/bisect%s", refname);
diff --git a/bloom.c b/bloom.c
index 94fb97e60edd3f94309eac6451255036f8983489..d0730525da51f783e0f72f502a62db4407bd7ad9 100644 (file)
--- a/bloom.c
+++ b/bloom.c
@@ -163,10 +163,10 @@ void init_bloom_filters(void)
        init_bloom_filter_slab(&bloom_filters);
 }
 
-static int pathmap_cmp(const void *UNUSED(hashmap_cmp_fn_data),
+static int pathmap_cmp(const void *hashmap_cmp_fn_data UNUSED,
                       const struct hashmap_entry *eptr,
                       const struct hashmap_entry *entry_or_key,
-                      const void *UNUSED(keydata))
+                      const void *keydata UNUSED)
 {
        const struct pathmap_hash_entry *e1, *e2;
 
index 0811b9ff676f531c48e5d8b6875f1f77f83bc439..39fea24833078be76d76d974e5b601715ed51aea 100644 (file)
@@ -2301,7 +2301,7 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
        return 0;
 }
 
-static int git_am_config(const char *k, const char *v, void *UNUSED(cb))
+static int git_am_config(const char *k, const char *v, void *cb UNUSED)
 {
        int status;
 
index 87c8b2d818b7fb837c676b5ed3044d76d0a4bbcb..aa975bd92680337e220a7419b09b34a440027a83 100644 (file)
@@ -329,9 +329,9 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
        return 0;
 }
 
-static int inc_nr(const char *UNUSED(refname),
-                 const struct object_id *UNUSED(oid),
-                 int UNUSED(flag), void *cb_data)
+static int inc_nr(const char *refname UNUSED,
+                 const struct object_id *oid UNUSED,
+                 int flag UNUSED, void *cb_data)
 {
        unsigned int *nr = (unsigned int *)cb_data;
        (*nr)++;
@@ -519,7 +519,7 @@ finish:
 }
 
 static int add_bisect_ref(const char *refname, const struct object_id *oid,
-                         int UNUSED(flags), void *cb)
+                         int flags UNUSED, void *cb)
 {
        struct add_bisect_ref_data *data = cb;
 
@@ -1135,9 +1135,9 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a
        return res;
 }
 
-static int get_first_good(const char *UNUSED(refname),
+static int get_first_good(const char *refname UNUSED,
                          const struct object_id *oid,
-                         int UNUSED(flag), void *cb_data)
+                         int flag UNUSED, void *cb_data)
 {
        oidcpy(cb_data, oid);
        return 1;
index d18c8c886e9cecdfda712dcdc211d6ad9dc402f2..2a132392fbe7478c808b01d06039112fc321a55e 100644 (file)
@@ -125,7 +125,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm
 }
 
 static int update_some(const struct object_id *oid, struct strbuf *base,
-                      const char *pathname, unsigned mode, void *UNUSED(context))
+                      const char *pathname, unsigned mode, void *context UNUSED)
 {
        int len;
        struct cache_entry *ce;
@@ -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 UNUSED(flags), void *cb_data)
+                                        int flags UNUSED, void *cb_data)
 {
        add_pending_oid(cb_data, refname, oid, UNINTERESTING);
        return 0;
index ea923ea33ad73a24a812e17410f563d657814295..aaa1b5b960064ac1390df0d4bba203d90198573c 100644 (file)
@@ -179,7 +179,7 @@ static int write_option_max_new_filters(const struct option *opt,
 }
 
 static int git_commit_graph_write_config(const char *var, const char *value,
-                                        void *UNUSED(cb))
+                                        void *cb UNUSED)
 {
        if (!strcmp(var, "commitgraph.maxnewfilters"))
                write_opts.max_new_filters = git_config_int(var, value);
index bdc8b1d1a89771a9eec76ec5a2ef68f87dc3bde0..753e5fac297e08763317adcab2fefe386ea68421 100644 (file)
@@ -208,7 +208,7 @@ static void show_config_scope(struct strbuf *buf)
 }
 
 static int show_all_config(const char *key_, const char *value_,
-                          void *UNUSED(cb))
+                          void *cb UNUSED)
 {
        if (show_origin || show_scope) {
                struct strbuf buf = STRBUF_INIT;
@@ -460,7 +460,7 @@ static const char *get_colorbool_slot;
 static char parsed_color[COLOR_MAXLEN];
 
 static int git_get_color_config(const char *var, const char *value,
-                               void *UNUSED(cb))
+                               void *cb UNUSED)
 {
        if (!strcmp(var, get_color_slot)) {
                if (!value)
@@ -492,7 +492,7 @@ static int get_colorbool_found;
 static int get_diff_color_found;
 static int get_color_ui_found;
 static int git_get_colorbool_config(const char *var, const char *value,
-                                   void *UNUSED(data))
+                                   void *data UNUSED)
 {
        if (!strcmp(var, get_colorbool_slot))
                get_colorbool_found = git_config_colorbool(var, value);
index 084fa00f2a5d4ce15cd382aeac143b157a87eac5..e17c4b4c69b0feb7b9c8a897ca6120e46e502251 100644 (file)
@@ -63,7 +63,7 @@ static const char *prio_names[] = {
        N_("head"), N_("lightweight"), N_("annotated"),
 };
 
-static int commit_name_neq(const void *UNUSED(cmp_data),
+static int commit_name_neq(const void *cmp_data UNUSED,
                           const struct hashmap_entry *eptr,
                           const struct hashmap_entry *entry_or_key,
                           const void *peeled)
@@ -141,7 +141,7 @@ static void add_to_known_names(const char *path,
 }
 
 static int get_name(const char *path, const struct object_id *oid,
-                   int UNUSED(flag), void *UNUSED(cb_data))
+                   int flag UNUSED, void *cb_data UNUSED)
 {
        int is_tag = 0;
        struct object_id peeled;
index a570200e66accd5c3687a8f3e656f366119a2856..f780ebfd55f2514b773404f1db7c4f52a5b6ed1c 100644 (file)
@@ -125,10 +125,10 @@ struct working_tree_entry {
        char path[FLEX_ARRAY];
 };
 
-static int working_tree_entry_cmp(const void *UNUSED(cmp_data),
+static int working_tree_entry_cmp(const void *cmp_data UNUSED,
                                  const struct hashmap_entry *eptr,
                                  const struct hashmap_entry *entry_or_key,
-                                 const void *UNUSED(keydata))
+                                 const void *keydata UNUSED)
 {
        const struct working_tree_entry *a, *b;
 
@@ -148,10 +148,10 @@ struct pair_entry {
        const char path[FLEX_ARRAY];
 };
 
-static int pair_cmp(const void *UNUSED(cmp_data),
+static int pair_cmp(const void *cmp_data UNUSED,
                    const struct hashmap_entry *eptr,
                    const struct hashmap_entry *entry_or_key,
-                   const void *UNUSED(keydata))
+                   const void *keydata UNUSED)
 {
        const struct pair_entry *a, *b;
 
@@ -184,7 +184,7 @@ struct path_entry {
        char path[FLEX_ARRAY];
 };
 
-static int path_entry_cmp(const void *UNUSED(cmp_data),
+static int path_entry_cmp(const void *cmp_data UNUSED,
                          const struct hashmap_entry *eptr,
                          const struct hashmap_entry *entry_or_key,
                          const void *key)
index bb05b50a5a0a1fcdc65c6e98b81c442b9fc592a3..ab5b0ff610afee5729ac81b46534daafeef78eb6 100644 (file)
@@ -119,7 +119,7 @@ struct anonymized_entry_key {
        size_t orig_len;
 };
 
-static int anonymized_entry_cmp(const void *UNUSED(cmp_data),
+static int anonymized_entry_cmp(const void *cmp_data UNUSED,
                                const struct hashmap_entry *eptr,
                                const struct hashmap_entry *entry_or_key,
                                const void *keydata)
index 76ed0c2db9c1e6347619a40b220be2ccd87a97e5..7134683ab93f96d4c213d478fc7fadc8a17856c0 100644 (file)
@@ -46,7 +46,7 @@ struct object_entry {
                depth : DEPTH_BITS;
 };
 
-static int object_entry_hashcmp(const void *UNUSED(map_data),
+static int object_entry_hashcmp(const void *map_data UNUSED,
                                const struct hashmap_entry *eptr,
                                const struct hashmap_entry *entry_or_key,
                                const void *keydata)
index 5fddaef4804b2d9aa5c44364caf0a5dc8eb91d8b..7f5b0f4c2a30829517cdefa7e86fbc68fa819684 100644 (file)
@@ -301,7 +301,7 @@ struct refname_hash_entry {
        char refname[FLEX_ARRAY];
 };
 
-static int refname_hash_entry_cmp(const void *UNUSED(hashmap_cmp_fn_data),
+static int refname_hash_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
                                  const struct hashmap_entry *eptr,
                                  const struct hashmap_entry *entry_or_key,
                                  const void *keydata)
@@ -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 UNUSED(flag), void *cbdata)
+                          int flag UNUSED, void *cbdata)
 {
        struct hashmap *refname_map = cbdata;
 
@@ -1462,9 +1462,9 @@ static void set_option(struct transport *transport, const char *name, const char
 }
 
 
-static int add_oid(const char *UNUSED(refname),
+static int add_oid(const char *refname UNUSED,
                   const struct object_id *oid,
-                  int UNUSED(flags), void *cb_data)
+                  int flags UNUSED, void *cb_data)
 {
        struct oid_array *oids = cb_data;
 
index 31d3da8954bedea1988abc38319a4ca8c87a2189..f7916f06ed51119576035c9381c4dace2dbbecf2 100644 (file)
@@ -488,9 +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 *UNUSED(email),
-                                 timestamp_t timestamp, int UNUSED(tz),
-                                 const char *UNUSED(message), void *cb_data)
+                                 const char *email UNUSED,
+                                 timestamp_t timestamp, int tz UNUSED,
+                                 const char *message UNUSED, void *cb_data)
 {
        const char *refname = cb_data;
 
@@ -504,8 +504,8 @@ static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid
 }
 
 static int fsck_handle_reflog(const char *logname,
-                             const struct object_id *UNUSED(oid),
-                             int UNUSED(flag), void *cb_data)
+                             const struct object_id *oid UNUSED,
+                             int flag UNUSED, void *cb_data)
 {
        struct strbuf refname = STRBUF_INIT;
 
@@ -516,7 +516,7 @@ static int fsck_handle_reflog(const char *logname,
 }
 
 static int fsck_handle_ref(const char *refname, const struct object_id *oid,
-                          int UNUSED(flag), void *UNUSED(cb_data))
+                          int flag UNUSED, void *cb_data UNUSED)
 {
        struct object *obj;
 
index e4ede128c9237a43c7f2d045b8ce47f07a5c3dc9..2d093211855174d549f001777ca9fb04761c919e 100644 (file)
@@ -782,9 +782,9 @@ struct cg_auto_data {
        int limit;
 };
 
-static int dfs_on_ref(const char *UNUSED(refname),
+static int dfs_on_ref(const char *refname UNUSED,
                      const struct object_id *oid,
-                     int UNUSED(flags),
+                     int flags UNUSED,
                      void *cb_data)
 {
        struct cg_auto_data *data = (struct cg_auto_data *)cb_data;
index 79a2e4d0bbb6375ece7148952daa65a2e757a5cc..3f9a6e8cf20340af43e3d96c9e547aaa894aa1c7 100644 (file)
@@ -645,8 +645,8 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
        return 0;
 }
 
-static int show_tree_object(const struct object_id *UNUSED(oid),
-                           struct strbuf *UNUSED(base),
+static int show_tree_object(const struct object_id *oid UNUSED,
+                           struct strbuf *base UNUSED,
                            const char *pathname, unsigned mode,
                            void *context)
 {
index 48df337605f1d75e600ec9f23f53edc18a03f4b0..c3ea09281afebe0c9aefb690f6f10044142a4d1a 100644 (file)
@@ -142,7 +142,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
 }
 
 static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
-                        const char *pathname, unsigned mode, void *UNUSED(context))
+                        const char *pathname, unsigned mode, void *context UNUSED)
 {
        size_t baselen;
        int recurse = 0;
@@ -213,7 +213,7 @@ static void show_tree_common_default_long(struct strbuf *base,
 
 static int show_tree_default(const struct object_id *oid, struct strbuf *base,
                             const char *pathname, unsigned mode,
-                            void *UNUSED(context))
+                            void *context UNUSED)
 {
        int early;
        int recurse;
@@ -231,7 +231,7 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
 
 static int show_tree_long(const struct object_id *oid, struct strbuf *base,
                          const char *pathname, unsigned mode,
-                         void *UNUSED(context))
+                         void *context UNUSED)
 {
        int early;
        int recurse;
@@ -261,7 +261,7 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
 
 static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
                               const char *pathname, unsigned mode,
-                              void *UNUSED(context))
+                              void *context UNUSED)
 {
        int early;
        int recurse;
@@ -282,7 +282,7 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
 
 static int show_tree_object(const struct object_id *oid, struct strbuf *base,
                            const char *pathname, unsigned mode,
-                           void *UNUSED(context))
+                           void *context UNUSED)
 {
        int early;
        int recurse;
index 8d156766afe86cefa54de7013c1ab353dce800f3..b3a3f0a571a4a742f419962eaa78416a4dcb6ad0 100644 (file)
@@ -78,7 +78,7 @@ static struct option *add_common_options(struct option *prev)
 }
 
 static int git_multi_pack_index_write_config(const char *var, const char *value,
-                                            void *UNUSED(cb))
+                                            void *cb UNUSED)
 {
        if (!strcmp(var, "pack.writebitmaphashcache")) {
                if (git_config_bool(var, value))
index c4dc143c4b79ec8e8bb56aee7eed0977685ce1e1..15535e914a6939d661296798e0b325da9f1ac7b6 100644 (file)
@@ -345,7 +345,7 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
 }
 
 static int name_ref(const char *path, const struct object_id *oid,
-                   int UNUSED(flags), void *cb_data)
+                   int flags UNUSED, void *cb_data)
 {
        struct object *o = parse_object(the_repository, oid);
        struct name_ref_data *data = cb_data;
index eb93e5c8fe92e3d9ec32ebe6a5ea9d82fbb85387..8fd2794a324a21377aa7ee341e22aca57c978a05 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 *UNUSED(path), const struct object_id *oid,
-                      int UNUSED(flag), void *UNUSED(cb_data))
+static int mark_tagged(const char *path UNUSED, const struct object_id *oid,
+                      int flag UNUSED, void *cb_data UNUSED)
 {
        struct object_id peeled;
        struct object_entry *entry = packlist_find(&to_pack, oid);
@@ -3035,8 +3035,8 @@ static void add_tag_chain(const struct object_id *oid)
        }
 }
 
-static int add_ref_tag(const char *UNUSED(tag), const struct object_id *oid,
-                      int UNUSED(flag), void *UNUSED(cb_data))
+static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid,
+                      int flag UNUSED, void *cb_data UNUSED)
 {
        struct object_id peeled;
 
@@ -3952,8 +3952,8 @@ 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 UNUSED(flags),
-                                    void *UNUSED(data))
+                                    int flags UNUSED,
+                                    void *data UNUSED)
 {
        struct object_id peeled;
        struct object *object;
index 6882d526e67d8d1ad997646598d37b55b5f8acd2..44bcea3a5b3add614c72531d112b7b4a9777751a 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 UNUSED(flag), void *data)
+                      int flag UNUSED, void *data)
 {
        struct oidset *seen = data;
        const char *path = strip_namespace(path_full);
@@ -465,7 +465,7 @@ static void rp_error(const char *err, ...)
        va_end(params);
 }
 
-static int copy_to_sideband(int in, int UNUSED(out), void *UNUSED(arg))
+static int copy_to_sideband(int in, int out UNUSED, void *arg UNUSED)
 {
        char data[128];
        int keepalive_active = 0;
index 63f9a233571ee0cb382675b5a6bbf6ce761563bd..8f2da0b65b938d9aacc2bb94b76bb28c7a382e02 100644 (file)
@@ -56,8 +56,8 @@ struct worktree_reflogs {
        struct string_list reflogs;
 };
 
-static int collect_reflog(const char *ref, const struct object_id *UNUSED(oid),
-                         int UNUSED(flags), void *cb_data)
+static int collect_reflog(const char *ref, const struct object_id *oid UNUSED,
+                         int flags UNUSED, void *cb_data)
 {
        struct worktree_reflogs *cb = cb_data;
        struct worktree *worktree = cb->worktree;
index 87dda7c37bdb984a090c237e258c78f85c762f3f..24cd809d2405b647d851b43bde0e98225c1ece5c 100644 (file)
@@ -265,7 +265,7 @@ 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 *UNUSED(data))
+                               void *data UNUSED)
 {
        const char *orig_key = key;
        char *name;
@@ -539,8 +539,8 @@ struct branches_for_remote {
 };
 
 static int add_branch_for_removal(const char *refname,
-                                 const struct object_id *UNUSED(oid),
-                                 int UNUSED(flags), void *cb_data)
+                                 const struct object_id *oid UNUSED,
+                                 int flags UNUSED, void *cb_data)
 {
        struct branches_for_remote *branches = cb_data;
        struct refspec_item refspec;
@@ -582,8 +582,8 @@ struct rename_info {
 };
 
 static int read_remote_branches(const char *refname,
-                               const struct object_id *UNUSED(oid),
-                               int UNUSED(flags), void *cb_data)
+                               const struct object_id *oid UNUSED,
+                               int flags UNUSED, void *cb_data)
 {
        struct rename_info *rename = cb_data;
        struct strbuf buf = STRBUF_INIT;
@@ -956,7 +956,7 @@ static void free_remote_ref_states(struct ref_states *states)
 }
 
 static int append_ref_to_tracked_list(const char *refname,
-                                     const struct object_id *UNUSED(oid),
+                                     const struct object_id *oid UNUSED,
                                      int flags, void *cb_data)
 {
        struct ref_states *states = cb_data;
@@ -1486,7 +1486,7 @@ static int prune(int argc, const char **argv)
        return result;
 }
 
-static int get_remote_default(const char *key, const char *UNUSED(value), void *priv)
+static int get_remote_default(const char *key, const char *value UNUSED, void *priv)
 {
        if (strcmp(key, "remotes.default") == 0) {
                int *found = priv;
index ff952dec48d28da0e23bdd475b967ae01777a5c4..a5bacc7797435696cd6e23e73f847fc00d39bb7f 100644 (file)
@@ -514,9 +514,9 @@ struct midx_snapshot_ref_data {
        int preferred;
 };
 
-static int midx_snapshot_ref_one(const char *UNUSED(refname),
+static int midx_snapshot_ref_one(const char *refname UNUSED,
                                 const struct object_id *oid,
-                                int UNUSED(flag), void *_data)
+                                int flag UNUSED, void *_data)
 {
        struct midx_snapshot_ref_data *data = _data;
        struct object_id peeled;
index 3c448d438bcb0346b2de441c7d842a7ee7b5439d..e5d70ee6d2d246a31aac6299a413d239c3ce2727 100644 (file)
@@ -196,7 +196,7 @@ static int show_default(void)
 }
 
 static int show_reference(const char *refname, const struct object_id *oid,
-                         int UNUSED(flag), void *UNUSED(cb_data))
+                         int flag UNUSED, void *cb_data UNUSED)
 {
        if (ref_excluded(ref_excludes, refname))
                return 0;
@@ -205,7 +205,7 @@ static int show_reference(const char *refname, const struct object_id *oid,
 }
 
 static int anti_reference(const char *refname, const struct object_id *oid,
-                         int UNUSED(flag), void *UNUSED(cb_data))
+                         int flag UNUSED, void *cb_data UNUSED)
 {
        show_rev(REVERSED, oid, refname);
        return 0;
index 3ec011bea431b330d1995405b5fc506cd7e84f88..d3f5715e3e3af468fa7b1b444454ef30f6313f0c 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 UNUSED(flag), void *UNUSED(cb_data))
+                          int flag UNUSED, void *cb_data UNUSED)
 {
        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 UNUSED(flag), void *UNUSED(cb_data))
+                            int flag UNUSED, void *cb_data UNUSED)
 {
        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 UNUSED(flag), void *UNUSED(cb_data))
+                         int flag UNUSED, void *cb_data UNUSED)
 {
        if (!starts_with(refname, "refs/tags/"))
                return 0;
index 9746537220055fd91f457355602fd894043b5f5e..48569061087416ee0cc78f777094e8b1ed0660db 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 UNUSED(flag), void *UNUSED(cbdata))
+                   int flag UNUSED, void *cbdata UNUSED)
 {
        if (show_head && !strcmp(refname, "HEAD"))
                goto match;
@@ -78,8 +78,8 @@ match:
 }
 
 static int add_existing(const char *refname,
-                       const struct object_id *UNUSED(oid),
-                       int UNUSED(flag), void *cbdata)
+                       const struct object_id *oid UNUSED,
+                       int flag UNUSED, void *cbdata)
 {
        struct string_list *list = (struct string_list *)cbdata;
        string_list_insert(list, refname);
index a741b920b329910c595762942500190d2ef51364..3492aff751ab61a7d4dcf0b6132303fbe9575b7c 100644 (file)
@@ -638,12 +638,12 @@ cleanup:
        return ret;
 }
 
-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))
+static int reject_reflog_ent(struct object_id *ooid UNUSED,
+                            struct object_id *noid UNUSED,
+                            const char *email UNUSED,
+                            timestamp_t timestamp UNUSED,
+                            int tz UNUSED, const char *message UNUSED,
+                            void *cb_data UNUSED)
 {
        return 1;
 }
index e24e721458d6711cf12f59f77daad6d0affa0fdb..88df6c5017d16cdb53a721a9875f6d224c0dce97 100644 (file)
@@ -622,9 +622,9 @@ static void print_status(unsigned int flags, char state, const char *path,
        printf("\n");
 }
 
-static int handle_submodule_head_ref(const char *UNUSED(refname),
+static int handle_submodule_head_ref(const char *refname UNUSED,
                                     const struct object_id *oid,
-                                    int UNUSED(flags),
+                                    int flags UNUSED,
                                     void *cb_data)
 {
        struct object_id *output = cb_data;
diff --git a/color.c b/color.c
index 04ad0a8bf75375a8f3556c925a8fd4a57e61c29b..f05d8a81d72115edbf47d34950a31615a15ea98e 100644 (file)
--- a/color.c
+++ b/color.c
@@ -415,7 +415,7 @@ int want_color_fd(int fd, int var)
        return var;
 }
 
-int git_color_config(const char *var, const char *value, void *UNUSED(cb))
+int git_color_config(const char *var, const char *value, void *cb UNUSED)
 {
        if (!strcmp(var, "color.ui")) {
                git_use_color_default = git_config_colorbool(var, value);
index 1ab5c3233ffb2027d545501f421d1b90f2ab16d8..97dd1001ece33667be29798a0cee26eb2c9825f5 100644 (file)
@@ -1639,9 +1639,9 @@ struct refs_cb_data {
        struct progress *progress;
 };
 
-static int add_ref_to_set(const char *UNUSED(refname),
+static int add_ref_to_set(const char *refname UNUSED,
                          const struct object_id *oid,
-                         int UNUSED(flags), void *cb_data)
+                         int flags UNUSED, void *cb_data)
 {
        struct object_id peeled;
        struct refs_cb_data *data = (struct refs_cb_data *)cb_data;
index cb20082736ddb7aba41701e76d15e3190478e88a..89b8efc6116883d032912cdc38429b5a8ba5f2f6 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -951,9 +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 *UNUSED(ident),
-                                 timestamp_t UNUSED(timestamp), int UNUSED(tz),
-                                 const char *UNUSED(message), void *cbdata)
+                                 const char *ident UNUSED,
+                                 timestamp_t timestamp UNUSED, int tz UNUSED,
+                                 const char *message UNUSED, void *cbdata)
 {
        struct rev_collect *revs = cbdata;
 
index 0b0caae8571fb09fe35c70b67743b88beca93841..ea490a7ced431a798629ca86ac904052d99f839a 100644 (file)
@@ -477,7 +477,7 @@ struct escape_sequence_entry {
        char sequence[FLEX_ARRAY];
 };
 
-static int sequence_entry_cmp(const void *UNUSED(hashmap_cmp_fn_data),
+static int sequence_entry_cmp(const void *hashmap_cmp_fn_data UNUSED,
                              const struct escape_sequence_entry *e1,
                              const struct escape_sequence_entry *e2,
                              const void *keydata)
index c92f1efd6bf0272f639ae89f7545984cfc0a851c..cbb5a3bab74f6f6f292c1628ed889e57f0157d10 100644 (file)
--- a/config.c
+++ b/config.c
@@ -362,8 +362,8 @@ static void populate_remote_urls(struct config_include_data *inc)
        current_parsing_scope = store_scope;
 }
 
-static int forbid_remote_url(const char *var, const char *UNUSED(value),
-                            void *UNUSED(data))
+static int forbid_remote_url(const char *var, const char *value UNUSED,
+                            void *data UNUSED)
 {
        const char *remote_name;
        size_t remote_name_len;
@@ -2338,10 +2338,10 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
        return 0;
 }
 
-static int config_set_element_cmp(const void *UNUSED(cmp_data),
+static int config_set_element_cmp(const void *cmp_data UNUSED,
                                  const struct hashmap_entry *eptr,
                                  const struct hashmap_entry *entry_or_key,
-                                 const void *UNUSED(keydata))
+                                 const void *keydata UNUSED)
 {
        const struct config_set_element *e1, *e2;
 
index 25d89fa83ba43441804eeaac6026a348bb0c4f7a..95e6a5244fc26c029abff85bb37a4e9fae71acba 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -619,7 +619,7 @@ struct filter_params {
        const char *path;
 };
 
-static int filter_buffer_or_fd(int UNUSED(in), int out, void *data)
+static int filter_buffer_or_fd(int in UNUSED, int out, void *data)
 {
        /*
         * Spawn cmd and feed the buffer contents through its stdin.
@@ -1008,7 +1008,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
        return 0;
 }
 
-static int read_convert_config(const char *var, const char *value, void *UNUSED(cb))
+static int read_convert_config(const char *var, const char *value, void *cb UNUSED)
 {
        const char *key, *name;
        size_t namelen;
index c64333f9de2e56f985f9f6fc58ac7bebd227a93f..26f9e99e1a978921d9ec19725c09a88247548d95 100644 (file)
@@ -316,7 +316,7 @@ static regex_t *island_regexes;
 static unsigned int island_regexes_alloc, island_regexes_nr;
 static const char *core_island_name;
 
-static int island_config_callback(const char *k, const char *v, void *UNUSED(cb))
+static int island_config_callback(const char *k, const char *v, void *cb UNUSED)
 {
        if (!strcmp(k, "pack.island")) {
                struct strbuf re = STRBUF_INIT;
@@ -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 UNUSED(flags), void *UNUSED(data))
+                              int flags UNUSED, void *data UNUSED)
 {
        /*
         * We should advertise 'ARRAY_SIZE(matches) - 2' as the max,
diff --git a/diff.c b/diff.c
index 7c7d53d2771c28c9f413a90c946f2911ebc5ebe3..f19bc7662897bfe467e49ac1e81bd43b78f12f23 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -265,7 +265,7 @@ void init_diff_ui_defaults(void)
 }
 
 int git_diff_heuristic_config(const char *var, const char *value,
-                             void *UNUSED(cb))
+                             void *cb UNUSED)
 {
        if (!strcmp(var, "diff.indentheuristic"))
                diff_indent_heuristic = git_config_bool(var, value);
@@ -917,7 +917,7 @@ struct interned_diff_symbol {
 static int interned_diff_symbol_cmp(const void *hashmap_cmp_fn_data,
                                    const struct hashmap_entry *eptr,
                                    const struct hashmap_entry *entry_or_key,
-                                   const void *UNUSED(keydata))
+                                   const void *keydata UNUSED)
 {
        const struct diff_options *diffopt = hashmap_cmp_fn_data;
        const struct emitted_diff_symbol *a, *b;
diff --git a/dir.c b/dir.c
index 42f8ee06e09ee515c128784e09dbd336cb5e20f8..a2ec4f652ba33e5b38ab4e2e2c079ce4e210adb3 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -655,10 +655,10 @@ void parse_path_pattern(const char **pattern,
        *patternlen = len;
 }
 
-int pl_hashmap_cmp(const void *UNUSED(cmp_data),
+int pl_hashmap_cmp(const void *cmp_data UNUSED,
                   const struct hashmap_entry *a,
                   const struct hashmap_entry *b,
-                  const void *UNUSED(key))
+                  const void *key UNUSED)
 {
        const struct pattern_entry *ee1 =
                        container_of(a, struct pattern_entry, ent);
index a0ceb6d65585d80007dd74593a267ad7197a2f3f..c94480f92f43f41bd7aa3bef7b42f33f39f6116e 100644 (file)
@@ -333,10 +333,10 @@ static void set_git_dir_1(const char *path)
        setup_git_env(path);
 }
 
-static void update_relative_gitdir(const char *UNUSED(name),
+static void update_relative_gitdir(const char *name UNUSED,
                                   const char *old_cwd,
                                   const char *new_cwd,
-                                  void *UNUSED(data))
+                                  void *data UNUSED)
 {
        char *path = reparent_relative_path(old_cwd, new_cwd, get_git_dir());
        struct tmp_objdir *tmp_objdir = tmp_objdir_unapply_primary_odb();
index 9f2933e868a8dbd9156e2ad01776dbbffdb61425..633718099b7c7945b70c3b47bdbc00e00100f4b7 100644 (file)
@@ -176,9 +176,9 @@ static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
        return 0;
 }
 
-static int rev_list_insert_ref_oid(const char *UNUSED(refname),
+static int rev_list_insert_ref_oid(const char *refname UNUSED,
                                   const struct object_id *oid,
-                                  int UNUSED(flag),
+                                  int flag UNUSED,
                                   void *cb_data)
 {
        return rev_list_insert_ref(cb_data, oid);
@@ -582,10 +582,10 @@ static int mark_complete(const struct object_id *oid)
        return 0;
 }
 
-static int mark_complete_oid(const char *UNUSED(refname),
+static int mark_complete_oid(const char *refname UNUSED,
                             const struct object_id *oid,
-                            int UNUSED(flag),
-                            void *UNUSED(cb_data))
+                            int flag UNUSED,
+                            void *cb_data UNUSED)
 {
        return mark_complete(oid);
 }
@@ -823,7 +823,7 @@ static int everything_local(struct fetch_pack_args *args,
        return retval;
 }
 
-static int sideband_demux(int UNUSED(in), int out, void *data)
+static int sideband_demux(int in UNUSED, int out, void *data)
 {
        int *xd = data;
        int ret;
index a9690126bb0e551723ece8e643cb813ff5f69c9b..5ea7be974930e4b0273ae90de7b949ad38c72d59 100644 (file)
@@ -190,9 +190,9 @@ struct strbuf;
 #define _SGI_SOURCE 1
 
 #if defined(__GNUC__)
-#define UNUSED(var) UNUSED_##var __attribute__((unused))
+#define UNUSED __attribute__((unused))
 #else
-#define UNUSED(var) UNUSED_##var
+#define UNUSED
 #endif
 
 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
@@ -403,9 +403,9 @@ typedef uintmax_t timestamp_t;
 #endif
 
 #ifndef platform_core_config
-static inline int noop_core_config(const char *UNUSED(var),
-                                  const char *UNUSED(value),
-                                  void *UNUSED(cb))
+static inline int noop_core_config(const char *var UNUSED,
+                                  const char *value UNUSED,
+                                  void *cb UNUSED)
 {
        return 0;
 }
@@ -499,7 +499,7 @@ static inline void extract_id_from_env(const char *env, uid_t *id)
 }
 
 static inline int is_path_owned_by_current_uid(const char *path,
-                                              struct strbuf *UNUSED(report))
+                                              struct strbuf *report UNUSED)
 {
        struct stat st;
        uid_t euid;
index 721d69bf42a93cfd2e6197b14dc5c72462c9f65f..9aa714bdeea81e3c781cd8413b9299263030d85d 100644 (file)
@@ -699,7 +699,7 @@ void set_signing_key(const char *key)
        configured_signing_key = xstrdup(key);
 }
 
-int git_gpg_config(const char *var, const char *value, void *UNUSED(cb))
+int git_gpg_config(const char *var, const char *value, void *cb UNUSED)
 {
        struct gpg_format *fmt = NULL;
        char *fmtname = NULL;
index 763aa1d8a37192e33927b4f0073e2f62cd464ee6..cf5fea87eb02bf753d408f1eeb00f5de2a02e907 100644 (file)
--- a/hashmap.c
+++ b/hashmap.c
@@ -142,10 +142,10 @@ static inline struct hashmap_entry **find_entry_ptr(const struct hashmap *map,
        return e;
 }
 
-static int always_equal(const void *UNUSED(cmp_data),
-                       const struct hashmap_entry *UNUSED(entry1),
-                       const struct hashmap_entry *UNUSED(entry2),
-                       const void *UNUSED(keydata))
+static int always_equal(const void *cmp_data UNUSED,
+                       const struct hashmap_entry *entry1 UNUSED,
+                       const struct hashmap_entry *entry2 UNUSED,
+                       const void *keydata UNUSED)
 {
        return 0;
 }
@@ -313,7 +313,7 @@ struct pool_entry {
        unsigned char data[FLEX_ARRAY];
 };
 
-static int pool_entry_cmp(const void *UNUSED(cmp_data),
+static int pool_entry_cmp(const void *cmp_data UNUSED,
                          const struct hashmap_entry *eptr,
                          const struct hashmap_entry *entry_or_key,
                          const void *keydata)
diff --git a/help.c b/help.c
index c5b5848188f5aaf3d46ec109ceec66765869b99a..ec670d5f68bd6aa701209dd587b28711ef7b0d8f 100644 (file)
--- a/help.c
+++ b/help.c
@@ -782,8 +782,8 @@ struct similar_ref_cb {
 };
 
 static int append_similar_ref(const char *refname,
-                             const struct object_id *UNUSED(oid),
-                             int UNUSED(flags), void *cb_data)
+                             const struct object_id *oid UNUSED,
+                             int flags UNUSED, void *cb_data)
 {
        struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
        char *branch = strrchr(refname, '/') + 1;
index 20db0ea620890dd715832cbc4189c23163a1ae60..6eb3b2fe51c6fe839f2dec5dd584cf174d5b5f73 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 UNUSED(flag), void *cb_data)
+                        int flag UNUSED, void *cb_data)
 {
        const char *name_nons = strip_namespace(name);
        struct strbuf *buf = cb_data;
diff --git a/ident.c b/ident.c
index 48745a1f0e9041e0e1c01ae78739c881576b4d3a..6de76f9421d57f38c478cca68fcb97c4ede2d36c 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -668,7 +668,7 @@ static int set_ident(const char *var, const char *value)
        return 0;
 }
 
-int git_ident_config(const char *var, const char *value, void *UNUSED(data))
+int git_ident_config(const char *var, const char *value, void *data UNUSED)
 {
        if (!strcmp(var, "user.useconfigonly")) {
                ident_use_config_only = git_config_bool(var, value);
index 9f3ae1f8fe1d8cd044f644bfc6d35d46806dda49..8955d7e1f6eec73ef797781c2bd0d76d43d1ef19 100644 (file)
@@ -250,7 +250,7 @@ static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail;
 static const char *default_ll_merge;
 
 static int read_merge_config(const char *var, const char *value,
-                            void *UNUSED(cb))
+                            void *cb UNUSED)
 {
        struct ll_merge_driver *fn;
        const char *key, *name;
index 114bd80365e31b4852effe494e7100c2d2713af8..ccdbf08feba7ed6d9621f25b069d09ca56a4014a 100644 (file)
@@ -135,7 +135,7 @@ static int ref_filter_match(const char *refname,
 }
 
 static int add_ref_decoration(const char *refname, const struct object_id *oid,
-                             int UNUSED(flags),
+                             int flags UNUSED,
                              void *cb_data)
 {
        struct object *obj;
index e54b883e8790b7d999d138651fa261818dcaa0e5..fa0d01b47c1286767068df928e83dd74c5f7b49e 100644 (file)
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -137,7 +137,7 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
 }
 
 static int ls_refs_config(const char *var, const char *value,
-                         void *UNUSED(data))
+                         void *data UNUSED)
 {
        /*
         * We only serve fetches over v2 for now, so respect only "uploadpack"
index 08c1c36d3344e28d00f67665ab8b4d220d7cc62a..4ddd3adea003e32fb7f16fbfa56a886a5d4a0712 100644 (file)
@@ -45,7 +45,7 @@ struct path_hashmap_entry {
        char path[FLEX_ARRAY];
 };
 
-static int path_hashmap_cmp(const void *UNUSED(cmp_data),
+static int path_hashmap_cmp(const void *cmp_data UNUSED,
                            const struct hashmap_entry *eptr,
                            const struct hashmap_entry *entry_or_key,
                            const void *keydata)
@@ -89,10 +89,10 @@ static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap,
        return hashmap_get_entry(hashmap, &key, ent, NULL);
 }
 
-static int dir_rename_cmp(const void *UNUSED(cmp_data),
+static int dir_rename_cmp(const void *cmp_data UNUSED,
                          const struct hashmap_entry *eptr,
                          const struct hashmap_entry *entry_or_key,
-                         const void *UNUSED(keydata))
+                         const void *keydata UNUSED)
 {
        const struct dir_rename_entry *e1, *e2;
 
@@ -134,10 +134,10 @@ static struct collision_entry *collision_find_entry(struct hashmap *hashmap,
        return hashmap_get_entry(hashmap, &key, ent, NULL);
 }
 
-static int collision_cmp(const void *UNUSED(cmp_data),
+static int collision_cmp(const void *cmp_data UNUSED,
                         const struct hashmap_entry *eptr,
                         const struct hashmap_entry *entry_or_key,
-                        const void *UNUSED(keydata))
+                        const void *keydata UNUSED)
 {
        const struct collision_entry *e1, *e2;
 
@@ -456,7 +456,7 @@ static void unpack_trees_finish(struct merge_options *opt)
        clear_unpack_trees_porcelain(&opt->priv->unpack_opts);
 }
 
-static int save_files_dirs(const struct object_id *UNUSED(oid),
+static int save_files_dirs(const struct object_id *oid UNUSED,
                           struct strbuf *base, const char *path,
                           unsigned int mode, void *context)
 {
index d0da6db56466ff0d3178d2fad1d548fd6202b0cb..cd009c7c8ae455324bc9e48aa0f1f4df24211b66 100644 (file)
@@ -18,7 +18,7 @@ struct dir_entry {
        char name[FLEX_ARRAY];
 };
 
-static int dir_entry_cmp(const void *UNUSED(cmp_data),
+static int dir_entry_cmp(const void *cmp_data UNUSED,
                         const struct hashmap_entry *eptr,
                         const struct hashmap_entry *entry_or_key,
                         const void *keydata)
@@ -120,7 +120,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
                add_dir_entry(istate, ce);
 }
 
-static int cache_entry_cmp(const void *UNUSED(cmp_data),
+static int cache_entry_cmp(const void *cmp_data UNUSED,
                           const struct hashmap_entry *eptr,
                           const struct hashmap_entry *entry_or_key,
                           const void *remove)
index 10f0a46e6240938fa95e03af9c6fbebf6f7e4a5b..b7e79feaf042290c041fbcec439fc2aa8e84a3df 100644 (file)
@@ -36,8 +36,8 @@ static void rev_list_push(struct negotiation_state *ns,
 }
 
 static int clear_marks(const char *refname, const struct object_id *oid,
-                      int UNUSED(flag),
-                      void *UNUSED(cb_data))
+                      int flag UNUSED,
+                      void *cb_data UNUSED)
 {
        struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
 
index f2aa58af9239a3ae3da22bc2b13cb92b6b831bf2..c4398f5ae15d320b5f7167105a08d94fe6bbf4fa 100644 (file)
@@ -72,8 +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 UNUSED(flag),
-                      void *UNUSED(cb_data))
+                      int flag UNUSED,
+                      void *cb_data UNUSED)
 {
        struct object *o = deref_tag(the_repository, parse_object(the_repository, oid), refname, 0);
 
diff --git a/notes.c b/notes.c
index 3be98e7085143987924976400b7387d5ea8b9f5f..94074afe17ae1f9a7fae8f34494b91bd61b2059f 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -925,8 +925,8 @@ out:
 }
 
 static int string_list_add_one_ref(const char *refname,
-                                  const struct object_id *UNUSED(oid),
-                                  int UNUSED(flag), void *cb)
+                                  const struct object_id *oid UNUSED,
+                                  int flag UNUSED, void *cb)
 {
        struct string_list *refs = cb;
        if (!unsorted_string_list_has_string(refs, refname))
index 3f7fce8322438b2a6be26c47af38418592e3654d..2dd1a0f56e1e442dec47dfbbcdd46d58aecc812c 100644 (file)
@@ -1306,7 +1306,7 @@ struct handle_one_ref_cb {
 };
 
 static int handle_one_ref(const char *path, const struct object_id *oid,
-                         int UNUSED(flag),
+                         int flag UNUSED,
                          void *cb_data)
 {
        struct handle_one_ref_cb *cb = cb_data;
@@ -1385,11 +1385,11 @@ struct grab_nth_branch_switch_cbdata {
        struct strbuf *sb;
 };
 
-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),
+static int grab_nth_branch_switch(struct object_id *ooid UNUSED,
+                                 struct object_id *noid UNUSED,
+                                 const char *email UNUSED,
+                                 timestamp_t timestamp UNUSED,
+                                 int tz UNUSED,
                                  const char *message, void *cb_data)
 {
        struct grab_nth_branch_switch_cbdata *cb = cb_data;
index cf5494af807e287119cf1d6ea95e9ad6a7f8eb61..1be57abaf10d7aa527df7f22ebaf660f6430d4d8 100644 (file)
@@ -141,7 +141,7 @@ struct packed_git {
 
 struct multi_pack_index;
 
-static inline int pack_map_entry_cmp(const void *UNUSED(cmp_data),
+static inline int pack_map_entry_cmp(const void *cmp_data UNUSED,
                                     const struct hashmap_entry *entry,
                                     const struct hashmap_entry *entry2,
                                     const void *keydata)
index 32aeb0526fe5fd108063b6e5c1a667de9bcfc88b..49965fe856814393c9381788dced2b05d35aed1f 100644 (file)
--- a/oidmap.c
+++ b/oidmap.c
@@ -1,7 +1,7 @@
 #include "cache.h"
 #include "oidmap.h"
 
-static int oidmap_neq(const void *UNUSED(hashmap_cmp_fn_data),
+static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,
                      const struct hashmap_entry *e1,
                      const struct hashmap_entry *e2,
                      const void *keydata)
index d7cf8382deeb819c9f0c1c4c9ceb1355e5ba0780..bee8583119ebe2504a15df332c005a2ea51a20a2 100644 (file)
@@ -1392,7 +1392,7 @@ static int delta_base_cache_key_eq(const struct delta_base_cache_key *a,
        return a->p == b->p && a->base_offset == b->base_offset;
 }
 
-static int delta_base_cache_hash_cmp(const void *UNUSED(cmp_data),
+static int delta_base_cache_hash_cmp(const void *cmp_data UNUSED,
                                     const struct hashmap_entry *va,
                                     const struct hashmap_entry *vb,
                                     const void *vkey)
diff --git a/pager.c b/pager.c
index 19c016ff54976c5474bed1b3404dda039a6b360c..b66bbff2785cb6ed032edb4f0d9cd68f6a841c36 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -39,7 +39,7 @@ static void wait_for_pager_signal(int signo)
 }
 
 static int core_pager_config(const char *var, const char *value,
-                            void *UNUSED(data))
+                            void *data UNUSED)
 {
        if (!strcmp(var, "core.pager"))
                return git_config_string(&pager_program, var, value);
index cdfa5135490f804c910455df338b51b39269cabd..46c6a8f3eab519c88c0732677c9d09703f5882a3 100644 (file)
@@ -38,7 +38,7 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
 static int patch_id_neq(const void *cmpfn_data,
                        const struct hashmap_entry *eptr,
                        const struct hashmap_entry *entry_or_key,
-                       const void *UNUSED(keydata))
+                       const void *keydata UNUSED)
 {
        /* NEEDSWORK: const correctness? */
        struct diff_options *opt = (void *)cmpfn_data;
index 584026b746919805e21b69262942673e2036391f..f0277bd42b905d51ccfd2ff1188a32b78423acc9 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -44,7 +44,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
 }
 
 static int git_pretty_formats_config(const char *var, const char *value,
-                                    void *UNUSED(cb))
+                                    void *cb UNUSED)
 {
        struct cmt_fmt_map *commit_format = NULL;
        const char *name;
index 1528fdd0db83ef665424e210d32da7269561b921..462710ffe40d22c87e35168ccbea112cb369e852 100644 (file)
@@ -224,7 +224,7 @@ cleanup:
        return ret;
 }
 
-static int patch_util_cmp(const void *UNUSED(cmp_data),
+static int patch_util_cmp(const void *cmp_data UNUSED,
                          const struct patch_util *a,
                          const struct patch_util *b,
                          const char *keydata)
index baf252b77d6e76d0a9f56db51d4def1153be01f8..fd1cb14b0f131de522cd60c71127c9369fe84648 100644 (file)
@@ -89,7 +89,7 @@ struct ref_to_worktree_entry {
        struct worktree *wt; /* key is wt->head_ref */
 };
 
-static int ref_to_worktree_map_cmpfnc(const void *UNUSED(lookupdata),
+static int ref_to_worktree_map_cmpfnc(const void *lookupdata UNUSED,
                                      const struct hashmap_entry *eptr,
                                      const struct hashmap_entry *kptr,
                                      const void *keydata_aka_refname)
index 56ea3ba76240266cc2a2a15f6b5928c73d5b293e..d258fd31995fbb4f8a198ba0bd275564182fe43c 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -240,9 +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 *UNUSED(email),
-                            timestamp_t timestamp, int UNUSED(tz),
-                            const char *UNUSED(message), void *cb_data)
+                            const char *email UNUSED,
+                            timestamp_t timestamp, int tz UNUSED,
+                            const char *message UNUSED, void *cb_data)
 {
        struct expire_reflog_policy_cb *cb = cb_data;
        struct commit *old_commit, *new_commit;
@@ -295,7 +295,7 @@ int should_expire_reflog_ent_verbose(struct object_id *ooid,
        return expire;
 }
 
-static int push_tip_to_list(const char *UNUSED(refname),
+static int push_tip_to_list(const char *refname UNUSED,
                            const struct object_id *oid,
                            int flags, void *cb_data)
 {
@@ -380,11 +380,11 @@ void reflog_expiry_cleanup(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)
+int count_reflog_ent(struct object_id *ooid UNUSED,
+                    struct object_id *noid UNUSED,
+                    const char *email UNUSED,
+                    timestamp_t timestamp, int tz UNUSED,
+                    const char *message UNUSED, 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 5012bba35785e689e9dd3433801afc32cb328adc..b1b3077ecc5bcd801aa865dd07d075629106c36f 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -359,7 +359,7 @@ struct warn_if_dangling_data {
 };
 
 static int warn_if_dangling_symref(const char *refname,
-                                  const struct object_id *UNUSED(oid),
+                                  const struct object_id *oid UNUSED,
                                   int flags, void *cb_data)
 {
        struct warn_if_dangling_data *d = cb_data;
@@ -894,7 +894,7 @@ 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 *UNUSED(email),
+                          const char *email UNUSED,
                           timestamp_t timestamp, int tz,
                           const char *message, void *cb_data)
 {
@@ -936,9 +936,9 @@ 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 *UNUSED(ooid),
+static int read_ref_at_ent_newest(struct object_id *ooid UNUSED,
                                  struct object_id *noid,
-                                 const char *UNUSED(email),
+                                 const char *email UNUSED,
                                  timestamp_t timestamp, int tz,
                                  const char *message, void *cb_data)
 {
@@ -951,7 +951,7 @@ 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 *UNUSED(email),
+                                 const char *email UNUSED,
                                  timestamp_t timestamp, int tz,
                                  const char *message, void *cb_data)
 {
@@ -1815,7 +1815,7 @@ struct ref_store_hash_entry
        char name[FLEX_ARRAY];
 };
 
-static int ref_store_hash_cmp(const void *UNUSED(cmp_data),
+static int ref_store_hash_cmp(const void *cmp_data UNUSED,
                              const struct hashmap_entry *eptr,
                              const struct hashmap_entry *entry_or_key,
                              const void *keydata)
index 13bfdb7701d4b816df0287556c9de36c19801b9b..e4009b3c421f5bddf9b3480a9fc881cee0d2307b 100644 (file)
@@ -2202,8 +2202,8 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
        return ok;
 }
 
-static int files_reflog_iterator_peel(struct ref_iterator *UNUSED(ref_iterator),
-                                     struct object_id *UNUSED(peeled))
+static int files_reflog_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
+                                     struct object_id *peeled UNUSED)
 {
        BUG("ref_iterator_peel() called for reflog_iterator");
 }
@@ -2257,7 +2257,7 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
 static enum iterator_selection reflog_iterator_select(
        struct ref_iterator *iter_worktree,
        struct ref_iterator *iter_common,
-       void *UNUSED(cb_data))
+       void *cb_data UNUSED)
 {
        if (iter_worktree) {
                /*
@@ -2985,7 +2985,7 @@ cleanup:
 
 static int files_transaction_abort(struct ref_store *ref_store,
                                   struct ref_transaction *transaction,
-                                  struct strbuf *UNUSED(err))
+                                  struct strbuf *err UNUSED)
 {
        struct files_ref_store *refs =
                files_downcast(ref_store, 0, "ref_transaction_abort");
@@ -2995,8 +2995,8 @@ static int files_transaction_abort(struct ref_store *ref_store,
 }
 
 static int ref_present(const char *refname,
-                      const struct object_id *UNUSED(oid),
-                      int UNUSED(flags),
+                      const struct object_id *oid UNUSED,
+                      int flags UNUSED,
                       void *cb_data)
 {
        struct string_list *affected_refnames = cb_data;
@@ -3261,7 +3261,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
        return -1;
 }
 
-static int files_init_db(struct ref_store *ref_store, struct strbuf *UNUSED(err))
+static int files_init_db(struct ref_store *ref_store, struct strbuf *err UNUSED)
 {
        struct files_ref_store *refs =
                files_downcast(ref_store, REF_STORE_WRITE, "init_db");
index e34921db7294ac17e99530ff20f1d88a2d7415f4..c9fd0bcaf90c753031a1624f593c607a4549bf5a 100644 (file)
@@ -51,8 +51,8 @@ static int empty_ref_iterator_advance(struct ref_iterator *ref_iterator)
        return ref_iterator_abort(ref_iterator);
 }
 
-static int empty_ref_iterator_peel(struct ref_iterator *UNUSED(ref_iterator),
-                                  struct object_id *UNUSED(peeled))
+static int empty_ref_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
+                                  struct object_id *peeled UNUSED)
 {
        BUG("peel called for empty iterator");
 }
@@ -238,7 +238,7 @@ struct ref_iterator *merge_ref_iterator_begin(
  */
 static enum iterator_selection overlay_iterator_select(
                struct ref_iterator *front, struct ref_iterator *back,
-               void *UNUSED(cb_data))
+               void *cb_data UNUSED)
 {
        int cmp;
 
index a45bb686f0bfb2c8ca0f324148819c1f96a654c9..43cdb97f8b37756ee2f62fcf2dc285ec3116f5b4 100644 (file)
@@ -726,7 +726,7 @@ static struct snapshot *get_snapshot(struct packed_ref_store *refs)
 }
 
 static int packed_read_raw_ref(struct ref_store *ref_store, const char *refname,
-                              struct object_id *oid, struct strbuf *UNUSED(referent),
+                              struct object_id *oid, struct strbuf *referent UNUSED,
                               unsigned int *type, int *failure_errno)
 {
        struct packed_ref_store *refs =
@@ -1078,8 +1078,8 @@ int packed_refs_is_locked(struct ref_store *ref_store)
 static const char PACKED_REFS_HEADER[] =
        "# pack-refs with: peeled fully-peeled sorted \n";
 
-static int packed_init_db(struct ref_store *UNUSED(ref_store),
-                         struct strbuf *UNUSED(err))
+static int packed_init_db(struct ref_store *ref_store UNUSED,
+                         struct strbuf *err UNUSED)
 {
        /* Nothing to do. */
        return 0;
@@ -1474,7 +1474,7 @@ failure:
 
 static int packed_transaction_abort(struct ref_store *ref_store,
                                    struct ref_transaction *transaction,
-                                   struct strbuf *UNUSED(err))
+                                   struct strbuf *err UNUSED)
 {
        struct packed_ref_store *refs = packed_downcast(
                        ref_store,
@@ -1513,7 +1513,7 @@ cleanup:
        return ret;
 }
 
-static int packed_initial_transaction_commit(struct ref_store *UNUSED(ref_store),
+static int packed_initial_transaction_commit(struct ref_store *ref_store UNUSED,
                                            struct ref_transaction *transaction,
                                            struct strbuf *err)
 {
@@ -1569,8 +1569,8 @@ static int packed_delete_refs(struct ref_store *ref_store, const char *msg,
        return ret;
 }
 
-static int packed_pack_refs(struct ref_store *UNUSED(ref_store),
-                           unsigned int UNUSED(flags))
+static int packed_pack_refs(struct ref_store *ref_store UNUSED,
+                           unsigned int flags UNUSED)
 {
        /*
         * Packed refs are already packed. It might be that loose refs
@@ -1580,7 +1580,7 @@ static int packed_pack_refs(struct ref_store *UNUSED(ref_store),
        return 0;
 }
 
-static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *UNUSED(ref_store))
+static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_store UNUSED)
 {
        return empty_ref_iterator_begin();
 }
index ef12aba91dc3955b2b99f5ad8d4692a839590a4b..60869beebe7364a594cd45938d4ed97dcdd28840 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -86,7 +86,7 @@ struct remotes_hash_key {
        int len;
 };
 
-static int remotes_hash_cmp(const void *UNUSED(cmp_data),
+static int remotes_hash_cmp(const void *cmp_data UNUSED,
                            const struct hashmap_entry *eptr,
                            const struct hashmap_entry *entry_or_key,
                            const void *keydata)
@@ -170,7 +170,7 @@ struct branches_hash_key {
        int len;
 };
 
-static int branches_hash_cmp(const void *UNUSED(cmp_data),
+static int branches_hash_cmp(const void *cmp_data UNUSED,
                             const struct hashmap_entry *eptr,
                             const struct hashmap_entry *entry_or_key,
                             const void *keydata)
@@ -2320,7 +2320,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
 }
 
 static int one_local_ref(const char *refname, const struct object_id *oid,
-                        int UNUSED(flag),
+                        int flag UNUSED,
                         void *cb_data)
 {
        struct ref ***local_tail = cb_data;
@@ -2577,22 +2577,22 @@ struct check_and_collect_until_cb_data {
 };
 
 /* Get the timestamp of the latest entry. */
-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)
+static int peek_reflog(struct object_id *o_oid UNUSED,
+                      struct object_id *n_oid UNUSED,
+                      const char *ident UNUSED,
+                      timestamp_t timestamp, int tz UNUSED,
+                      const char *message UNUSED, void *cb_data)
 {
        timestamp_t *ts = cb_data;
        *ts = timestamp;
        return 1;
 }
 
-static int check_and_collect_until(struct object_id *UNUSED(o_oid),
+static int check_and_collect_until(struct object_id *o_oid UNUSED,
                                   struct object_id *n_oid,
-                                  const char *UNUSED(ident),
-                                  timestamp_t timestamp, int UNUSED(tz),
-                                  const char *UNUSED(message), void *cb_data)
+                                  const char *ident UNUSED,
+                                  timestamp_t timestamp, int tz UNUSED,
+                                  const char *message UNUSED, void *cb_data)
 {
        struct commit *commit;
        struct check_and_collect_until_cb_data *cb = cb_data;
index 17810e5a3acc6fa6e15a2d10b5f00ff671a4790b..320be2522d80a87fdb1569a97c5e24b77fd4a525 100644 (file)
@@ -9,8 +9,8 @@
 static int register_replace_ref(struct repository *r,
                                const char *refname,
                                const struct object_id *oid,
-                               int UNUSED(flag),
-                               void *UNUSED(cb_data))
+                               int flag UNUSED,
+                               void *cb_data UNUSED)
 {
        /* Get sha1 from refname */
        const char *slash = strrchr(refname, '/');
index 5eb71e32d0d394db09aa6f6ebe41d75e1e4c1100..5451a698ec3aa11d332dca87e0101ebf33e1fcb9 100644 (file)
@@ -119,10 +119,10 @@ struct path_and_oids_entry {
        struct oidset trees;
 };
 
-static int path_and_oids_cmp(const void *UNUSED(hashmap_cmp_fn_data),
+static int path_and_oids_cmp(const void *hashmap_cmp_fn_data UNUSED,
                             const struct hashmap_entry *eptr,
                             const struct hashmap_entry *entry_or_key,
-                            const void *UNUSED(keydata))
+                            const void *keydata UNUSED)
 {
        const struct path_and_oids_entry *e1, *e2;
 
@@ -1543,7 +1543,7 @@ 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 UNUSED(flag),
+                         int flag UNUSED,
                          void *cb_data)
 {
        struct all_refs_cb *cb = cb_data;
@@ -1619,10 +1619,10 @@ 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 *UNUSED(email),
-                                timestamp_t UNUSED(timestamp),
-                                int UNUSED(tz),
-                                const char *UNUSED(message),
+                                const char *email UNUSED,
+                                timestamp_t timestamp UNUSED,
+                                int tz UNUSED,
+                                const char *message UNUSED,
                                 void *cb_data)
 {
        handle_one_reflog_commit(ooid, cb_data);
@@ -1631,8 +1631,8 @@ static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
 }
 
 static int handle_one_reflog(const char *refname_in_wt,
-                            const struct object_id *UNUSED(oid),
-                            int UNUSED(flag), void *cb_data)
+                            const struct object_id *oid UNUSED,
+                            int flag UNUSED, void *cb_data)
 {
        struct all_refs_cb *cb = cb_data;
        struct strbuf refname = STRBUF_INIT;
index 7e99c64e6b8f68567febfccfb9cf39119b193b72..f2e19838c9c342b3b9d6df5e9bf24d0add0d47d1 100644 (file)
@@ -266,7 +266,7 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
        return ret;
 }
 
-static int sideband_demux(int UNUSED(in), int out, void *data)
+static int sideband_demux(int in UNUSED, int out, void *data)
 {
        int *fd = data, ret;
        if (async_with_fork())
index e5b52651f88610a0ad5022a1cd2a13f701d0a42e..3ac82f9ebedc5731ce58aca5a8281da194378535 100644 (file)
@@ -5254,7 +5254,7 @@ struct labels_entry {
        char label[FLEX_ARRAY];
 };
 
-static int labels_cmp(const void *UNUSED(fndata),
+static int labels_cmp(const void *fndata UNUSED,
                      const struct hashmap_entry *eptr,
                      const struct hashmap_entry *entry_or_key, const void *key)
 {
@@ -6132,7 +6132,7 @@ struct subject2item_entry {
        char subject[FLEX_ARRAY];
 };
 
-static int subject2item_cmp(const void *UNUSED(fndata),
+static int subject2item_cmp(const void *fndata UNUSED,
                            const struct hashmap_entry *eptr,
                            const struct hashmap_entry *entry_or_key,
                            const void *key)
index d99d9d5f619023eb78b59978bace2b837588cf24..0ec6c0c16546a7a2ebb45a8e8a03e3270cedf214 100644 (file)
@@ -147,7 +147,7 @@ out:
 }
 
 static int add_info_ref(const char *path, const struct object_id *oid,
-                       int UNUSED(flag),
+                       int flag UNUSED,
                        void *cb_data)
 {
        struct update_info_ctx *uic = cb_data;
index 71ab04f935c23873e3598064e9b53795fbe6418e..17f9bcdb5f38270c4f5910a2e1c930432ba350e5 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -604,10 +604,10 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
        free(tmp);
 }
 
-static int mark_uninteresting(const char *UNUSED(refname),
+static int mark_uninteresting(const char *refname UNUSED,
                              const struct object_id *oid,
-                             int UNUSED(flags),
-                             void *UNUSED(cb_data))
+                             int flags UNUSED,
+                             void *cb_data UNUSED)
 {
        struct commit *commit = lookup_commit_reference_gently(the_repository,
                                                               oid, 1);
@@ -717,9 +717,9 @@ struct commit_array {
        int nr, alloc;
 };
 
-static int add_ref(const char *UNUSED(refname),
+static int add_ref(const char *refname UNUSED,
                   const struct object_id *oid,
-                  int UNUSED(flags),
+                  int flags UNUSED,
                   void *cb_data)
 {
        struct commit_array *ca = cb_data;
index dd9eb85527ab5a2f5007907b2cb3ce76ed5ccc3f..0890b1405c5cc6888396bac8558549ebdb2e2977 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -436,7 +436,7 @@ void strbuf_expand(struct strbuf *sb, const char *format, expand_fn_t fn,
 
 size_t strbuf_expand_literal_cb(struct strbuf *sb,
                                const char *placeholder,
-                               void *context)
+                               void *context UNUSED)
 {
        int ch;
 
index 4b34e2a748d339bdcde6fdefb99d2d4921b05e2d..7b2f8b2b9384b8c9c516be005c9b9f811348b0c7 100644 (file)
@@ -328,9 +328,9 @@ static int close_istream_pack_non_delta(struct git_istream *st)
 }
 
 static int open_istream_pack_non_delta(struct git_istream *st,
-                                      struct repository *UNUSED(r),
-                                      const struct object_id *UNUSED(oid),
-                                      enum object_type *UNUSED(type))
+                                      struct repository *r UNUSED,
+                                      const struct object_id *oid UNUSED,
+                                      enum object_type *type UNUSED)
 {
        struct pack_window *window;
        enum object_type in_pack_type;
index 4e79734e4f995b137ac702fa204a3a2daceb8f9b..c7b9c52174c54c5bc1986e927e0be67bf1983625 100644 (file)
--- a/strmap.c
+++ b/strmap.c
@@ -2,10 +2,10 @@
 #include "strmap.h"
 #include "mem-pool.h"
 
-int cmp_strmap_entry(const void *UNUSED(hashmap_cmp_fn_data),
+int cmp_strmap_entry(const void *hashmap_cmp_fn_data UNUSED,
                     const struct hashmap_entry *entry1,
                     const struct hashmap_entry *entry2,
-                    const void *UNUSED(keydata))
+                    const void *keydata UNUSED)
 {
        const struct strmap_entry *e1, *e2;
 
index bd6a372a670a4c56eaaa978111824685c9f53aae..6d4232294dbee7ad2928b0ac12e1860dcf04a12d 100644 (file)
@@ -5,10 +5,10 @@
 #include "sigchain.h"
 #include "pkt-line.h"
 
-int cmd2process_cmp(const void *UNUSED(cmp_data),
+int cmd2process_cmp(const void *cmp_data UNUSED,
                    const struct hashmap_entry *eptr,
                    const struct hashmap_entry *entry_or_key,
-                   const void *UNUSED(keydata))
+                   const void *keydata UNUSED)
 {
        const struct subprocess_entry *e1, *e2;
 
index d7a8ca0269a9f08b3edd55343052492b2fc40898..cd7ee236a120bc99d91ec615e94a6cd4240937f0 100644 (file)
@@ -38,10 +38,10 @@ enum lookup_type {
        lookup_path
 };
 
-static int config_path_cmp(const void *UNUSED(cmp_data),
+static int config_path_cmp(const void *cmp_data UNUSED,
                           const struct hashmap_entry *eptr,
                           const struct hashmap_entry *entry_or_key,
-                          const void *UNUSED(keydata))
+                          const void *keydata UNUSED)
 {
        const struct submodule_entry *a, *b;
 
@@ -52,10 +52,10 @@ static int config_path_cmp(const void *UNUSED(cmp_data),
               !oideq(&a->config->gitmodules_oid, &b->config->gitmodules_oid);
 }
 
-static int config_name_cmp(const void *UNUSED(cmp_data),
+static int config_name_cmp(const void *cmp_data UNUSED,
                           const struct hashmap_entry *eptr,
                           const struct hashmap_entry *entry_or_key,
-                          const void *UNUSED(keydata))
+                          const void *keydata UNUSED)
 {
        const struct submodule_entry *a, *b;
 
index 597a347f859be7632d2f3f5d176635014d75160a..7455b618ead82293d0cb7acddd829dabedac70f3 100644 (file)
@@ -214,7 +214,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
 
 /* Cheap function that only determines if we're interested in submodules at all */
 int git_default_submodule_config(const char *var, const char *value,
-                                void *UNUSED(cb))
+                                void *cb UNUSED)
 {
        if (!strcmp(var, "submodule.recurse")) {
                int v = git_config_bool(var, value) ?
@@ -941,9 +941,9 @@ static void free_submodules_data(struct string_list *submodules)
        string_list_clear(submodules, 1);
 }
 
-static int has_remote(const char *UNUSED(refname),
-                     const struct object_id *UNUSED(oid),
-                     int UNUSED(flags), void *UNUSED(cb_data))
+static int has_remote(const char *refname UNUSED,
+                     const struct object_id *oid UNUSED,
+                     int flags UNUSED, void *cb_data UNUSED)
 {
        return 1;
 }
@@ -1245,9 +1245,9 @@ int push_unpushed_submodules(struct repository *r,
        return ret;
 }
 
-static int append_oid_to_array(const char *UNUSED(ref),
+static int append_oid_to_array(const char *ref UNUSED,
                               const struct object_id *oid,
-                              int UNUSED(flags), void *data)
+                              int flags UNUSED, void *data)
 {
        struct oid_array *array = data;
        oid_array_append(array, oid);
index ddd538b838d7eba4d0aaf12815437d9ffe3919fa..4ba9eb65606d42f70f345a1b18bcd575db31e4cf 100644 (file)
@@ -37,7 +37,7 @@
  *
  */
 
-static int iterate_cb(const char *var, const char *value, void *UNUSED(data))
+static int iterate_cb(const char *var, const char *value, void *data UNUSED)
 {
        static int nr;
 
index 8f930ad358c335818f29899bf94f1ca66012d5e8..ae8a5648daf5c1385afe43f327bf9a5a3d98e1f1 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 *UNUSED(cb_data))
+                   int flags, void *cb_data UNUSED)
 {
        printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
        return 0;
@@ -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 *UNUSED(cb_data))
+                      int tz, const char *msg, void *cb_data UNUSED)
 {
        printf("%s %s %s %" PRItime " %+05d%s%s", oid_to_hex(old_oid),
               oid_to_hex(new_oid), committer, timestamp, tz,
index 64538a0c203dce44b8e58706f464becdff5f2ac7..a2b56b9cae5e3736220afcc30919d1c8bca0b69a 100644 (file)
@@ -12,7 +12,7 @@ static int driver_cb(struct userdiff_driver *driver,
        return 0;
 }
 
-static int cmd__userdiff_config(const char *var, const char *value, void *UNUSED(cb))
+static int cmd__userdiff_config(const char *var, const char *value, void *cb UNUSED)
 {
        if (userdiff_config(var, value) < 0)
                return -1;
index a1e80478ab04c167c7e9337756430e6d1b4cd88e..0fd5b142a377056d1e45f8dfd1ff6ae7a9c40097 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -479,7 +479,7 @@ static struct {
 };
 
 static int git_trailer_default_config(const char *conf_key, const char *value,
-                                     void *UNUSED(cb))
+                                     void *cb UNUSED)
 {
        const char *trailer_item, *variable_name;
 
@@ -511,7 +511,7 @@ static int git_trailer_default_config(const char *conf_key, const char *value,
 }
 
 static int git_trailer_config(const char *conf_key, const char *value,
-                             void *UNUSED(cb))
+                             void *cb UNUSED)
 {
        const char *trailer_item, *variable_name;
        struct arg_item *item;
index 551cad22dd36e56e5ea731c5dee9916df640fda4..999212df9768c2b5a7715ac431847dbd61d56740 100644 (file)
@@ -142,7 +142,7 @@ static void get_refs_from_bundle_inner(struct transport *transport)
 
 static struct ref *get_refs_from_bundle(struct transport *transport,
                                        int for_push,
-                                       struct transport_ls_refs_options *UNUSED(transport_options))
+                                       struct transport_ls_refs_options *transport_options UNUSED)
 {
        struct bundle_transport_data *data = transport->data;
        struct ref *result = NULL;
index b2cbca1e8bcaf7f024e0c5068ff66e3682cb0680..3bdbd142b73eb926c30c8caf21416511756bcb84 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 UNUSED(flag), void *UNUSED(cb_data))
+                    int flag UNUSED, void *cb_data UNUSED)
 {
        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 UNUSED(flag), void *cb_data)
+                   int flag UNUSED, void *cb_data)
 {
        static const char *capabilities = "multi_ack thin-pack side-band"
                " side-band-64k ofs-delta shallow deepen-since deepen-not"
@@ -1237,7 +1237,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
 }
 
 static int find_symref(const char *refname,
-                      const struct object_id *UNUSED(oid),
+                      const struct object_id *oid UNUSED,
                       int flag, void *cb_data)
 {
        const char *symref_target;
index f945d021f8c0cbb37fe480af1e4494e7322ccfe0..99d0e0eae047410660f0bf3b0d3f487d45c1134d 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -215,10 +215,10 @@ static int interpret_target(struct walker *walker, char *target, struct object_i
        return -1;
 }
 
-static int mark_complete(const char *UNUSED(path),
+static int mark_complete(const char *path UNUSED,
                         const struct object_id *oid,
-                        int UNUSED(flag),
-                        void *UNUSED(cb_data))
+                        int flag UNUSED,
+                        void *cb_data UNUSED)
 {
        struct commit *commit = lookup_commit_reference_gently(the_repository,
                                                               oid, 1);
index 38d0900aa9421913fa45bc924cc4deb8af5de78c..5813174896cc9ae5fa9287c8bcc432dc8cf2ef47 100644 (file)
@@ -947,11 +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 *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)
+static int stash_count_refs(struct object_id *ooid UNUSED,
+                           struct object_id *noid UNUSED,
+                           const char *email UNUSED,
+                           timestamp_t timestamp UNUSED, int tz UNUSED,
+                           const char *message UNUSED, void *cb_data)
 {
        int *c = cb_data;
        (*c)++;
@@ -1614,10 +1614,10 @@ struct grab_1st_switch_cbdata {
        struct object_id noid;
 };
 
-static int grab_1st_switch(struct object_id *UNUSED(ooid),
+static int grab_1st_switch(struct object_id *ooid UNUSED,
                           struct object_id *noid,
-                          const char *UNUSED(email),
-                          timestamp_t UNUSED(timestamp), int UNUSED(tz),
+                          const char *email UNUSED,
+                          timestamp_t timestamp UNUSED, int tz UNUSED,
                           const char *message, void *cb_data)
 {
        struct grab_1st_switch_cbdata *cb = cb_data;