apply: mark unused parameters in handlers

In parse_git_diff_header(), we have a table-driven parser that maps
strings to handler functions. Not all handlers need all of the
parameters; let's mark the unused ones to appease -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2022-10-17 21:08:48 -04:00 коммит произвёл Junio C Hamano
Родитель 7829746a6c
Коммит 0cff86990c
1 изменённых файлов: 8 добавлений и 8 удалений

16
apply.c
Просмотреть файл

@ -892,9 +892,9 @@ static int parse_traditional_patch(struct apply_state *state,
return 0; return 0;
} }
static int gitdiff_hdrend(struct gitdiff_data *state, static int gitdiff_hdrend(struct gitdiff_data *state UNUSED,
const char *line, const char *line UNUSED,
struct patch *patch) struct patch *patch UNUSED)
{ {
return 1; return 1;
} }
@ -1044,7 +1044,7 @@ static int gitdiff_renamedst(struct gitdiff_data *state,
return 0; return 0;
} }
static int gitdiff_similarity(struct gitdiff_data *state, static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
const char *line, const char *line,
struct patch *patch) struct patch *patch)
{ {
@ -1054,7 +1054,7 @@ static int gitdiff_similarity(struct gitdiff_data *state,
return 0; return 0;
} }
static int gitdiff_dissimilarity(struct gitdiff_data *state, static int gitdiff_dissimilarity(struct gitdiff_data *state UNUSED,
const char *line, const char *line,
struct patch *patch) struct patch *patch)
{ {
@ -1104,9 +1104,9 @@ static int gitdiff_index(struct gitdiff_data *state,
* This is normal for a diff that doesn't change anything: we'll fall through * This is normal for a diff that doesn't change anything: we'll fall through
* into the next diff. Tell the parser to break out. * into the next diff. Tell the parser to break out.
*/ */
static int gitdiff_unrecognized(struct gitdiff_data *state, static int gitdiff_unrecognized(struct gitdiff_data *state UNUSED,
const char *line, const char *line UNUSED,
struct patch *patch) struct patch *patch UNUSED)
{ {
return 1; return 1;
} }