Skip to content

Commit 0cff869

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7829746 commit 0cff869

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apply.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,9 @@ static int parse_traditional_patch(struct apply_state *state,
892892
return 0;
893893
}
894894

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)
898898
{
899899
return 1;
900900
}
@@ -1044,7 +1044,7 @@ static int gitdiff_renamedst(struct gitdiff_data *state,
10441044
return 0;
10451045
}
10461046

1047-
static int gitdiff_similarity(struct gitdiff_data *state,
1047+
static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
10481048
const char *line,
10491049
struct patch *patch)
10501050
{
@@ -1054,7 +1054,7 @@ static int gitdiff_similarity(struct gitdiff_data *state,
10541054
return 0;
10551055
}
10561056

1057-
static int gitdiff_dissimilarity(struct gitdiff_data *state,
1057+
static int gitdiff_dissimilarity(struct gitdiff_data *state UNUSED,
10581058
const char *line,
10591059
struct patch *patch)
10601060
{
@@ -1104,9 +1104,9 @@ static int gitdiff_index(struct gitdiff_data *state,
11041104
* This is normal for a diff that doesn't change anything: we'll fall through
11051105
* into the next diff. Tell the parser to break out.
11061106
*/
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)
11101110
{
11111111
return 1;
11121112
}

0 commit comments

Comments
 (0)