Skip to content

Commit a5c76b3

Browse files
peffgitster
authored andcommitted
run_processes_parallel: mark unused callback parameters
Our parallel process API takes several callbacks via function pointers in the run_process_paralell_opts struct. Not every callback needs every parameter; let's mark the unused ones to make -Wunused-parameter happy. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1bff855 commit a5c76b3

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

builtin/fetch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,8 @@ struct parallel_fetch_state {
18901890
int next, result;
18911891
};
18921892

1893-
static int fetch_next_remote(struct child_process *cp, struct strbuf *out,
1893+
static int fetch_next_remote(struct child_process *cp,
1894+
struct strbuf *out UNUSED,
18941895
void *cb, void **task_cb)
18951896
{
18961897
struct parallel_fetch_state *state = cb;
@@ -1912,7 +1913,8 @@ static int fetch_next_remote(struct child_process *cp, struct strbuf *out,
19121913
return 1;
19131914
}
19141915

1915-
static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)
1916+
static int fetch_failed_to_start(struct strbuf *out UNUSED,
1917+
void *cb, void *task_cb)
19161918
{
19171919
struct parallel_fetch_state *state = cb;
19181920
const char *remote = task_cb;

builtin/submodule--helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,9 +2132,9 @@ static int update_clone_get_next_task(struct child_process *child,
21322132
return 0;
21332133
}
21342134

2135-
static int update_clone_start_failure(struct strbuf *err,
2135+
static int update_clone_start_failure(struct strbuf *err UNUSED,
21362136
void *suc_cb,
2137-
void *idx_task_cb)
2137+
void *idx_task_cb UNUSED)
21382138
{
21392139
struct submodule_update_clone *suc = suc_cb;
21402140

hook.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ int hook_exists(const char *name)
4343
}
4444

4545
static int pick_next_hook(struct child_process *cp,
46-
struct strbuf *out,
46+
struct strbuf *out UNUSED,
4747
void *pp_cb,
48-
void **pp_task_cb)
48+
void **pp_task_cb UNUSED)
4949
{
5050
struct hook_cb_data *hook_cb = pp_cb;
5151
const char *hook_path = hook_cb->hook_path;
@@ -77,9 +77,9 @@ static int pick_next_hook(struct child_process *cp,
7777
return 1;
7878
}
7979

80-
static int notify_start_failure(struct strbuf *out,
80+
static int notify_start_failure(struct strbuf *out UNUSED,
8181
void *pp_cb,
82-
void *pp_task_cp)
82+
void *pp_task_cp UNUSED)
8383
{
8484
struct hook_cb_data *hook_cb = pp_cb;
8585

@@ -89,9 +89,9 @@ static int notify_start_failure(struct strbuf *out,
8989
}
9090

9191
static int notify_hook_finished(int result,
92-
struct strbuf *out,
92+
struct strbuf *out UNUSED,
9393
void *pp_cb,
94-
void *pp_task_cb)
94+
void *pp_task_cb UNUSED)
9595
{
9696
struct hook_cb_data *hook_cb = pp_cb;
9797
struct run_hooks_opt *opt = hook_cb->options;

submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
17391739
return 0;
17401740
}
17411741

1742-
static int fetch_start_failure(struct strbuf *err,
1742+
static int fetch_start_failure(struct strbuf *err UNUSED,
17431743
void *cb, void *task_cb)
17441744
{
17451745
struct submodule_parallel_fetch *spf = cb;
@@ -1760,7 +1760,7 @@ static int commit_missing_in_sub(const struct object_id *oid, void *data)
17601760
return type != OBJ_COMMIT;
17611761
}
17621762

1763-
static int fetch_finish(int retvalue, struct strbuf *err,
1763+
static int fetch_finish(int retvalue, struct strbuf *err UNUSED,
17641764
void *cb, void *task_cb)
17651765
{
17661766
struct submodule_parallel_fetch *spf = cb;

t/helper/test-run-command.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static int number_callbacks;
2424
static int parallel_next(struct child_process *cp,
2525
struct strbuf *err,
2626
void *cb,
27-
void **task_cb)
27+
void **task_cb UNUSED)
2828
{
2929
struct child_process *d = cb;
3030
if (number_callbacks >= 4)
@@ -40,10 +40,10 @@ static int parallel_next(struct child_process *cp,
4040
return 1;
4141
}
4242

43-
static int no_job(struct child_process *cp,
43+
static int no_job(struct child_process *cp UNUSED,
4444
struct strbuf *err,
45-
void *cb,
46-
void **task_cb)
45+
void *cb UNUSED,
46+
void **task_cb UNUSED)
4747
{
4848
if (err)
4949
strbuf_addstr(err, "no further jobs available\n");
@@ -52,10 +52,10 @@ static int no_job(struct child_process *cp,
5252
return 0;
5353
}
5454

55-
static int task_finished(int result,
55+
static int task_finished(int result UNUSED,
5656
struct strbuf *err,
57-
void *pp_cb,
58-
void *pp_task_cb)
57+
void *pp_cb UNUSED,
58+
void *pp_task_cb UNUSED)
5959
{
6060
if (err)
6161
strbuf_addstr(err, "asking for a quick stop\n");

0 commit comments

Comments
 (0)