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

[PATCH 10/14] replace: mark unused parameter in ref callback

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

We don't look at the "flags" parameter, which is natural for something that is just printing the contents of the replace refs. But let's mark it to appease -Wunused-parameter.

This probably should have been part of 63e14ee2d6 (refs: mark unused each_ref_fn parameters, 2022-08-19), but I missed it as this one is a repo_each_ref_fn, which takes an extra repository argument.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/replace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 9ceaa25233..17b75229d2 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -49,7 +49,7 @@ struct show_data {
 
 static int show_reference(struct repository *r, const char *refname,
 			  const struct object_id *oid,
-			  int flag, void *cb_data)
+			  int flag UNUSED, void *cb_data)
 {
 	struct show_data *data = cb_data;
 
-- 
2.41.0.586.g3c0cc15bc7
Previous: Jeff KingNext: Jeff King
Message 11 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.