Merge branch 'jk/unused-post-2.42-part2'
Unused parameters to functions are marked as such, and/or removed, in order to bring us closer to -Wunused-parameter clean. * jk/unused-post-2.42-part2: parse-options: mark unused parameters in noop callback interpret-trailers: mark unused "unset" parameters in option callbacks parse-options: add more BUG_ON() annotations merge: do not pass unused opt->value parameter parse-options: mark unused "opt" parameter in callbacks parse-options: prefer opt->value to globals in callbacks checkout-index: delay automatic setting of to_tempfile format-patch: use OPT_STRING_LIST for to/cc options merge: simplify parsing of "-n" option merge: make xopts a strvec
This commit is contained in:
@ -118,16 +118,19 @@ static struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP;
|
||||
static struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP;
|
||||
static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
|
||||
|
||||
static int clear_decorations_callback(const struct option *opt,
|
||||
const char *arg, int unset)
|
||||
static int clear_decorations_callback(const struct option *opt UNUSED,
|
||||
const char *arg, int unset)
|
||||
{
|
||||
BUG_ON_OPT_NEG(unset);
|
||||
BUG_ON_OPT_ARG(arg);
|
||||
string_list_clear(&decorate_refs_include, 0);
|
||||
string_list_clear(&decorate_refs_exclude, 0);
|
||||
use_default_decoration_filter = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decorate_callback(const struct option *opt, const char *arg, int unset)
|
||||
static int decorate_callback(const struct option *opt UNUSED, const char *arg,
|
||||
int unset)
|
||||
{
|
||||
if (unset)
|
||||
decoration_style = 0;
|
||||
@ -1564,7 +1567,8 @@ static int inline_callback(const struct option *opt, const char *arg, int unset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int header_callback(const struct option *opt, const char *arg, int unset)
|
||||
static int header_callback(const struct option *opt UNUSED, const char *arg,
|
||||
int unset)
|
||||
{
|
||||
if (unset) {
|
||||
string_list_clear(&extra_hdr, 0);
|
||||
@ -1576,24 +1580,6 @@ static int header_callback(const struct option *opt, const char *arg, int unset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int to_callback(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
if (unset)
|
||||
string_list_clear(&extra_to, 0);
|
||||
else
|
||||
string_list_append(&extra_to, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cc_callback(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
if (unset)
|
||||
string_list_clear(&extra_cc, 0);
|
||||
else
|
||||
string_list_append(&extra_cc, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int from_callback(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
char **from = opt->value;
|
||||
@ -1968,8 +1954,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
OPT_GROUP(N_("Messaging")),
|
||||
OPT_CALLBACK(0, "add-header", NULL, N_("header"),
|
||||
N_("add email header"), header_callback),
|
||||
OPT_CALLBACK(0, "to", NULL, N_("email"), N_("add To: header"), to_callback),
|
||||
OPT_CALLBACK(0, "cc", NULL, N_("email"), N_("add Cc: header"), cc_callback),
|
||||
OPT_STRING_LIST(0, "to", &extra_to, N_("email"), N_("add To: header")),
|
||||
OPT_STRING_LIST(0, "cc", &extra_cc, N_("email"), N_("add Cc: header")),
|
||||
OPT_CALLBACK_F(0, "from", &from, N_("ident"),
|
||||
N_("set From address to <ident> (or committer ident if absent)"),
|
||||
PARSE_OPT_OPTARG, from_callback),
|
||||
|
Reference in New Issue
Block a user