Browse Source

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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 2 years ago committed by Junio C Hamano
parent
commit
555ff1c8a4
  1. 2
      archive-tar.c
  2. 2
      archive-zip.c
  3. 3
      archive.c
  4. 2
      builtin/checkout.c
  5. 7
      builtin/log.c
  6. 13
      builtin/ls-tree.c
  7. 2
      merge-recursive.c

2
archive-tar.c

@ -421,7 +421,7 @@ static int git_tar_config(const char *var, const char *value, void *cb) @@ -421,7 +421,7 @@ static int git_tar_config(const char *var, const char *value, void *cb)
return tar_filter_config(var, value, cb);
}

static int write_tar_archive(const struct archiver *ar,
static int write_tar_archive(const struct archiver *UNUSED(ar),
struct archiver_args *args)
{
int err = 0;

2
archive-zip.c

@ -618,7 +618,7 @@ static int archive_zip_config(const char *var, const char *value, @@ -618,7 +618,7 @@ static int archive_zip_config(const char *var, const char *value,
return userdiff_config(var, value);
}

static int write_zip_archive(const struct archiver *ar,
static int write_zip_archive(const struct archiver *UNUSED(ar),
struct archiver_args *args)
{
int err;

3
archive.c

@ -382,7 +382,8 @@ struct path_exists_context { @@ -382,7 +382,8 @@ struct path_exists_context {
struct archiver_args *args;
};

static int reject_entry(const struct object_id *oid, struct strbuf *base,
static int reject_entry(const struct object_id *UNUSED(oid),
struct strbuf *base,
const char *filename, unsigned mode,
void *context)
{

2
builtin/checkout.c

@ -125,7 +125,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm @@ -125,7 +125,7 @@ static int post_checkout_hook(struct commit *old_commit, struct commit *new_comm
}

static int update_some(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *context)
const char *pathname, unsigned mode, void *UNUSED(context))
{
int len;
struct cache_entry *ce;

7
builtin/log.c

@ -645,9 +645,10 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev) @@ -645,9 +645,10 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
return 0;
}

static int show_tree_object(const struct object_id *oid,
struct strbuf *base,
const char *pathname, unsigned mode, void *context)
static int show_tree_object(const struct object_id *UNUSED(oid),
struct strbuf *UNUSED(base),
const char *pathname, unsigned mode,
void *context)
{
FILE *file = context;
fprintf(file, "%s%s\n", pathname, S_ISDIR(mode) ? "/" : "");

13
builtin/ls-tree.c

@ -142,7 +142,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname @@ -142,7 +142,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
}

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

static int show_tree_default(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode,
void *context)
void *UNUSED(context))
{
int early;
int recurse;
@ -230,7 +230,8 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base, @@ -230,7 +230,8 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
}

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

static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *context)
const char *pathname, unsigned mode,
void *UNUSED(context))
{
int early;
int recurse;
@ -279,7 +281,8 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base, @@ -279,7 +281,8 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
}

static int show_tree_object(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *context)
const char *pathname, unsigned mode,
void *UNUSED(context))
{
int early;
int recurse;

2
merge-recursive.c

@ -456,7 +456,7 @@ static void unpack_trees_finish(struct merge_options *opt) @@ -456,7 +456,7 @@ static void unpack_trees_finish(struct merge_options *opt)
clear_unpack_trees_porcelain(&opt->priv->unpack_opts);
}

static int save_files_dirs(const struct object_id *oid,
static int save_files_dirs(const struct object_id *UNUSED(oid),
struct strbuf *base, const char *path,
unsigned int mode, void *context)
{

Loading…
Cancel
Save