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

[PATCH 5/8] fsmonitor: mark unused parameters in stub functions

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

The fsmonitor code has some platform-specific functions for which one or more platforms implement noop or stub functions. We can't get rid of these functions nor change their interface, since the point is to match their equivalents in other platforms. But let's annotate their parameters to quiet the compiler's -Wunused-parameter warning.

Signed-off-by: Jeff King <peff@peff.net>
---
 compat/fsmonitor/fsm-health-darwin.c    |  8 ++++----
 compat/fsmonitor/fsm-path-utils-win32.c |  7 ++++---
 fsmonitor-ipc.c                         | 10 +++++-----
 3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c
index 5b1709d63f..c2afcbe6c8 100644
--- a/compat/fsmonitor/fsm-health-darwin.c
+++ b/compat/fsmonitor/fsm-health-darwin.c
@@ -4,21 +4,21 @@
 #include "fsm-health.h"
 #include "fsmonitor--daemon.h"
 
-int fsm_health__ctor(struct fsmonitor_daemon_state *state)
+int fsm_health__ctor(struct fsmonitor_daemon_state *state UNUSED)
 {
 	return 0;
 }
 
-void fsm_health__dtor(struct fsmonitor_daemon_state *state)
+void fsm_health__dtor(struct fsmonitor_daemon_state *state UNUSED)
 {
 	return;
 }
 
-void fsm_health__loop(struct fsmonitor_daemon_state *state)
+void fsm_health__loop(struct fsmonitor_daemon_state *state UNUSED)
 {
 	return;
 }
 
-void fsm_health__stop_async(struct fsmonitor_daemon_state *state)
+void fsm_health__stop_async(struct fsmonitor_daemon_state *state UNUSED)
 {
 }
diff --git a/compat/fsmonitor/fsm-path-utils-win32.c b/compat/fsmonitor/fsm-path-utils-win32.c
index c8a3e9dcdb..f4f9cc1f33 100644
--- a/compat/fsmonitor/fsm-path-utils-win32.c
+++ b/compat/fsmonitor/fsm-path-utils-win32.c
@@ -132,16 +132,17 @@ int fsmonitor__is_fs_remote(const char *path)
 /*
  * No-op for now.
  */
-int fsmonitor__get_alias(const char *path, struct alias_info *info)
+int fsmonitor__get_alias(const char *path UNUSED,
+			 struct alias_info *info UNUSED)
 {
 	return 0;
 }
 
 /*
  * No-op for now.
  */
-char *fsmonitor__resolve_alias(const char *path,
-	const struct alias_info *info)
+char *fsmonitor__resolve_alias(const char *path UNUSED,
+			       const struct alias_info *info UNUSED)
 {
 	return NULL;
 }
diff --git a/fsmonitor-ipc.c b/fsmonitor-ipc.c
index 88575aa54c..153918cf76 100644
--- a/fsmonitor-ipc.c
+++ b/fsmonitor-ipc.c
@@ -20,7 +20,7 @@ int fsmonitor_ipc__is_supported(void)
 	return 0;
 }
 
-const char *fsmonitor_ipc__get_path(struct repository *r)
+const char *fsmonitor_ipc__get_path(struct repository *r UNUSED)
 {
 	return NULL;
 }
@@ -30,14 +30,14 @@ enum ipc_active_state fsmonitor_ipc__get_state(void)
 	return IPC_STATE__OTHER_ERROR;
 }
 
-int fsmonitor_ipc__send_query(const char *since_token,
-			      struct strbuf *answer)
+int fsmonitor_ipc__send_query(const char *since_token UNUSED,
+			      struct strbuf *answer UNUSED)
 {
 	return -1;
 }
 
-int fsmonitor_ipc__send_command(const char *command,
-				struct strbuf *answer)
+int fsmonitor_ipc__send_command(const char *command UNUSED,
+				struct strbuf *answer UNUSED)
 {
 	return -1;
 }
-- 
2.42.0.671.g43fbf3903a
Previous: Jeff KingNext: Jeff King
Message 6 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.