Skip to content

Commit c5fcd34

Browse files
committed
Merge branch 'jk/unused-parameter'
Mark-up unused parameters in the code so that we can eventually enable -Wunused-parameter by default. * jk/unused-parameter: t/helper: mark unused callback void data parameters tag: mark unused parameters in each_tag_name_fn callbacks rev-parse: mark unused parameter in for_each_abbrev callback replace: mark unused parameter in each_mergetag_fn callback replace: mark unused parameter in ref callback merge-tree: mark unused parameter in traverse callback fsck: mark unused parameters in various fsck callbacks revisions: drop unused "opt" parameter in "tweak" callbacks count-objects: mark unused parameter in alternates callback am: mark unused keep_cr parameters http-push: mark unused parameter in xml callback http: mark unused parameters in curl callbacks do_for_each_ref_helper(): mark unused repository parameter test-ref-store: drop unimplemented reflog-expire command
2 parents dd224ce + 1e9cb34 commit c5fcd34

22 files changed

+46
-47
lines changed

builtin/am.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
786786
* A split_mail_conv() callback that converts an StGit patch to an RFC2822
787787
* message suitable for parsing with git-mailinfo.
788788
*/
789-
static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr)
789+
static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
790790
{
791791
struct strbuf sb = STRBUF_INIT;
792792
int subject_printed = 0;
@@ -869,7 +869,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
869869
* A split_patches_conv() callback that converts a mercurial patch to a RFC2822
870870
* message suitable for parsing with git-mailinfo.
871871
*/
872-
static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr)
872+
static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
873873
{
874874
struct strbuf sb = STRBUF_INIT;
875875
int rc = 0;

builtin/count-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int count_cruft(const char *basename UNUSED, const char *path,
8282
return 0;
8383
}
8484

85-
static int print_alternate(struct object_directory *odb, void *data)
85+
static int print_alternate(struct object_directory *odb, void *data UNUSED)
8686
{
8787
printf("alternate: ");
8888
quote_c_style(odb->path, NULL, stdout, 0);

builtin/diff-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static const char diff_tree_usage[] =
9999
" --root include the initial commit as diff against /dev/null\n"
100100
COMMON_DIFF_OPTIONS_HELP;
101101

102-
static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
102+
static void diff_tree_tweak_rev(struct rev_info *rev)
103103
{
104104
if (!rev->diffopt.output_format) {
105105
if (rev->dense_combined_merges)

builtin/fsck.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ static int objerror(struct object *obj, const char *err)
9292
return -1;
9393
}
9494

95-
static int fsck_error_func(struct fsck_options *o,
95+
static int fsck_error_func(struct fsck_options *o UNUSED,
9696
const struct object_id *oid,
9797
enum object_type object_type,
9898
enum fsck_msg_type msg_type,
99-
enum fsck_msg_id msg_id,
99+
enum fsck_msg_id msg_id UNUSED,
100100
const char *message)
101101
{
102102
switch (msg_type) {
@@ -121,7 +121,7 @@ static int fsck_error_func(struct fsck_options *o,
121121
static struct object_array pending;
122122

123123
static int mark_object(struct object *obj, enum object_type type,
124-
void *data, struct fsck_options *options)
124+
void *data, struct fsck_options *options UNUSED)
125125
{
126126
struct object *parent = data;
127127

@@ -206,8 +206,8 @@ static int traverse_reachable(void)
206206
return !!result;
207207
}
208208

209-
static int mark_used(struct object *obj, enum object_type object_type,
210-
void *data, struct fsck_options *options)
209+
static int mark_used(struct object *obj, int type UNUSED,
210+
void *data UNUSED, struct fsck_options *options UNUSED)
211211
{
212212
if (!obj)
213213
return 1;

builtin/index-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ static void cleanup_thread(void)
221221
}
222222

223223
static int mark_link(struct object *obj, enum object_type type,
224-
void *data, struct fsck_options *options)
224+
void *data UNUSED,
225+
struct fsck_options *options UNUSED)
225226
{
226227
if (!obj)
227228
return -1;

builtin/log.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ static int show_tree_object(const struct object_id *oid UNUSED,
718718
return 0;
719719
}
720720

721-
static void show_setup_revisions_tweak(struct rev_info *rev,
722-
struct setup_revision_opt *opt)
721+
static void show_setup_revisions_tweak(struct rev_info *rev)
723722
{
724723
if (rev->first_parent_only)
725724
diff_merges_default_to_first_parent(rev);
@@ -862,8 +861,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
862861
return cmd_log_deinit(cmd_log_walk(&rev), &rev);
863862
}
864863

865-
static void log_setup_revisions_tweak(struct rev_info *rev,
866-
struct setup_revision_opt *opt)
864+
static void log_setup_revisions_tweak(struct rev_info *rev)
867865
{
868866
if (rev->diffopt.flags.default_follow_renames &&
869867
diff_check_follow_pathspec(&rev->prune_data, 0))

builtin/merge-tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
324324
* The successful merge rules are the same as for the three-way merge
325325
* in git-read-tree.
326326
*/
327-
static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
327+
static int threeway_callback(int n UNUSED, unsigned long mask,
328+
unsigned long dirmask UNUSED,
329+
struct name_entry *entry, struct traverse_info *info)
328330
{
329331
/* Same in both? */
330332
if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {

builtin/mktag.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ static int option_strict = 1;
1818

1919
static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
2020

21-
static int mktag_fsck_error_func(struct fsck_options *o,
22-
const struct object_id *oid,
23-
enum object_type object_type,
21+
static int mktag_fsck_error_func(struct fsck_options *o UNUSED,
22+
const struct object_id *oid UNUSED,
23+
enum object_type object_type UNUSED,
2424
enum fsck_msg_type msg_type,
25-
enum fsck_msg_id msg_id,
25+
enum fsck_msg_id msg_id UNUSED,
2626
const char *message)
2727
{
2828
switch (msg_type) {

builtin/replace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct show_data {
4949

5050
static int show_reference(struct repository *r, const char *refname,
5151
const struct object_id *oid,
52-
int flag, void *cb_data)
52+
int flag UNUSED, void *cb_data)
5353
{
5454
struct show_data *data = cb_data;
5555

@@ -409,7 +409,7 @@ struct check_mergetag_data {
409409
const char **argv;
410410
};
411411

412-
static int check_one_mergetag(struct commit *commit,
412+
static int check_one_mergetag(struct commit *commit UNUSED,
413413
struct commit_extra_header *extra,
414414
void *data)
415415
{

builtin/rev-parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int anti_reference(const char *refname, const struct object_id *oid,
225225
return 0;
226226
}
227227

228-
static int show_abbrev(const struct object_id *oid, void *cb_data)
228+
static int show_abbrev(const struct object_id *oid, void *cb_data UNUSED)
229229
{
230230
show_rev(NORMAL, oid, NULL);
231231
return 0;

0 commit comments

Comments
 (0)