Skip to content

Commit 555ff1c

Browse files
peffgitster
authored andcommitted
mark unused read_tree_recursive() callback parameters
We pass a callback to read_tree_recursive(), but not every callback needs every parameter. Let's mark the unused ones to satisfy -Wunused-parameter. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 02c3c59 commit 555ff1c

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

archive-tar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static int git_tar_config(const char *var, const char *value, void *cb)
421421
return tar_filter_config(var, value, cb);
422422
}
423423

424-
static int write_tar_archive(const struct archiver *ar,
424+
static int write_tar_archive(const struct archiver *UNUSED(ar),
425425
struct archiver_args *args)
426426
{
427427
int err = 0;

archive-zip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static int archive_zip_config(const char *var, const char *value,
618618
return userdiff_config(var, value);
619619
}
620620

621-
static int write_zip_archive(const struct archiver *ar,
621+
static int write_zip_archive(const struct archiver *UNUSED(ar),
622622
struct archiver_args *args)
623623
{
624624
int err;

archive.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ struct path_exists_context {
382382
struct archiver_args *args;
383383
};
384384

385-
static int reject_entry(const struct object_id *oid, struct strbuf *base,
385+
static int reject_entry(const struct object_id *UNUSED(oid),
386+
struct strbuf *base,
386387
const char *filename, unsigned mode,
387388
void *context)
388389
{

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm
125125
}
126126

127127
static int update_some(const struct object_id *oid, struct strbuf *base,
128-
const char *pathname, unsigned mode, void *context)
128+
const char *pathname, unsigned mode, void *UNUSED(context))
129129
{
130130
int len;
131131
struct cache_entry *ce;

builtin/log.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,10 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
645645
return 0;
646646
}
647647

648-
static int show_tree_object(const struct object_id *oid,
649-
struct strbuf *base,
650-
const char *pathname, unsigned mode, void *context)
648+
static int show_tree_object(const struct object_id *UNUSED(oid),
649+
struct strbuf *UNUSED(base),
650+
const char *pathname, unsigned mode,
651+
void *context)
651652
{
652653
FILE *file = context;
653654
fprintf(file, "%s%s\n", pathname, S_ISDIR(mode) ? "/" : "");

builtin/ls-tree.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
142142
}
143143

144144
static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
145-
const char *pathname, unsigned mode, void *context)
145+
const char *pathname, unsigned mode, void *UNUSED(context))
146146
{
147147
size_t baselen;
148148
int recurse = 0;
@@ -213,7 +213,7 @@ static void show_tree_common_default_long(struct strbuf *base,
213213

214214
static int show_tree_default(const struct object_id *oid, struct strbuf *base,
215215
const char *pathname, unsigned mode,
216-
void *context)
216+
void *UNUSED(context))
217217
{
218218
int early;
219219
int recurse;
@@ -230,7 +230,8 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
230230
}
231231

232232
static int show_tree_long(const struct object_id *oid, struct strbuf *base,
233-
const char *pathname, unsigned mode, void *context)
233+
const char *pathname, unsigned mode,
234+
void *UNUSED(context))
234235
{
235236
int early;
236237
int recurse;
@@ -259,7 +260,8 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
259260
}
260261

261262
static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
262-
const char *pathname, unsigned mode, void *context)
263+
const char *pathname, unsigned mode,
264+
void *UNUSED(context))
263265
{
264266
int early;
265267
int recurse;
@@ -279,7 +281,8 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
279281
}
280282

281283
static int show_tree_object(const struct object_id *oid, struct strbuf *base,
282-
const char *pathname, unsigned mode, void *context)
284+
const char *pathname, unsigned mode,
285+
void *UNUSED(context))
283286
{
284287
int early;
285288
int recurse;

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static void unpack_trees_finish(struct merge_options *opt)
456456
clear_unpack_trees_porcelain(&opt->priv->unpack_opts);
457457
}
458458

459-
static int save_files_dirs(const struct object_id *oid,
459+
static int save_files_dirs(const struct object_id *UNUSED(oid),
460460
struct strbuf *base, const char *path,
461461
unsigned int mode, void *context)
462462
{

0 commit comments

Comments
 (0)