]> git.ipfire.org Git - thirdparty/git.git/commitdiff
prio-queue: mark unused parameters in comparison functions
authorJeff King <peff@peff.net>
Fri, 24 Feb 2023 06:39:27 +0000 (01:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Feb 2023 17:13:31 +0000 (09:13 -0800)
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>
commit.c
negotiator/skipping.c
t/helper/test-prio-queue.c

index e433c33bb01fa6e3688a0b163c44d62f204d62d0..0606d16e3a2224bec9e4090913f557311da3e793 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -801,7 +801,8 @@ int compare_commits_by_author_date(const void *a_, const void *b_,
        return 0;
 }
 
-int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void *unused)
+int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_,
+                                           void *unused UNUSED)
 {
        const struct commit *a = a_, *b = b_;
        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
        return 0;
 }
 
-int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)
+int compare_commits_by_commit_date(const void *a_, const void *b_,
+                                  void *unused UNUSED)
 {
        const struct commit *a = a_, *b = b_;
        /* newer commits with larger date first */
index 0f5ac48e87608ee9fee69efb94b51d985b60c707..4867efc5f5940ee0ff49442e4e7a1e122fdb76b5 100644 (file)
@@ -50,7 +50,7 @@ struct data {
        int non_common_revs;
 };
 
-static int compare(const void *a_, const void *b_, void *unused)
+static int compare(const void *a_, const void *b_, void *data UNUSED)
 {
        const struct entry *a = a_;
        const struct entry *b = b_;
index 133b5e6f4ae5fdbd90f6594223df60f918a036f4..496c7be07d2200f248f6a2e41fcd0b58e832289e 100644 (file)
@@ -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;