mirror of https://github.com/git/git.git
git-compat-util.h: use "UNUSED", not "UNUSED(var)"
As reported in [1] the "UNUSED(var)" macro introduced in2174b8c75d
(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 of9b24034754
(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>
This commit is contained in:
parent
776515ef8b
commit
5cf88fd8b0
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
4
attr.c
4
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;
|
||||
|
||||
|
|
6
bisect.c
6
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);
|
||||
|
|
4
bloom.c
4
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
2
color.c
2
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
6
commit.c
6
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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
8
config.c
8
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
4
diff.c
4
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;
|
||||
|
|
4
dir.c
4
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);
|
||||
|
|
|
@ -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();
|
||||
|
|
12
fetch-pack.c
12
fetch-pack.c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
10
hashmap.c
10
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)
|
||||
|
|
4
help.c
4
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
2
ident.c
2
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||