Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-02-24 09:39:15 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-24 20:13:30 +0300
commitd3dcfa047f415de5590b60781dcdf11492e25d41 (patch)
treecad36e1c10c287576520b14dbfc4e168390d2419 /revision.c
parent5fe9e1ce2f7e0be5ea817f2e4ae2c7edecf771c0 (diff)
mark "pointless" data pointers in callbacks
Both the object_array_filter() and trie_find() functions use callback functions that let the caller specify which elements match. These callbacks take a void pointer in case the caller wants to pass in extra data. But in each case, the single user of these functions just passes NULL, and the callback ignores the extra pointer. We could just remove these unused parameters from the callback interface entirely. But it's good practice to provide such a pointer, as it guides future callers of the function in the right direction (rather than tempting them to access global data). Plus it's consistent with other generic callback interfaces. So let's instead annotate the unused parameters, in order to silence the compiler's -Wunused-parameter warning. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 21f5f572c2..4a24fc3fcd 100644
--- a/revision.c
+++ b/revision.c
@@ -4159,7 +4159,7 @@ static struct commit *get_revision_1(struct rev_info *revs)
* Return true for entries that have not yet been shown. (This is an
* object_array_each_func_t.)
*/
-static int entry_unshown(struct object_array_entry *entry, void *cb_data_unused)
+static int entry_unshown(struct object_array_entry *entry, void *cb_data UNUSED)
{
return !(entry->item->flags & SHOWN);
}