From c1865be446f826bd9763956ea3c41b0d6fec1246 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:25:02 -1000 Subject: Mark the parameters callbacks leave unused With these and the two changes before them, cgit builds under git's DEVELOPER=1 settings, which also annotate their own callbacks this way. --- source/scan-tree.c | 2 +- source/shared.c | 2 +- source/ui-clone.c | 2 +- source/ui-shared.c | 2 +- source/ui-tree.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/scan-tree.c b/source/scan-tree.c index 7e7f28b..10f661d 100644 --- a/source/scan-tree.c +++ b/source/scan-tree.c @@ -79,7 +79,7 @@ static int trusted_key(const char *name, const char *value) } static int apply_gitconfig(const char *key, const char *value, - const __attribute__((unused)) struct config_context *cfg_ctx, void *cb) + const struct config_context *cfg_ctx UNUSED, void *cb UNUSED) { const char *name; diff --git a/source/shared.c b/source/shared.c index af848f6..9065693 100644 --- a/source/shared.c +++ b/source/shared.c @@ -370,7 +370,7 @@ int cgit_refs_cb(const struct reference *ref, void *cb_data) return 0; } -void cgit_diff_tree_cb(struct diff_queue_struct *q, struct diff_options *options, void *data) +void cgit_diff_tree_cb(struct diff_queue_struct *q, struct diff_options *options UNUSED, void *data) { filepair_fn fn = *(filepair_fn *)data; int i; diff --git a/source/ui-clone.c b/source/ui-clone.c index 832a056..fcab846 100644 --- a/source/ui-clone.c +++ b/source/ui-clone.c @@ -19,7 +19,7 @@ * second line, marked with ^{}, naming the object the tag peels to, the * format git update-server-info writes into info/refs. */ -static int print_ref(const struct reference *ref, void *cb_data) +static int print_ref(const struct reference *ref, void *cb_data UNUSED) { struct object *obj; diff --git a/source/ui-shared.c b/source/ui-shared.c index b88edec..b793f74 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1838,7 +1838,7 @@ static struct string_list tag_names = STRING_LIST_INIT_DUP; static struct string_list tag_stems = STRING_LIST_INIT_DUP; static int tags_collected; -static int collect_tag(const struct reference *ref, void *data) +static int collect_tag(const struct reference *ref, void *data UNUSED) { const char *name = ref->name; diff --git a/source/ui-tree.c b/source/ui-tree.c index 2bb2858..3e2fb5e 100644 --- a/source/ui-tree.c +++ b/source/ui-tree.c @@ -212,7 +212,7 @@ static bool print_object(const struct object_id *oid, const char *path, return true; } -static int only_child_cb(const struct object_id *oid, struct strbuf *base, +static int only_child_cb(const struct object_id *oid, struct strbuf *base UNUSED, const char *pathname, unsigned mode, void *data) { struct only_child *child = data; @@ -365,7 +365,7 @@ cleanup: strbuf_release(&class); } -static int ls_item(const struct object_id *oid, struct strbuf *base, +static int ls_item(const struct object_id *oid, struct strbuf *base UNUSED, const char *pathname, unsigned mode, void *data) { struct walk_tree_context *walk = data; -- cgit