Skip to content

Commit d0732a8

Browse files
committed
Merge branch 'jk/unused-post-2.39-part2'
More work towards -Wunused. * jk/unused-post-2.39-part2: (21 commits) help: mark unused parameter in git_unknown_cmd_config() run_processes_parallel: mark unused callback parameters userformat_want_item(): mark unused parameter for_each_commit_graft(): mark unused callback parameter rewrite_parents(): mark unused callback parameter fetch-pack: mark unused parameter in callback function notes: mark unused callback parameters prio-queue: mark unused parameters in comparison functions for_each_object: mark unused callback parameters list-objects: mark unused callback parameters mark unused parameters in signal handlers run-command: mark error routine parameters as unused mark "pointless" data pointers in callbacks ref-filter: mark unused callback parameters http-backend: mark unused parameters in virtual functions http-backend: mark argc/argv unused object-name: mark unused parameters in disambiguate callbacks serve: mark unused parameters in virtual functions serve: use repository pointer to get config ls-refs: drop config caching ...
2 parents 88cc8ed + 506ebaa commit d0732a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+211
-176
lines changed

builtin/cat-file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,16 +563,16 @@ static int batch_object_cb(const struct object_id *oid, void *vdata)
563563
}
564564

565565
static int collect_loose_object(const struct object_id *oid,
566-
const char *path,
566+
const char *path UNUSED,
567567
void *data)
568568
{
569569
oid_array_append(data, oid);
570570
return 0;
571571
}
572572

573573
static int collect_packed_object(const struct object_id *oid,
574-
struct packed_git *pack,
575-
uint32_t pos,
574+
struct packed_git *pack UNUSED,
575+
uint32_t pos UNUSED,
576576
void *data)
577577
{
578578
oid_array_append(data, oid);
@@ -595,7 +595,7 @@ static int batch_unordered_object(const struct object_id *oid,
595595
}
596596

597597
static int batch_unordered_loose(const struct object_id *oid,
598-
const char *path,
598+
const char *path UNUSED,
599599
void *data)
600600
{
601601
return batch_unordered_object(oid, NULL, 0, data);

builtin/count-objects.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ static void loose_garbage(const char *path)
5757
report_garbage(PACKDIR_FILE_GARBAGE, path);
5858
}
5959

60-
static int count_loose(const struct object_id *oid, const char *path, void *data)
60+
static int count_loose(const struct object_id *oid, const char *path,
61+
void *data UNUSED)
6162
{
6263
struct stat st;
6364

@@ -72,7 +73,8 @@ static int count_loose(const struct object_id *oid, const char *path, void *data
7273
return 0;
7374
}
7475

75-
static int count_cruft(const char *basename, const char *path, void *data)
76+
static int count_cruft(const char *basename UNUSED, const char *path,
77+
void *data UNUSED)
7678
{
7779
loose_garbage(path);
7880
return 0;

builtin/fast-import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static void set_checkpoint_signal(void)
437437

438438
#else
439439

440-
static void checkpoint_signal(int signo)
440+
static void checkpoint_signal(int signo UNUSED)
441441
{
442442
checkpoint_requested = 1;
443443
}

builtin/fetch.c

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

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

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

builtin/fsck.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,17 @@ static void mark_unreachable_referents(const struct object_id *oid)
234234
}
235235

236236
static int mark_loose_unreachable_referents(const struct object_id *oid,
237-
const char *path,
238-
void *data)
237+
const char *path UNUSED,
238+
void *data UNUSED)
239239
{
240240
mark_unreachable_referents(oid);
241241
return 0;
242242
}
243243

244244
static int mark_packed_unreachable_referents(const struct object_id *oid,
245-
struct packed_git *pack,
246-
uint32_t pos,
247-
void *data)
245+
struct packed_git *pack UNUSED,
246+
uint32_t pos UNUSED,
247+
void *data UNUSED)
248248
{
249249
mark_unreachable_referents(oid);
250250
return 0;
@@ -662,14 +662,15 @@ static int fsck_loose(const struct object_id *oid, const char *path, void *data)
662662
return 0; /* keep checking other objects, even if we saw an error */
663663
}
664664

665-
static int fsck_cruft(const char *basename, const char *path, void *data)
665+
static int fsck_cruft(const char *basename, const char *path,
666+
void *data UNUSED)
666667
{
667668
if (!starts_with(basename, "tmp_obj_"))
668669
fprintf_ln(stderr, _("bad sha1 file: %s"), path);
669670
return 0;
670671
}
671672

672-
static int fsck_subdir(unsigned int nr, const char *path, void *data)
673+
static int fsck_subdir(unsigned int nr, const char *path UNUSED, void *data)
673674
{
674675
struct for_each_loose_cb *cb_data = data;
675676
struct progress *progress = cb_data->progress;
@@ -838,17 +839,17 @@ static void mark_object_for_connectivity(const struct object_id *oid)
838839
}
839840

840841
static int mark_loose_for_connectivity(const struct object_id *oid,
841-
const char *path,
842-
void *data)
842+
const char *path UNUSED,
843+
void *data UNUSED)
843844
{
844845
mark_object_for_connectivity(oid);
845846
return 0;
846847
}
847848

848849
static int mark_packed_for_connectivity(const struct object_id *oid,
849-
struct packed_git *pack,
850-
uint32_t pos,
851-
void *data)
850+
struct packed_git *pack UNUSED,
851+
uint32_t pos UNUSED,
852+
void *data UNUSED)
852853
{
853854
mark_object_for_connectivity(oid);
854855
return 0;

builtin/gc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,9 @@ struct write_loose_object_data {
977977

978978
static int loose_object_auto_limit = 100;
979979

980-
static int loose_object_count(const struct object_id *oid,
981-
const char *path,
982-
void *data)
980+
static int loose_object_count(const struct object_id *oid UNUSED,
981+
const char *path UNUSED,
982+
void *data)
983983
{
984984
int *count = (int*)data;
985985
if (++(*count) >= loose_object_auto_limit)
@@ -1004,15 +1004,15 @@ static int loose_object_auto_condition(void)
10041004
NULL, NULL, &count);
10051005
}
10061006

1007-
static int bail_on_loose(const struct object_id *oid,
1008-
const char *path,
1009-
void *data)
1007+
static int bail_on_loose(const struct object_id *oid UNUSED,
1008+
const char *path UNUSED,
1009+
void *data UNUSED)
10101010
{
10111011
return 1;
10121012
}
10131013

10141014
static int write_loose_object_to_stdin(const struct object_id *oid,
1015-
const char *path,
1015+
const char *path UNUSED,
10161016
void *data)
10171017
{
10181018
struct write_loose_object_data *d = (struct write_loose_object_data *)data;

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static void log_show_early(struct rev_info *revs, struct commit_list *list)
438438
setitimer(ITIMER_REAL, &early_output_timer, NULL);
439439
}
440440

441-
static void early_output(int signal)
441+
static void early_output(int signal UNUSED)
442442
{
443443
show_early_output = log_show_early;
444444
}

builtin/notes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ static void free_note_data(struct note_data *d)
114114
}
115115

116116
static int list_each_note(const struct object_id *object_oid,
117-
const struct object_id *note_oid, char *note_path,
118-
void *cb_data)
117+
const struct object_id *note_oid,
118+
char *note_path UNUSED,
119+
void *cb_data UNUSED)
119120
{
120121
printf("%s %s\n", oid_to_hex(note_oid), oid_to_hex(object_oid));
121122
return 0;

builtin/pack-objects.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ static int add_object_entry(const struct object_id *oid, enum object_type type,
15921592

15931593
static int add_object_entry_from_bitmap(const struct object_id *oid,
15941594
enum object_type type,
1595-
int flags, uint32_t name_hash,
1595+
int flags UNUSED, uint32_t name_hash,
15961596
struct packed_git *pack, off_t offset)
15971597
{
15981598
display_progress(progress_state, ++nr_seen);
@@ -3262,13 +3262,14 @@ static int add_object_entry_from_pack(const struct object_id *oid,
32623262
return 0;
32633263
}
32643264

3265-
static void show_commit_pack_hint(struct commit *commit, void *_data)
3265+
static void show_commit_pack_hint(struct commit *commit UNUSED,
3266+
void *data UNUSED)
32663267
{
32673268
/* nothing to do; commits don't have a namehash */
32683269
}
32693270

32703271
static void show_object_pack_hint(struct object *object, const char *name,
3271-
void *_data)
3272+
void *data UNUSED)
32723273
{
32733274
struct object_entry *oe = packlist_find(&to_pack, &object->oid);
32743275
if (!oe)
@@ -3466,7 +3467,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
34663467
return;
34673468
}
34683469

3469-
static void show_cruft_object(struct object *obj, const char *name, void *data)
3470+
static void show_cruft_object(struct object *obj, const char *name, void *data UNUSED)
34703471
{
34713472
/*
34723473
* if we did not record it earlier, it's at least as old as our
@@ -3486,7 +3487,7 @@ static void show_cruft_commit(struct commit *commit, void *data)
34863487
show_cruft_object((struct object*)commit, NULL, data);
34873488
}
34883489

3489-
static int cruft_include_check_obj(struct object *obj, void *data)
3490+
static int cruft_include_check_obj(struct object *obj, void *data UNUSED)
34903491
{
34913492
return !has_object_kept_pack(&obj->oid, IN_CORE_KEEP_PACKS);
34923493
}
@@ -3665,7 +3666,7 @@ static void read_object_list_from_stdin(void)
36653666
}
36663667
}
36673668

3668-
static void show_commit(struct commit *commit, void *data)
3669+
static void show_commit(struct commit *commit, void *data UNUSED)
36693670
{
36703671
add_object_entry(&commit->object.oid, OBJ_COMMIT, NULL, 0);
36713672

@@ -3676,7 +3677,8 @@ static void show_commit(struct commit *commit, void *data)
36763677
propagate_island_marks(commit);
36773678
}
36783679

3679-
static void show_object(struct object *obj, const char *name, void *data)
3680+
static void show_object(struct object *obj, const char *name,
3681+
void *data UNUSED)
36803682
{
36813683
add_preferred_base_object(name);
36823684
add_object_entry(&obj->oid, obj->type, name, 0);
@@ -3763,7 +3765,7 @@ static void show_edge(struct commit *commit)
37633765
static int add_object_in_unpacked_pack(const struct object_id *oid,
37643766
struct packed_git *pack,
37653767
uint32_t pos,
3766-
void *_data)
3768+
void *data UNUSED)
37673769
{
37683770
if (cruft) {
37693771
off_t offset;
@@ -3797,7 +3799,7 @@ static void add_objects_in_unpacked_packs(void)
37973799
}
37983800

37993801
static int add_loose_object(const struct object_id *oid, const char *path,
3800-
void *data)
3802+
void *data UNUSED)
38013803
{
38023804
enum object_type type = oid_object_info(the_repository, oid, NULL);
38033805

@@ -3948,13 +3950,13 @@ static int get_object_list_from_bitmap(struct rev_info *revs)
39483950
}
39493951

39503952
static void record_recent_object(struct object *obj,
3951-
const char *name,
3952-
void *data)
3953+
const char *name UNUSED,
3954+
void *data UNUSED)
39533955
{
39543956
oid_array_append(&recent_objects, &obj->oid);
39553957
}
39563958

3957-
static void record_recent_commit(struct commit *commit, void *data)
3959+
static void record_recent_commit(struct commit *commit, void *data UNUSED)
39583960
{
39593961
oid_array_append(&recent_objects, &commit->object.oid);
39603962
}

builtin/prune.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ static int prune_object(const struct object_id *oid, const char *fullpath,
100100
return 0;
101101
}
102102

103-
static int prune_cruft(const char *basename, const char *path, void *data)
103+
static int prune_cruft(const char *basename, const char *path,
104+
void *data UNUSED)
104105
{
105106
if (starts_with(basename, "tmp_obj_"))
106107
prune_tmp_file(path);
@@ -109,7 +110,8 @@ static int prune_cruft(const char *basename, const char *path, void *data)
109110
return 0;
110111
}
111112

112-
static int prune_subdir(unsigned int nr, const char *path, void *data)
113+
static int prune_subdir(unsigned int nr UNUSED, const char *path,
114+
void *data UNUSED)
113115
{
114116
if (!show_only)
115117
rmdir(path);

0 commit comments

Comments
 (0)