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

[PATCH 6/8] fsmonitor/darwin: mark unused parameters in system callback

From
Jeff King <peff@peff.net>
Date
Sep 18, 2023, 22:32 UTC
Message-ID
<20230918223256.GF2659298@coredump.intra.peff.net>
In-Reply-To
<20230918222908.GA2659096@coredump.intra.peff.net>

We pass fsevent_callback() to the system FSEventStreamCreate() function as a callback. So we must match the expected function signature, even though we don't care about all of the parameters. Mark the unused ones to satisfy -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
---
 compat/fsmonitor/fsm-listen-darwin.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index 36c7e13281..11b56d3ef1 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -191,12 +191,12 @@ static void my_add_path(struct fsmonitor_batch *batch, const char *path)
 }
 
 
-static void fsevent_callback(ConstFSEventStreamRef streamRef,
+static void fsevent_callback(ConstFSEventStreamRef streamRef UNUSED,
 			     void *ctx,
 			     size_t num_of_events,
 			     void *event_paths,
 			     const FSEventStreamEventFlags event_flags[],
-			     const FSEventStreamEventId event_ids[])
+			     const FSEventStreamEventId event_ids[] UNUSED)
 {
 	struct fsmonitor_daemon_state *state = ctx;
 	struct fsm_listen_data *data = state->listen_data;
-- 
2.42.0.671.g43fbf3903a
Previous: Jeff KingNext: Jeff King
Message 7 of 11 in “fsmonitor unused parameter cleanups”
  1. 0/8 fsmonitor unused parameter cleanupsJeff King, Sep 18, 2023
  2. 1/8 fsmonitor: prefer repo_git_path() to git_pathdup()Jeff King, Sep 18, 2023
  3. 2/8 fsmonitor/win32: drop unused parametersJeff King, Sep 18, 2023
  4. 3/8 fsmonitor: mark some maybe-unused parametersJeff King, Sep 18, 2023
  5. 4/8 fsmonitor/win32: mark unused parameter in fsm_os__incompatible()Jeff King, Sep 18, 2023
  6. 5/8 fsmonitor: mark unused parameters in stub functionsJeff King, Sep 18, 2023
  7. 6/8 fsmonitor/darwin: mark unused parameters in system callbackJeff King, Sep 18, 2023
  8. 7/8 fsmonitor: mark unused hashmap callback parametersJeff King, Sep 18, 2023
  9. 8/8 run-command: mark unused parameters in start_bg_wait callbacksJeff King, Sep 18, 2023
  10. Jeff HostetlerSep 19, 2023
  11. Junio C HamanoSep 19, 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.