Skip to content

Commit 25ff15d

Browse files
committed
Merge branch 'jk/unused-post-2.42'
Unused parameters to functions are marked as such, and/or removed, in order to bring us closer to -Wunused-parameter clean. * jk/unused-post-2.42: (22 commits) update-ref: mark unused parameter in parser callbacks gc: mark unused descriptors in scheduler callbacks bundle-uri: mark unused parameters in callbacks fetch: mark unused parameter in ref_transaction callback credential: mark unused parameter in urlmatch callback grep: mark unused parmaeters in pcre fallbacks imap-send: mark unused parameters with NO_OPENSSL worktree: mark unused parameters in noop repair callback negotiator/noop: mark unused callback parameters add-interactive: mark unused callback parameters grep: mark unused parameter in output function test-trace2: mark unused argv/argc parameters trace2: mark unused config callback parameter trace2: mark unused us_elapsed_absolute parameters stash: mark unused parameter in diff callback ls-tree: mark unused parameter in callback commit-graph: mark unused data parameters in generation callbacks worktree: mark unused parameters in each_ref_fn callback pack-bitmap: mark unused parameters in show_object callback ref-filter: mark unused parameters in parser callbacks ...
2 parents 8af5aac + 44ad082 commit 25ff15d

21 files changed

+110
-84
lines changed

add-interactive.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,9 +1021,9 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,
10211021
return res;
10221022
}
10231023

1024-
static int run_help(struct add_i_state *s, const struct pathspec *unused_ps,
1025-
struct prefix_item_list *unused_files,
1026-
struct list_and_choose_options *unused_opts)
1024+
static int run_help(struct add_i_state *s, const struct pathspec *ps UNUSED,
1025+
struct prefix_item_list *files UNUSED,
1026+
struct list_and_choose_options *opts UNUSED)
10271027
{
10281028
color_fprintf_ln(stdout, s->help_color, "status - %s",
10291029
_("show paths with changes"));
@@ -1074,7 +1074,7 @@ struct print_command_item_data {
10741074
const char *color, *reset;
10751075
};
10761076

1077-
static void print_command_item(int i, int selected,
1077+
static void print_command_item(int i, int selected UNUSED,
10781078
struct string_list_item *item,
10791079
void *print_command_item_data)
10801080
{

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static void clear_item(struct refname_hash_entry *item)
308308

309309

310310
static void add_already_queued_tags(const char *refname,
311-
const struct object_id *old_oid,
311+
const struct object_id *old_oid UNUSED,
312312
const struct object_id *new_oid,
313313
void *cb_data)
314314
{

builtin/gc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@ static int launchctl_add_plists(void)
19341934
launchctl_schedule_plist(exec_path, SCHEDULE_WEEKLY);
19351935
}
19361936

1937-
static int launchctl_update_schedule(int run_maintenance, int fd)
1937+
static int launchctl_update_schedule(int run_maintenance, int fd UNUSED)
19381938
{
19391939
if (run_maintenance)
19401940
return launchctl_add_plists();
@@ -2115,7 +2115,7 @@ static int schtasks_schedule_tasks(void)
21152115
schtasks_schedule_task(exec_path, SCHEDULE_WEEKLY);
21162116
}
21172117

2118-
static int schtasks_update_schedule(int run_maintenance, int fd)
2118+
static int schtasks_update_schedule(int run_maintenance, int fd UNUSED)
21192119
{
21202120
if (run_maintenance)
21212121
return schtasks_schedule_tasks();
@@ -2556,7 +2556,7 @@ static int systemd_timer_setup_units(void)
25562556
return ret;
25572557
}
25582558

2559-
static int systemd_timer_update_schedule(int run_maintenance, int fd)
2559+
static int systemd_timer_update_schedule(int run_maintenance, int fd UNUSED)
25602560
{
25612561
if (run_maintenance)
25622562
return systemd_timer_setup_units();

builtin/ls-tree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
241241
return recurse;
242242
}
243243

244-
static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
244+
static int show_tree_name_only(const struct object_id *oid UNUSED,
245+
struct strbuf *base,
245246
const char *pathname, unsigned mode,
246247
void *context)
247248
{

builtin/stash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static int is_path_a_directory(const char *path)
362362
}
363363

364364
static void add_diff_to_buf(struct diff_queue_struct *q,
365-
struct diff_options *options,
365+
struct diff_options *options UNUSED,
366366
void *data)
367367
{
368368
int i;

builtin/update-ref.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ static void report_ok(const char *command)
311311
fflush(stdout);
312312
}
313313

314-
static void parse_cmd_option(struct ref_transaction *transaction,
315-
const char *next, const char *end)
314+
static void parse_cmd_option(struct ref_transaction *transaction UNUSED,
315+
const char *next, const char *end UNUSED)
316316
{
317317
const char *rest;
318318
if (skip_prefix(next, "no-deref", &rest) && *rest == line_termination)
@@ -321,16 +321,16 @@ static void parse_cmd_option(struct ref_transaction *transaction,
321321
die("option unknown: %s", next);
322322
}
323323

324-
static void parse_cmd_start(struct ref_transaction *transaction,
325-
const char *next, const char *end)
324+
static void parse_cmd_start(struct ref_transaction *transaction UNUSED,
325+
const char *next, const char *end UNUSED)
326326
{
327327
if (*next != line_termination)
328328
die("start: extra input: %s", next);
329329
report_ok("start");
330330
}
331331

332332
static void parse_cmd_prepare(struct ref_transaction *transaction,
333-
const char *next, const char *end)
333+
const char *next, const char *end UNUSED)
334334
{
335335
struct strbuf error = STRBUF_INIT;
336336
if (*next != line_termination)
@@ -341,7 +341,7 @@ static void parse_cmd_prepare(struct ref_transaction *transaction,
341341
}
342342

343343
static void parse_cmd_abort(struct ref_transaction *transaction,
344-
const char *next, const char *end)
344+
const char *next, const char *end UNUSED)
345345
{
346346
struct strbuf error = STRBUF_INIT;
347347
if (*next != line_termination)
@@ -352,7 +352,7 @@ static void parse_cmd_abort(struct ref_transaction *transaction,
352352
}
353353

354354
static void parse_cmd_commit(struct ref_transaction *transaction,
355-
const char *next, const char *end)
355+
const char *next, const char *end UNUSED)
356356
{
357357
struct strbuf error = STRBUF_INIT;
358358
if (*next != line_termination)

builtin/worktree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,10 @@ static void print_preparing_worktree_line(int detach,
628628
*
629629
* Returns 0 on failure and non-zero on success.
630630
*/
631-
static int first_valid_ref(const char *refname,
632-
const struct object_id *oid,
633-
int flags,
634-
void *cb_data)
631+
static int first_valid_ref(const char *refname UNUSED,
632+
const struct object_id *oid UNUSED,
633+
int flags UNUSED,
634+
void *cb_data UNUSED)
635635
{
636636
return 1;
637637
}

bundle-uri.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static struct {
2020
{ BUNDLE_HEURISTIC_CREATIONTOKEN, "creationToken" },
2121
};
2222

23-
static int compare_bundles(const void *hashmap_cmp_fn_data,
23+
static int compare_bundles(const void *hashmap_cmp_fn_data UNUSED,
2424
const struct hashmap_entry *he1,
2525
const struct hashmap_entry *he2,
2626
const void *id)
@@ -45,7 +45,7 @@ void init_bundle_list(struct bundle_list *list)
4545
}
4646

4747
static int clear_remote_bundle_info(struct remote_bundle_info *bundle,
48-
void *data)
48+
void *data UNUSED)
4949
{
5050
FREE_AND_NULL(bundle->id);
5151
FREE_AND_NULL(bundle->uri);
@@ -779,7 +779,7 @@ static int unbundle_all_bundles(struct repository *r,
779779
return 0;
780780
}
781781

782-
static int unlink_bundle(struct remote_bundle_info *info, void *data)
782+
static int unlink_bundle(struct remote_bundle_info *info, void *data UNUSED)
783783
{
784784
if (info->file)
785785
unlink_or_warn(info->file);

commit-graph.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,12 +1578,14 @@ static void compute_topological_levels(struct write_commit_graph_context *ctx)
15781578
stop_progress(&ctx->progress);
15791579
}
15801580

1581-
static timestamp_t get_generation_from_graph_data(struct commit *c, void *data)
1581+
static timestamp_t get_generation_from_graph_data(struct commit *c,
1582+
void *data UNUSED)
15821583
{
15831584
return commit_graph_data_at(c)->generation;
15841585
}
15851586

1586-
static void set_generation_v2(struct commit *c, timestamp_t t, void *data)
1587+
static void set_generation_v2(struct commit *c, timestamp_t t,
1588+
void *data UNUSED)
15871589
{
15881590
struct commit_graph_data *g = commit_graph_data_at(c);
15891591
g->generation = t;
@@ -1597,7 +1599,6 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
15971599
.commits = &ctx->commits,
15981600
.get_generation = get_generation_from_graph_data,
15991601
.set_generation = set_generation_v2,
1600-
.data = ctx,
16011602
};
16021603

16031604
if (ctx->report_progress)
@@ -1626,7 +1627,7 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
16261627
}
16271628

16281629
static void set_generation_in_graph_data(struct commit *c, timestamp_t t,
1629-
void *data)
1630+
void *data UNUSED)
16301631
{
16311632
commit_graph_data_at(c)->generation = t;
16321633
}

credential.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ static int proto_is_http(const char *s)
8888
static void credential_describe(struct credential *c, struct strbuf *out);
8989
static void credential_format(struct credential *c, struct strbuf *out);
9090

91-
static int select_all(const struct urlmatch_item *a,
92-
const struct urlmatch_item *b)
91+
static int select_all(const struct urlmatch_item *a UNUSED,
92+
const struct urlmatch_item *b UNUSED)
9393
{
9494
return 0;
9595
}

0 commit comments

Comments
 (0)