diff options
| author | Jeff King <peff@peff.net> | 2024-08-17 04:24:36 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-17 09:46:12 -0700 |
| commit | 4695c3f3a9a4d6d9785ae9c40ed105302ce08a1e (patch) | |
| tree | b3a64779c78db26e09de0abc4fbc95827114e21c /reftable/stack_test.c | |
| parent | 561666cc4cd84799334a68b16d0dd204f000efa8 (diff) | |
| download | git-4695c3f3a9a4d6d9785ae9c40ed105302ce08a1e.tar.xz | |
reftable: mark unused parameters in virtual functions
The reftable code uses a lot of virtual function pointers, but many of
the concrete implementations do not need all of the parameters.
For the most part these are obviously fine to just mark as UNUSED (e.g.,
the empty_iterator functions unsurprisingly do not do anything). Here
are a few cases where I dug a little deeper (but still ended up just
marking them UNUSED):
- the iterator exclude_patterns is best-effort and optional (though it
would be nice to support in the long run as an optimization)
- ignoring the ref_store in many transaction functions is unexpected,
but works because the ref_transaction itself carries enough
information to do what we need.
- ignoring "err" for in some cases (e.g., transaction abort) is OK
because we do not return any errors. It is a little odd for
reftable_be_create_reflog(), though, since we do return errors
there. We should perhaps be creating string error messages at this
layer, but I've punted on that for now.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/stack_test.c')
| -rw-r--r-- | reftable/stack_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/reftable/stack_test.c b/reftable/stack_test.c index f84b92f312..1a638cd2e0 100644 --- a/reftable/stack_test.c +++ b/reftable/stack_test.c @@ -399,7 +399,7 @@ static void test_reftable_stack_auto_compaction_fails_gracefully(void) clear_dir(dir); } -static int write_error(struct reftable_writer *wr, void *arg) +static int write_error(struct reftable_writer *wr UNUSED, void *arg) { return *((int *)arg); } @@ -816,7 +816,7 @@ static void test_reflog_expire(void) reftable_log_record_release(&log); } -static int write_nothing(struct reftable_writer *wr, void *arg) +static int write_nothing(struct reftable_writer *wr, void *arg UNUSED) { reftable_writer_set_limits(wr, 1, 1); return 0; |
