diff options
author | Jeff King <peff@peff.net> | 2022-08-19 13:08:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-19 22:18:55 +0300 |
commit | 783a86c1427637d71fb2710291e677360ab5dc09 (patch) | |
tree | 6301e6737288ea790d91b41036d770f7648d4d56 /builtin/config.c | |
parent | 9f5a9de7c83cac4bd6397eafaa6e39dad7a77032 (diff) |
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>
Diffstat (limited to 'builtin/config.c')
-rw-r--r-- | builtin/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/config.c b/builtin/config.c index e7b88a9c08..bdc8b1d1a8 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -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); |