Skip to content

Commit d3beb61

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

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

list-objects-filter.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ struct filter {
7070
};
7171

7272
static enum list_objects_filter_result filter_blobs_none(
73-
struct repository *r,
73+
struct repository *r UNUSED,
7474
enum list_objects_filter_situation filter_situation,
7575
struct object *obj,
76-
const char *pathname,
77-
const char *filename,
76+
const char *pathname UNUSED,
77+
const char *filename UNUSED,
7878
struct oidset *omits,
79-
void *filter_data_)
79+
void *filter_data_ UNUSED)
8080
{
8181
switch (filter_situation) {
8282
default:
@@ -112,7 +112,7 @@ static enum list_objects_filter_result filter_blobs_none(
112112
}
113113

114114
static void filter_blobs_none__init(
115-
struct list_objects_filter_options *filter_options,
115+
struct list_objects_filter_options *filter_options UNUSED,
116116
struct filter *filter)
117117
{
118118
filter->filter_object_fn = filter_blobs_none;
@@ -159,11 +159,11 @@ static int filter_trees_update_omits(
159159
}
160160

161161
static enum list_objects_filter_result filter_trees_depth(
162-
struct repository *r,
162+
struct repository *r UNUSED,
163163
enum list_objects_filter_situation filter_situation,
164164
struct object *obj,
165-
const char *pathname,
166-
const char *filename,
165+
const char *pathname UNUSED,
166+
const char *filename UNUSED,
167167
struct oidset *omits,
168168
void *filter_data_)
169169
{
@@ -274,8 +274,8 @@ static enum list_objects_filter_result filter_blobs_limit(
274274
struct repository *r,
275275
enum list_objects_filter_situation filter_situation,
276276
struct object *obj,
277-
const char *pathname,
278-
const char *filename,
277+
const char *pathname UNUSED,
278+
const char *filename UNUSED,
279279
struct oidset *omits,
280280
void *filter_data_)
281281
{
@@ -554,12 +554,12 @@ struct filter_object_type_data {
554554
};
555555

556556
static enum list_objects_filter_result filter_object_type(
557-
struct repository *r,
557+
struct repository *r UNUSED,
558558
enum list_objects_filter_situation filter_situation,
559559
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,
563563
void *filter_data_)
564564
{
565565
struct filter_object_type_data *filter_data = filter_data_;
@@ -675,7 +675,7 @@ static enum list_objects_filter_result filter_combine(
675675
struct object *obj,
676676
const char *pathname,
677677
const char *filename,
678-
struct oidset *omits,
678+
struct oidset *omits UNUSED,
679679
void *filter_data)
680680
{
681681
struct combine_filter_data *d = filter_data;

0 commit comments

Comments
 (0)