From 1758712248ab134a99cf73dcb62c115d955697d8 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 24 Feb 2023 01:39:27 -0500 Subject: prio-queue: mark unused parameters in comparison functions The prio_queue_compare_fn interface has a void pointer to allow callers to pass arbitrary data, but most comparison functions don't need it. Mark those cases to make -Wunused-parameter happy. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/helper/test-prio-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c index 133b5e6f4a..496c7be07d 100644 --- a/t/helper/test-prio-queue.c +++ b/t/helper/test-prio-queue.c @@ -2,7 +2,7 @@ #include "cache.h" #include "prio-queue.h" -static int intcmp(const void *va, const void *vb, void *data) +static int intcmp(const void *va, const void *vb, void *data UNUSED) { const int *a = va, *b = vb; return *a - *b; -- cgit v1.2.3 From a5c76b3698f3672afecd65eed233b095123ae1d6 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 24 Feb 2023 01:39:46 -0500 Subject: run_processes_parallel: mark unused callback parameters Our parallel process API takes several callbacks via function pointers in the run_process_paralell_opts struct. Not every callback needs every parameter; let's mark the unused ones to make -Wunused-parameter happy. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/helper/test-run-command.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index 3ecb830f4a..98fa224640 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -24,7 +24,7 @@ static int number_callbacks; static int parallel_next(struct child_process *cp, struct strbuf *err, void *cb, - void **task_cb) + void **task_cb UNUSED) { struct child_process *d = cb; if (number_callbacks >= 4) @@ -40,10 +40,10 @@ static int parallel_next(struct child_process *cp, return 1; } -static int no_job(struct child_process *cp, +static int no_job(struct child_process *cp UNUSED, struct strbuf *err, - void *cb, - void **task_cb) + void *cb UNUSED, + void **task_cb UNUSED) { if (err) strbuf_addstr(err, "no further jobs available\n"); @@ -52,10 +52,10 @@ static int no_job(struct child_process *cp, return 0; } -static int task_finished(int result, +static int task_finished(int result UNUSED, struct strbuf *err, - void *pp_cb, - void *pp_task_cb) + void *pp_cb UNUSED, + void *pp_task_cb UNUSED) { if (err) strbuf_addstr(err, "asking for a quick stop\n"); -- cgit v1.2.3