aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-07-03 02:44:18 -0400
committerJunio C Hamano <gitster@pobox.com>2023-07-13 17:24:00 -0700
commit0b4e9013f1f23f0ee0758b2c6abfc446b1376bb0 (patch)
tree1dafc5dfad5e77fd71ebafcbf41d2508d1fc10d3 /builtin/fsck.c
parentcc88afad622b8166563cc6bd68de3155ec558ab0 (diff)
downloadgit-0b4e9013f1f23f0ee0758b2c6abfc446b1376bb0.tar.gz
fsck: mark unused parameters in various fsck callbacks
There are a few callback functions which are used with the fsck code, but it's natural that not all callbacks need all parameters. For reporting, even something as obvious as "the oid of the object which had a problem" is not always used, as some callers are only checking a single object in the first place. And for both reporting and walking, things like void data pointers and the fsck_options aren't always necessary. But since each such parameter is used by _some_ callback, we have to keep them in the interface. Mark the unused ones in specific callbacks to avoid triggering -Wunused-parameter. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 3aa9c812eb..2a494d6197 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -92,11 +92,11 @@ static int objerror(struct object *obj, const char *err)
return -1;
}
-static int fsck_error_func(struct fsck_options *o,
+static int fsck_error_func(struct fsck_options *o UNUSED,
const struct object_id *oid,
enum object_type object_type,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
switch (msg_type) {
@@ -121,7 +121,7 @@ static int fsck_error_func(struct fsck_options *o,
static struct object_array pending;
static int mark_object(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data, struct fsck_options *options UNUSED)
{
struct object *parent = data;
@@ -206,8 +206,8 @@ static int traverse_reachable(void)
return !!result;
}
-static int mark_used(struct object *obj, enum object_type object_type,
- void *data, struct fsck_options *options)
+static int mark_used(struct object *obj, int type UNUSED,
+ void *data UNUSED, struct fsck_options *options UNUSED)
{
if (!obj)
return 1;