From 61bdc7c5d8b1dedc5f9c3af45c5738d14136ae90 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 13 Dec 2022 06:13:48 -0500 Subject: diff: mark unused parameters in callbacks The diff code provides a format_callback interface, but not every callback needs each parameter (e.g., the "opt" and "data" parameters are frequently left unused). Likewise for the output_prefix callback, the low-level change/add_remove interfaces, the callbacks used by xdi_diff(), etc. Mark unused arguments in the callback implementations to quiet -Wunused-parameter. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- revision.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'revision.c') diff --git a/revision.c b/revision.c index 439e34a7c5..ec441b80ef 100644 --- a/revision.c +++ b/revision.c @@ -600,10 +600,12 @@ static struct commit *one_relevant_parent(const struct rev_info *revs, static int tree_difference = REV_TREE_SAME; static void file_add_remove(struct diff_options *options, - int addremove, unsigned mode, - const struct object_id *oid, - int oid_valid, - const char *fullpath, unsigned dirty_submodule) + int addremove, + unsigned mode UNUSED, + const struct object_id *oid UNUSED, + int oid_valid UNUSED, + const char *fullpath UNUSED, + unsigned dirty_submodule UNUSED) { int diff = addremove == '+' ? REV_TREE_NEW : REV_TREE_OLD; struct rev_info *revs = options->change_fn_data; @@ -614,12 +616,15 @@ static void file_add_remove(struct diff_options *options, } static void file_change(struct diff_options *options, - unsigned old_mode, unsigned new_mode, - const struct object_id *old_oid, - const struct object_id *new_oid, - int old_oid_valid, int new_oid_valid, - const char *fullpath, - unsigned old_dirty_submodule, unsigned new_dirty_submodule) + unsigned old_mode UNUSED, + unsigned new_mode UNUSED, + const struct object_id *old_oid UNUSED, + const struct object_id *new_oid UNUSED, + int old_oid_valid UNUSED, + int new_oid_valid UNUSED, + const char *fullpath UNUSED, + unsigned old_dirty_submodule UNUSED, + unsigned new_dirty_submodule UNUSED) { tree_difference = REV_TREE_DIFFERENT; options->flags.has_changes = 1; -- cgit v1.2.1