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

[PATCH 6/9] xdiff: mark unused parameter in xdl_call_hunk_func()

From
Jeff King <peff@peff.net>
Date
Dec 13, 2022, 11:13 UTC
Message-ID
<Y5heVMGLAQpWq39E@coredump.intra.peff.net>
In-Reply-To
<Y5hdvpbLpXySHFRz@coredump.intra.peff.net>

This function is used interchangeably with xdl_emit via a function pointer, so we can't just drop the unused parameter. Mark it to silence -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
---
 xdiff/xdiffi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 32652ded2d..344c2dfc3e 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -973,7 +973,7 @@ void xdl_free_script(xdchange_t *xscr) {
 	}
 }
 
-static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
+static int xdl_call_hunk_func(xdfenv_t *xe UNUSED, xdchange_t *xscr, xdemitcb_t *ecb,
 			      xdemitconf_t const *xecfg)
 {
 	xdchange_t *xch, *xche;
-- 
2.39.0.546.g5ea984bc66
Previous: Jeff KingNext: Jeff King
Message 7 of 11 in “more -Wunused-parameter fixes/annotations”
  1. 0/9 more -Wunused-parameter fixes/annotationsJeff King, Dec 13, 2022
  2. 1/9 ls-refs: use repository parameter to iterate refsJeff King, Dec 13, 2022
  3. 2/9 blob: drop unused parts of parse_blob_buffer()Jeff King, Dec 13, 2022
  4. 3/9 list-objects: drop process_gitlink() functionJeff King, Dec 13, 2022
  5. 4/9 ws: drop unused parameter from ws_blank_line()Jeff King, Dec 13, 2022
  6. 5/9 xdiff: drop unused parameter in def_ff()Jeff King, Dec 13, 2022
  7. 6/9 xdiff: mark unused parameter in xdl_call_hunk_func()Jeff King, Dec 13, 2022
  8. 7/9 diff: mark unused parameters in callbacksJeff King, Dec 13, 2022
  9. 8/9 list-objects-filter: mark unused parameters in virtual functionsJeff King, Dec 13, 2022
  10. 9/9 userdiff: mark unused parameter in internal callbackJeff King, Dec 13, 2022
  11. Junio C HamanoDec 14, 2022

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.