git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 8/9] list-objects-filter: mark unused parameters in virtual functions
Date: Tue, 13 Dec 2022 06:14:23 -0500	[thread overview]
Message-ID: <Y5hej4EQU3l68rgT@coredump.intra.peff.net> (raw)
In-Reply-To: <Y5hdvpbLpXySHFRz@coredump.intra.peff.net>

The "struct filter" abstract type defines several virtual function
pointers. Not all of the concrete functions need every parameter, but
they have to conform to the generic interface. Mark unused ones to
silence -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
---
 list-objects-filter.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/list-objects-filter.c b/list-objects-filter.c
index b9543545ca..2bbac622be 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -70,13 +70,13 @@ struct filter {
 };
 
 static enum list_objects_filter_result filter_blobs_none(
-	struct repository *r,
+	struct repository *r UNUSED,
 	enum list_objects_filter_situation filter_situation,
 	struct object *obj,
-	const char *pathname,
-	const char *filename,
+	const char *pathname UNUSED,
+	const char *filename UNUSED,
 	struct oidset *omits,
-	void *filter_data_)
+	void *filter_data_ UNUSED)
 {
 	switch (filter_situation) {
 	default:
@@ -112,7 +112,7 @@ static enum list_objects_filter_result filter_blobs_none(
 }
 
 static void filter_blobs_none__init(
-	struct list_objects_filter_options *filter_options,
+	struct list_objects_filter_options *filter_options UNUSED,
 	struct filter *filter)
 {
 	filter->filter_object_fn = filter_blobs_none;
@@ -159,11 +159,11 @@ static int filter_trees_update_omits(
 }
 
 static enum list_objects_filter_result filter_trees_depth(
-	struct repository *r,
+	struct repository *r UNUSED,
 	enum list_objects_filter_situation filter_situation,
 	struct object *obj,
-	const char *pathname,
-	const char *filename,
+	const char *pathname UNUSED,
+	const char *filename UNUSED,
 	struct oidset *omits,
 	void *filter_data_)
 {
@@ -274,8 +274,8 @@ static enum list_objects_filter_result filter_blobs_limit(
 	struct repository *r,
 	enum list_objects_filter_situation filter_situation,
 	struct object *obj,
-	const char *pathname,
-	const char *filename,
+	const char *pathname UNUSED,
+	const char *filename UNUSED,
 	struct oidset *omits,
 	void *filter_data_)
 {
@@ -554,12 +554,12 @@ struct filter_object_type_data {
 };
 
 static enum list_objects_filter_result filter_object_type(
-	struct repository *r,
+	struct repository *r UNUSED,
 	enum list_objects_filter_situation filter_situation,
 	struct object *obj,
-	const char *pathname,
-	const char *filename,
-	struct oidset *omits,
+	const char *pathname UNUSED,
+	const char *filename UNUSED,
+	struct oidset *omits UNUSED,
 	void *filter_data_)
 {
 	struct filter_object_type_data *filter_data = filter_data_;
@@ -675,7 +675,7 @@ static enum list_objects_filter_result filter_combine(
 	struct object *obj,
 	const char *pathname,
 	const char *filename,
-	struct oidset *omits,
+	struct oidset *omits UNUSED,
 	void *filter_data)
 {
 	struct combine_filter_data *d = filter_data;
-- 
2.39.0.546.g5ea984bc66


  parent reply	other threads:[~2022-12-13 11:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 11:10 [PATCH 0/9] more -Wunused-parameter fixes/annotations Jeff King
2022-12-13 11:11 ` [PATCH 1/9] ls-refs: use repository parameter to iterate refs Jeff King
2022-12-13 11:11 ` [PATCH 2/9] blob: drop unused parts of parse_blob_buffer() Jeff King
2022-12-13 11:12 ` [PATCH 3/9] list-objects: drop process_gitlink() function Jeff King
2022-12-13 11:12 ` [PATCH 4/9] ws: drop unused parameter from ws_blank_line() Jeff King
2022-12-13 11:13 ` [PATCH 5/9] xdiff: drop unused parameter in def_ff() Jeff King
2022-12-13 11:13 ` [PATCH 6/9] xdiff: mark unused parameter in xdl_call_hunk_func() Jeff King
2022-12-13 11:13 ` [PATCH 7/9] diff: mark unused parameters in callbacks Jeff King
2022-12-13 11:14 ` Jeff King [this message]
2022-12-13 11:16 ` [PATCH 9/9] userdiff: mark unused parameter in internal callback Jeff King
2022-12-14  1:38 ` [PATCH 0/9] more -Wunused-parameter fixes/annotations Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5hej4EQU3l68rgT@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).