Skip to content

Commit 1758712

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent be252d3 commit 1758712

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

commit.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ int compare_commits_by_author_date(const void *a_, const void *b_,
801801
return 0;
802802
}
803803

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)
805806
{
806807
const struct commit *a = a_, *b = b_;
807808
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
821822
return 0;
822823
}
823824

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)
825827
{
826828
const struct commit *a = a_, *b = b_;
827829
/* newer commits with larger date first */

negotiator/skipping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct data {
5050
int non_common_revs;
5151
};
5252

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)
5454
{
5555
const struct entry *a = a_;
5656
const struct entry *b = b_;

t/helper/test-prio-queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "cache.h"
33
#include "prio-queue.h"
44

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)
66
{
77
const int *a = va, *b = vb;
88
return *a - *b;

0 commit comments

Comments
 (0)