list-objects-filter: mark unused parameters in virtual functions
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Dec 13, 2022 at 06:14 UTC
d3beb61f939ffcdbefc02d9ddf9d7a46102ec663
1 file changed
+15
-15
list-objects-filter.c
+15
-15
@@ -70,13 +70,13 @@ struct filter {
70
};
71
72
static enum list_objects_filter_result filter_blobs_none(
73
- struct repository *r,
73
+ struct repository *r UNUSED,
74
enum list_objects_filter_situation filter_situation,
75
struct object *obj,
76
- const char *pathname,
77
- const char *filename,
76
+ const char *pathname UNUSED,
77
+ const char *filename UNUSED,
78
struct oidset *omits,
79
- void *filter_data_)
79
+ void *filter_data_ UNUSED)
80
{
81
switch (filter_situation) {
82
default:
@@ -112,7 +112,7 @@ static enum list_objects_filter_result filter_blobs_none(
112
}
113
114
static void filter_blobs_none__init(
115
- struct list_objects_filter_options *filter_options,
115
+ struct list_objects_filter_options *filter_options UNUSED,
116
struct filter *filter)
117
{
118
filter->filter_object_fn = filter_blobs_none;
@@ -159,11 +159,11 @@ static int filter_trees_update_omits(
159
}
160
161
static enum list_objects_filter_result filter_trees_depth(
162
- struct repository *r,
162
+ struct repository *r UNUSED,
163
enum list_objects_filter_situation filter_situation,
164
struct object *obj,
165
- const char *pathname,
166
- const char *filename,
165
+ const char *pathname UNUSED,
166
+ const char *filename UNUSED,
167
struct oidset *omits,
168
void *filter_data_)
169
{
@@ -274,8 +274,8 @@ static enum list_objects_filter_result filter_blobs_limit(
274
struct repository *r,
275
enum list_objects_filter_situation filter_situation,
276
struct object *obj,
277
- const char *pathname,
278
- const char *filename,
277
+ const char *pathname UNUSED,
278
+ const char *filename UNUSED,
279
struct oidset *omits,
280
void *filter_data_)
281
{
@@ -554,12 +554,12 @@ struct filter_object_type_data {
554
};
555
556
static enum list_objects_filter_result filter_object_type(
557
- struct repository *r,
557
+ struct repository *r UNUSED,
558
enum list_objects_filter_situation filter_situation,
559
struct object *obj,
560
- const char *pathname,
561
- const char *filename,
562
- struct oidset *omits,
560
+ const char *pathname UNUSED,
561
+ const char *filename UNUSED,
562
+ struct oidset *omits UNUSED,
563
void *filter_data_)
564
{
565
struct filter_object_type_data *filter_data = filter_data_;
@@ -675,7 +675,7 @@ static enum list_objects_filter_result filter_combine(
675
struct object *obj,
676
const char *pathname,
677
const char *filename,
678
- struct oidset *omits,
678
+ struct oidset *omits UNUSED,
679
void *filter_data)
680
{
681
struct combine_filter_data *d = filter_data;