reftable/basics: introduce REFTABLE_UNUSED annotation

Introduce the `REFTABLE_UNUSED` annotation and replace all existing
users of `UNUSED` in the reftable library to use the new macro instead.

Note that we unconditionally define `MAYBE_UNUSED` in the exact same
way, so doing so unconditionally for `REFTABLE_UNUSED` should be fine,
too.

Suggested-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-02-18 10:20:50 +01:00
committed by Junio C Hamano
parent f8ed12dec4
commit f93b2a0424
5 changed files with 24 additions and 22 deletions

View File

@@ -25,17 +25,17 @@ int iterator_next(struct reftable_iterator *it, struct reftable_record *rec)
return it->ops->next(it->iter_arg, rec);
}
static int empty_iterator_seek(void *arg UNUSED, struct reftable_record *want UNUSED)
static int empty_iterator_seek(void *arg REFTABLE_UNUSED, struct reftable_record *want REFTABLE_UNUSED)
{
return 0;
}
static int empty_iterator_next(void *arg UNUSED, struct reftable_record *rec UNUSED)
static int empty_iterator_next(void *arg REFTABLE_UNUSED, struct reftable_record *rec REFTABLE_UNUSED)
{
return 1;
}
static void empty_iterator_close(void *arg UNUSED)
static void empty_iterator_close(void *arg REFTABLE_UNUSED)
{
}
@@ -143,8 +143,8 @@ static int indexed_table_ref_iter_next_block(struct indexed_table_ref_iter *it)
return 0;
}
static int indexed_table_ref_iter_seek(void *p UNUSED,
struct reftable_record *want UNUSED)
static int indexed_table_ref_iter_seek(void *p REFTABLE_UNUSED,
struct reftable_record *want REFTABLE_UNUSED)
{
return REFTABLE_API_ERROR;
}