]> git.ipfire.org Git - thirdparty/git.git/commitdiff
mark unused read_tree_recursive() callback parameters
authorJeff King <peff@peff.net>
Fri, 19 Aug 2022 10:08:49 +0000 (06:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 19:18:56 +0000 (12:18 -0700)
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>
archive-tar.c
archive-zip.c
archive.c
builtin/checkout.c
builtin/log.c
builtin/ls-tree.c
merge-recursive.c

index 45e5d9140765e27c5cb6ceec09914fd4967e9b0c..0d66a1e0a859e9878acbfa73bfda76c8fe73ed25 100644 (file)
@@ -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;
index 854bceb01872adcdfdf940db82001d52e1fb0498..d63782dc31b19202c5f9b5df1935a01aaf8cdfe1 100644 (file)
@@ -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;
index d5109abb894200f9b37b3631286a529437463816..8b165e935bd8e139deef5a37e9c4eef8bbe556b3 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -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)
 {
index 713410ce2c7d536e741bc81f75bab06a7eb58379..d18c8c886e9cecdfda712dcdc211d6ad9dc402f2 100644 (file)
@@ -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;
index 9b937d59b83dc29691d9cb940223c981f38ff7bf..79a2e4d0bbb6375ece7148952daa65a2e757a5cc 100644 (file)
@@ -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) ? "/" : "");
index e279be8bb636d6a945f36ad10699b50cf115fd78..48df337605f1d75e600ec9f23f53edc18a03f4b0 100644 (file)
@@ -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,
 
 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,
 }
 
 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,
 }
 
 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,
 }
 
 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;
index 775ebe2182680283c4cc141d00d726f18bcbac9b..08c1c36d3344e28d00f67665ab8b4d220d7cc62a 100644 (file)
@@ -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)
 {