git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 06/14] count-objects: mark unused parameter in alternates callback

From
Jeff King <peff@peff.net>
Date
Jul 3, 2023, 06:44 UTC
Message-ID
<20230703064413.GF3537614@coredump.intra.peff.net>
In-Reply-To
<20230703064347.GA3524892@coredump.intra.peff.net>

Callbacks to for_each_altodb() get a void data pointer, but we don't need it here. Mark it as unused to silence -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/count-objects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index 97cdfb0ac5..2d4bb5e8d0 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -82,7 +82,7 @@ static int count_cruft(const char *basename UNUSED, const char *path,
 	return 0;
 }
 
-static int print_alternate(struct object_directory *odb, void *data)
+static int print_alternate(struct object_directory *odb, void *data UNUSED)
 {
 	printf("alternate: ");
 	quote_c_style(odb->path, NULL, stdout, 0);
-- 
2.41.0.586.g3c0cc15bc7
Previous: Jeff KingNext: Jeff King
Message 7 of 15 in “more -Wunused-parameter annotations”
  1. 0/14 more -Wunused-parameter annotationsJeff King, Jul 3, 2023
  2. 01/14 test-ref-store: drop unimplemented reflog-expire commandJeff King, Jul 3, 2023
  3. 02/14 do_for_each_ref_helper(): mark unused repository parameterJeff King, Jul 3, 2023
  4. 03/14 http: mark unused parameters in curl callbacksJeff King, Jul 3, 2023
  5. 04/14 http-push: mark unused parameter in xml callbackJeff King, Jul 3, 2023
  6. 05/14 am: mark unused keep_cr parametersJeff King, Jul 3, 2023
  7. 06/14 count-objects: mark unused parameter in alternates callbackJeff King, Jul 3, 2023
  8. 07/14 revisions: drop unused "opt" parameter in "tweak" callbacksJeff King, Jul 3, 2023
  9. 08/14 fsck: mark unused parameters in various fsck callbacksJeff King, Jul 3, 2023
  10. 09/14 merge-tree: mark unused parameter in traverse callbackJeff King, Jul 3, 2023
  11. 10/14 replace: mark unused parameter in ref callbackJeff King, Jul 3, 2023
  12. 11/14 replace: mark unused parameter in each_mergetag_fn callbackJeff King, Jul 3, 2023
  13. 12/14 rev-parse: mark unused parameter in for_each_abbrev callbackJeff King, Jul 3, 2023
  14. 13/14 tag: mark unused parameters in each_tag_name_fn callbacksJeff King, Jul 3, 2023
  15. 14/14 t/helper: mark unused callback void data parametersJeff King, Jul 3, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.