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>
Jeff King committed
Oct 17, 2022 at 21:08 UTC
0cff86990cbae9d5c8ca78cd09cb58f74828979b
1 file changed
+8
-8
apply.c
+8
-8
@@ -892,9 +892,9 @@ static int parse_traditional_patch(struct apply_state *state,
892
return 0;
893
}
894
895
-static int gitdiff_hdrend(struct gitdiff_data *state,
896
- const char *line,
897
- struct patch *patch)
895
+static int gitdiff_hdrend(struct gitdiff_data *state UNUSED,
896
+ const char *line UNUSED,
897
+ struct patch *patch UNUSED)
898
{
899
return 1;
900
}
@@ -1044,7 +1044,7 @@ static int gitdiff_renamedst(struct gitdiff_data *state,
1044
return 0;
1045
}
1046
1047
-static int gitdiff_similarity(struct gitdiff_data *state,
1047
+static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
1048
const char *line,
1049
struct patch *patch)
1050
{
@@ -1054,7 +1054,7 @@ static int gitdiff_similarity(struct gitdiff_data *state,
1054
return 0;
1055
}
1056
1057
-static int gitdiff_dissimilarity(struct gitdiff_data *state,
1057
+static int gitdiff_dissimilarity(struct gitdiff_data *state UNUSED,
1058
const char *line,
1059
struct patch *patch)
1060
{
@@ -1104,9 +1104,9 @@ static int gitdiff_index(struct gitdiff_data *state,
1104
* This is normal for a diff that doesn't change anything: we'll fall through
1105
* into the next diff. Tell the parser to break out.
1106
*/
1107
-static int gitdiff_unrecognized(struct gitdiff_data *state,
1108
- const char *line,
1109
- struct patch *patch)
1107
+static int gitdiff_unrecognized(struct gitdiff_data *state UNUSED,
1108
+ const char *line UNUSED,
1109
+ struct patch *patch UNUSED)
1110
{
1111
return 1;
1112
}