config: mark unused callback parameters
The callback passed to git_config() must conform to a particular interface. But most callbacks don't actually look at the extra "void *data" parameter. Let's mark the unused parameters to make -Wunused-parameter happy. Note there's one unusual case here in get_remote_default() where we actually ignore the "value" parameter. That's because it's only checking whether the option is found at all, and not parsing its value. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9f5a9de7c8
commit
783a86c142
|
@ -366,7 +366,8 @@ static struct archiver *find_tar_filter(const char *name, size_t len)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static int tar_filter_config(const char *var, const char *value, void *data)
|
||||
static int tar_filter_config(const char *var, const char *value,
|
||||
void *UNUSED(data))
|
||||
{
|
||||
struct archiver *ar;
|
||||
const char *name;
|
||||
|
|
|
@ -612,7 +612,8 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
|
|||
*dos_time = tm.tm_sec / 2 + tm.tm_min * 32 + tm.tm_hour * 2048;
|
||||
}
|
||||
|
||||
static int archive_zip_config(const char *var, const char *value, void *data)
|
||||
static int archive_zip_config(const char *var, const char *value,
|
||||
void *UNUSED(data))
|
||||
{
|
||||
return userdiff_config(var, value);
|
||||
}
|
||||
|
|
|
@ -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 *cb)
|
||||
static int git_am_config(const char *k, const char *v, void *UNUSED(cb))
|
||||
{
|
||||
int status;
|
||||
|
||||
|
|
|
@ -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 *cb)
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, "commitgraph.maxnewfilters"))
|
||||
write_opts.max_new_filters = git_config_int(var, value);
|
||||
|
|
|
@ -207,7 +207,8 @@ static void show_config_scope(struct strbuf *buf)
|
|||
strbuf_addch(buf, term);
|
||||
}
|
||||
|
||||
static int show_all_config(const char *key_, const char *value_, void *cb)
|
||||
static int show_all_config(const char *key_, const char *value_,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (show_origin || show_scope) {
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
|
@ -458,7 +459,8 @@ static const char *get_color_slot;
|
|||
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 *cb)
|
||||
static int git_get_color_config(const char *var, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, get_color_slot)) {
|
||||
if (!value)
|
||||
|
@ -490,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 *cb)
|
||||
void *UNUSED(data))
|
||||
{
|
||||
if (!strcmp(var, get_colorbool_slot))
|
||||
get_colorbool_found = git_config_colorbool(var, value);
|
||||
|
|
|
@ -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 *cb)
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, "pack.writebitmaphashcache")) {
|
||||
if (git_config_bool(var, value))
|
||||
|
|
|
@ -1486,7 +1486,7 @@ static int prune(int argc, const char **argv)
|
|||
return result;
|
||||
}
|
||||
|
||||
static int get_remote_default(const char *key, const char *value, void *priv)
|
||||
static int get_remote_default(const char *key, const char *UNUSED(value), void *priv)
|
||||
{
|
||||
if (strcmp(key, "remotes.default") == 0) {
|
||||
int *found = priv;
|
||||
|
|
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 *cb)
|
||||
int git_color_config(const char *var, const char *value, void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, "color.ui")) {
|
||||
git_use_color_default = git_config_colorbool(var, value);
|
||||
|
|
3
config.c
3
config.c
|
@ -362,7 +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 *value, void *data)
|
||||
static int forbid_remote_url(const char *var, const char *UNUSED(value),
|
||||
void *UNUSED(data))
|
||||
{
|
||||
const char *remote_name;
|
||||
size_t remote_name_len;
|
||||
|
|
|
@ -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 *cb)
|
||||
static int read_convert_config(const char *var, const char *value, void *UNUSED(cb))
|
||||
{
|
||||
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 *cb)
|
||||
static int island_config_callback(const char *k, const char *v, void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(k, "pack.island")) {
|
||||
struct strbuf re = STRBUF_INIT;
|
||||
|
|
3
diff.c
3
diff.c
|
@ -264,7 +264,8 @@ void init_diff_ui_defaults(void)
|
|||
diff_detect_rename_default = DIFF_DETECT_RENAME;
|
||||
}
|
||||
|
||||
int git_diff_heuristic_config(const char *var, const char *value, void *cb)
|
||||
int git_diff_heuristic_config(const char *var, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, "diff.indentheuristic"))
|
||||
diff_indent_heuristic = git_config_bool(var, value);
|
||||
|
|
|
@ -403,7 +403,9 @@ typedef uintmax_t timestamp_t;
|
|||
#endif
|
||||
|
||||
#ifndef platform_core_config
|
||||
static inline int noop_core_config(const char *var, const char *value, void *cb)
|
||||
static inline int noop_core_config(const char *UNUSED(var),
|
||||
const char *UNUSED(value),
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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 *cb)
|
||||
int git_gpg_config(const char *var, const char *value, void *UNUSED(cb))
|
||||
{
|
||||
struct gpg_format *fmt = NULL;
|
||||
char *fmtname = NULL;
|
||||
|
|
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 *data)
|
||||
int git_ident_config(const char *var, const char *value, void *UNUSED(data))
|
||||
{
|
||||
if (!strcmp(var, "user.useconfigonly")) {
|
||||
ident_use_config_only = git_config_bool(var, value);
|
||||
|
|
|
@ -249,7 +249,8 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
|
|||
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 *cb)
|
||||
static int read_merge_config(const char *var, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
struct ll_merge_driver *fn;
|
||||
const char *key, *name;
|
||||
|
|
|
@ -136,7 +136,8 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
|
|||
strbuf_release(&namespaced);
|
||||
}
|
||||
|
||||
static int ls_refs_config(const char *var, const char *value, void *data)
|
||||
static int ls_refs_config(const char *var, const char *value,
|
||||
void *UNUSED(data))
|
||||
{
|
||||
/*
|
||||
* We only serve fetches over v2 for now, so respect only "uploadpack"
|
||||
|
|
3
pager.c
3
pager.c
|
@ -38,7 +38,8 @@ static void wait_for_pager_signal(int signo)
|
|||
raise(signo);
|
||||
}
|
||||
|
||||
static int core_pager_config(const char *var, const char *value, void *data)
|
||||
static int core_pager_config(const char *var, const char *value,
|
||||
void *UNUSED(data))
|
||||
{
|
||||
if (!strcmp(var, "core.pager"))
|
||||
return git_config_string(&pager_program, var, value);
|
||||
|
|
3
pretty.c
3
pretty.c
|
@ -43,7 +43,8 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
|
|||
rev->commit_format = CMIT_FMT_USERFORMAT;
|
||||
}
|
||||
|
||||
static int git_pretty_formats_config(const char *var, const char *value, void *cb)
|
||||
static int git_pretty_formats_config(const char *var, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
struct cmt_fmt_map *commit_format = NULL;
|
||||
const char *name;
|
||||
|
|
|
@ -213,7 +213,8 @@ 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 *cb)
|
||||
int git_default_submodule_config(const char *var, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
if (!strcmp(var, "submodule.recurse")) {
|
||||
int v = git_config_bool(var, value) ?
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
static int iterate_cb(const char *var, const char *value, void *data)
|
||||
static int iterate_cb(const char *var, const char *value, void *UNUSED(data))
|
||||
{
|
||||
static int nr;
|
||||
|
||||
|
|
|
@ -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 *cb)
|
||||
static int cmd__userdiff_config(const char *var, const char *value, void *UNUSED(cb))
|
||||
{
|
||||
if (userdiff_config(var, value) < 0)
|
||||
return -1;
|
||||
|
|
|
@ -478,7 +478,8 @@ static struct {
|
|||
{ "ifmissing", TRAILER_IF_MISSING }
|
||||
};
|
||||
|
||||
static int git_trailer_default_config(const char *conf_key, const char *value, void *cb)
|
||||
static int git_trailer_default_config(const char *conf_key, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
const char *trailer_item, *variable_name;
|
||||
|
||||
|
@ -509,7 +510,8 @@ static int git_trailer_default_config(const char *conf_key, const char *value, v
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int git_trailer_config(const char *conf_key, const char *value, void *cb)
|
||||
static int git_trailer_config(const char *conf_key, const char *value,
|
||||
void *UNUSED(cb))
|
||||
{
|
||||
const char *trailer_item, *variable_name;
|
||||
struct arg_item *item;
|
||||
|
|
Loading…
Reference in New Issue