Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-09-29 19:04:14 +0300
committerJunio C Hamano <gitster@pobox.com>2023-09-29 19:04:14 +0300
commit2affeb3cb57ec7124dc37743ace17a46921f8ce0 (patch)
tree30e8e3023a645e404860c058784321ffc696d26a /compat
parent2b04c3ce59ee9605c4a193c00c9cc92b384cd1cd (diff)
parent72da9832c21c96b2109408d9de7b6ce45fff8847 (diff)
Merge branch 'jk/fsmonitor-unused-parameter'
Unused parameters in fsmonitor related code paths have been marked as such. * jk/fsmonitor-unused-parameter: run-command: mark unused parameters in start_bg_wait callbacks fsmonitor: mark unused hashmap callback parameters fsmonitor/darwin: mark unused parameters in system callback fsmonitor: mark unused parameters in stub functions fsmonitor/win32: mark unused parameter in fsm_os__incompatible() fsmonitor: mark some maybe-unused parameters fsmonitor/win32: drop unused parameters fsmonitor: prefer repo_git_path() to git_pathdup()
Diffstat (limited to 'compat')
-rw-r--r--compat/fsmonitor/fsm-health-darwin.c8
-rw-r--r--compat/fsmonitor/fsm-ipc-win32.c2
-rw-r--r--compat/fsmonitor/fsm-listen-darwin.c4
-rw-r--r--compat/fsmonitor/fsm-listen-win32.c24
-rw-r--r--compat/fsmonitor/fsm-path-utils-win32.c7
-rw-r--r--compat/fsmonitor/fsm-settings-win32.c2
6 files changed, 22 insertions, 25 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-ipc-win32.c b/compat/fsmonitor/fsm-ipc-win32.c
index 8928fa93ce..41984ea48e 100644
--- a/compat/fsmonitor/fsm-ipc-win32.c
+++ b/compat/fsmonitor/fsm-ipc-win32.c
@@ -6,6 +6,6 @@
const char *fsmonitor_ipc__get_path(struct repository *r) {
static char *ret;
if (!ret)
- ret = git_pathdup("fsmonitor--daemon.ipc");
+ ret = repo_git_path(r, "fsmonitor--daemon.ipc");
return ret;
}
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;
diff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c
index a361a7db20..90a2412284 100644
--- a/compat/fsmonitor/fsm-listen-win32.c
+++ b/compat/fsmonitor/fsm-listen-win32.c
@@ -289,8 +289,7 @@ void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
SetEvent(state->listen_data->hListener[LISTENER_SHUTDOWN]);
}
-static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
- const char *path)
+static struct one_watch *create_watch(const char *path)
{
struct one_watch *watch = NULL;
DWORD desired_access = FILE_LIST_DIRECTORY;
@@ -361,8 +360,7 @@ static void destroy_watch(struct one_watch *watch)
free(watch);
}
-static int start_rdcw_watch(struct fsm_listen_data *data,
- struct one_watch *watch)
+static int start_rdcw_watch(struct one_watch *watch)
{
DWORD dwNotifyFilter =
FILE_NOTIFY_CHANGE_FILE_NAME |
@@ -735,11 +733,11 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
state->listen_error_code = 0;
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
if (data->watch_gitdir &&
- start_rdcw_watch(data, data->watch_gitdir) == -1)
+ start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
for (;;) {
@@ -755,7 +753,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
if (result == -2) {
/* retryable error */
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
continue;
}
@@ -763,7 +761,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
/* have data */
if (process_worktree_events(state) == LISTENER_SHUTDOWN)
goto force_shutdown;
- if (start_rdcw_watch(data, data->watch_worktree) == -1)
+ if (start_rdcw_watch(data->watch_worktree) == -1)
goto force_error_stop;
continue;
}
@@ -776,7 +774,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
}
if (result == -2) {
/* retryable error */
- if (start_rdcw_watch(data, data->watch_gitdir) == -1)
+ if (start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
continue;
}
@@ -784,7 +782,7 @@ void fsm_listen__loop(struct fsmonitor_daemon_state *state)
/* have data */
if (process_gitdir_events(state) == LISTENER_SHUTDOWN)
goto force_shutdown;
- if (start_rdcw_watch(data, data->watch_gitdir) == -1)
+ if (start_rdcw_watch(data->watch_gitdir) == -1)
goto force_error_stop;
continue;
}
@@ -821,16 +819,14 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
data->hEventShutdown = CreateEvent(NULL, TRUE, FALSE, NULL);
- data->watch_worktree = create_watch(state,
- state->path_worktree_watch.buf);
+ data->watch_worktree = create_watch(state->path_worktree_watch.buf);
if (!data->watch_worktree)
goto failed;
check_for_shortnames(data->watch_worktree);
if (state->nr_paths_watching > 1) {
- data->watch_gitdir = create_watch(state,
- state->path_gitdir_watch.buf);
+ data->watch_gitdir = create_watch(state->path_gitdir_watch.buf);
if (!data->watch_gitdir)
goto failed;
}
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,7 +132,8 @@ 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;
}
@@ -140,8 +141,8 @@ int fsmonitor__get_alias(const char *path, struct alias_info *info)
/*
* 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/compat/fsmonitor/fsm-settings-win32.c b/compat/fsmonitor/fsm-settings-win32.c
index b6f6744494..0f2aa321f6 100644
--- a/compat/fsmonitor/fsm-settings-win32.c
+++ b/compat/fsmonitor/fsm-settings-win32.c
@@ -25,7 +25,7 @@ static enum fsmonitor_reason check_vfs4git(struct repository *r)
return FSMONITOR_REASON_OK;
}
-enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc)
+enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc UNUSED)
{
enum fsmonitor_reason reason;