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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Feb 24, 2023 at 01:39 UTC 1758712248ab134a99cf73dcb62c115d955697d8
3 files changed +6 -4
commit.c
+4 -2
@@ -801,7 +801,8 @@ int compare_commits_by_author_date(const void *a_, const void *b_,
801 return 0;
802 }
803
804 -int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void *unused)
804 +int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_,
805 + void *unused UNUSED)
806 {
807 const struct commit *a = a_, *b = b_;
808 const timestamp_t generation_a = commit_graph_generation(a),
@@ -821,7 +822,8 @@ int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void
822 return 0;
823 }
824
824 -int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
825 +int compare_commits_by_commit_date(const void *a_, const void *b_,
826 + void *unused UNUSED)
827 {
828 const struct commit *a = a_, *b = b_;
829 /* newer commits with larger date first */
negotiator/skipping.c
+1 -1
@@ -50,7 +50,7 @@ struct data {
50 int non_common_revs;
51 };
52
53 -static int compare(const void *a_, const void *b_, void *unused)
53 +static int compare(const void *a_, const void *b_, void *data UNUSED)
54 {
55 const struct entry *a = a_;
56 const struct entry *b = b_;
t/helper/test-prio-queue.c
+1 -1
@@ -2,7 +2,7 @@
2 #include "cache.h"
3 #include "prio-queue.h"
4
5 -static int intcmp(const void *va, const void *vb, void *data)
5 +static int intcmp(const void *va, const void *vb, void *data UNUSED)
6 {
7 const int *a = va, *b = vb;
8 return *a - *b;