Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-25 22:05:24 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-25 22:05:24 +0300
commitc5fcd34e1bfabde14dff226ad92aca9c39d67391 (patch)
tree9d5e641fa51c7398b844742319e5d88f633b6b9a
parentdd224ce15d926ec4d47a727e0f2ee3dd4cc4d5e5 (diff)
parent1e9cb3487ad21a4ac78a613abc04a131c8950633 (diff)
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
-rw-r--r--builtin/am.c4
-rw-r--r--builtin/count-objects.c2
-rw-r--r--builtin/diff-tree.c2
-rw-r--r--builtin/fsck.c10
-rw-r--r--builtin/index-pack.c3
-rw-r--r--builtin/log.c6
-rw-r--r--builtin/merge-tree.c4
-rw-r--r--builtin/mktag.c8
-rw-r--r--builtin/replace.c4
-rw-r--r--builtin/rev-parse.c2
-rw-r--r--builtin/tag.c4
-rw-r--r--builtin/unpack-objects.c3
-rw-r--r--fsck.c4
-rw-r--r--http-push.c2
-rw-r--r--http.c9
-rw-r--r--object-file.c10
-rw-r--r--refs.c2
-rw-r--r--revision.c2
-rw-r--r--revision.h2
-rw-r--r--t/helper/test-dump-split-index.c2
-rw-r--r--t/helper/test-oid-array.c2
-rw-r--r--t/helper/test-ref-store.c6
22 files changed, 46 insertions, 47 deletions
diff --git a/builtin/am.c b/builtin/am.c
index dcb89439b1..146aeff54f 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -786,7 +786,7 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
* A split_mail_conv() callback that converts an StGit patch to an RFC2822
* message suitable for parsing with git-mailinfo.
*/
-static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
{
struct strbuf sb = STRBUF_INIT;
int subject_printed = 0;
@@ -869,7 +869,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
* A split_patches_conv() callback that converts a mercurial patch to a RFC2822
* message suitable for parsing with git-mailinfo.
*/
-static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
{
struct strbuf sb = STRBUF_INIT;
int rc = 0;
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index 97cdfb0ac5..2d4bb5e8d0 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -82,7 +82,7 @@ static int count_cruft(const char *basename UNUSED, const char *path,
return 0;
}
-static int print_alternate(struct object_directory *odb, void *data)
+static int print_alternate(struct object_directory *odb, void *data UNUSED)
{
printf("alternate: ");
quote_c_style(odb->path, NULL, stdout, 0);
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index d62caa6c8b..c9ba35f143 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -99,7 +99,7 @@ static const char diff_tree_usage[] =
" --root include the initial commit as diff against /dev/null\n"
COMMON_DIFF_OPTIONS_HELP;
-static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
+static void diff_tree_tweak_rev(struct rev_info *rev)
{
if (!rev->diffopt.output_format) {
if (rev->dense_combined_merges)
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 768bebe268..c1d0290026 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -92,11 +92,11 @@ static int objerror(struct object *obj, const char *err)
return -1;
}
-static int fsck_error_func(struct fsck_options *o,
+static int fsck_error_func(struct fsck_options *o UNUSED,
const struct object_id *oid,
enum object_type object_type,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
switch (msg_type) {
@@ -121,7 +121,7 @@ static int fsck_error_func(struct fsck_options *o,
static struct object_array pending;
static int mark_object(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data, struct fsck_options *options UNUSED)
{
struct object *parent = data;
@@ -206,8 +206,8 @@ static int traverse_reachable(void)
return !!result;
}
-static int mark_used(struct object *obj, enum object_type object_type,
- void *data, struct fsck_options *options)
+static int mark_used(struct object *obj, int type UNUSED,
+ void *data UNUSED, struct fsck_options *options UNUSED)
{
if (!obj)
return 1;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 3da879d138..006ffdc9c5 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -221,7 +221,8 @@ static void cleanup_thread(void)
}
static int mark_link(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data UNUSED,
+ struct fsck_options *options UNUSED)
{
if (!obj)
return -1;
diff --git a/builtin/log.c b/builtin/log.c
index 1b119eaf0b..db3a88bfe9 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -718,8 +718,7 @@ static int show_tree_object(const struct object_id *oid UNUSED,
return 0;
}
-static void show_setup_revisions_tweak(struct rev_info *rev,
- struct setup_revision_opt *opt)
+static void show_setup_revisions_tweak(struct rev_info *rev)
{
if (rev->first_parent_only)
diff_merges_default_to_first_parent(rev);
@@ -862,8 +861,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
return cmd_log_deinit(cmd_log_walk(&rev), &rev);
}
-static void log_setup_revisions_tweak(struct rev_info *rev,
- struct setup_revision_opt *opt)
+static void log_setup_revisions_tweak(struct rev_info *rev)
{
if (rev->diffopt.flags.default_follow_renames &&
diff_check_follow_pathspec(&rev->prune_data, 0))
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 6f7db436d2..0de42aecf4 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -324,7 +324,9 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
* The successful merge rules are the same as for the three-way merge
* in git-read-tree.
*/
-static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
+static int threeway_callback(int n UNUSED, unsigned long mask,
+ unsigned long dirmask UNUSED,
+ struct name_entry *entry, struct traverse_info *info)
{
/* Same in both? */
if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 43e2766db4..d8e0b5afc0 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -18,11 +18,11 @@ static int option_strict = 1;
static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
-static int mktag_fsck_error_func(struct fsck_options *o,
- const struct object_id *oid,
- enum object_type object_type,
+static int mktag_fsck_error_func(struct fsck_options *o UNUSED,
+ const struct object_id *oid UNUSED,
+ enum object_type object_type UNUSED,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
switch (msg_type) {
diff --git a/builtin/replace.c b/builtin/replace.c
index 9ceaa25233..da59600ad2 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -49,7 +49,7 @@ struct show_data {
static int show_reference(struct repository *r, const char *refname,
const struct object_id *oid,
- int flag, void *cb_data)
+ int flag UNUSED, void *cb_data)
{
struct show_data *data = cb_data;
@@ -409,7 +409,7 @@ struct check_mergetag_data {
const char **argv;
};
-static int check_one_mergetag(struct commit *commit,
+static int check_one_mergetag(struct commit *commit UNUSED,
struct commit_extra_header *extra,
void *data)
{
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 434646b074..fde8861ca4 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -225,7 +225,7 @@ static int anti_reference(const char *refname, const struct object_id *oid,
return 0;
}
-static int show_abbrev(const struct object_id *oid, void *cb_data)
+static int show_abbrev(const struct object_id *oid, void *cb_data UNUSED)
{
show_rev(NORMAL, oid, NULL);
return 0;
diff --git a/builtin/tag.c b/builtin/tag.c
index f33600c050..3918eacbb5 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -121,7 +121,7 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn,
return had_error;
}
-static int collect_tags(const char *name, const char *ref,
+static int collect_tags(const char *name UNUSED, const char *ref,
const struct object_id *oid, void *cb_data)
{
struct string_list *ref_list = cb_data;
@@ -155,7 +155,7 @@ static int delete_tags(const char **argv)
return result;
}
-static int verify_tag(const char *name, const char *ref,
+static int verify_tag(const char *name, const char *ref UNUSED,
const struct object_id *oid, void *cb_data)
{
int flags;
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 84b68304ed..32505255a0 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -215,7 +215,8 @@ static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
* Verify its reachability and validity recursively and write it out.
*/
static int check_object(struct object *obj, enum object_type type,
- void *data, struct fsck_options *options)
+ void *data UNUSED,
+ struct fsck_options *options UNUSED)
{
struct obj_buffer *obj_buf;
diff --git a/fsck.c b/fsck.c
index b160b6f9d0..2b1e348005 100644
--- a/fsck.c
+++ b/fsck.c
@@ -1309,9 +1309,9 @@ int fsck_buffer(const struct object_id *oid, enum object_type type,
int fsck_error_function(struct fsck_options *o,
const struct object_id *oid,
- enum object_type object_type,
+ enum object_type object_type UNUSED,
enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
if (msg_type == FSCK_WARN) {
diff --git a/http-push.c b/http-push.c
index 9ab2383d2b..a704f490fd 100644
--- a/http-push.c
+++ b/http-push.c
@@ -783,7 +783,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
static void one_remote_ref(const char *refname);
static void
-xml_start_tag(void *userData, const char *name, const char **atts)
+xml_start_tag(void *userData, const char *name, const char **atts UNUSED)
{
struct xml_ctx *ctx = (struct xml_ctx *)userData;
const char *c = strchr(name, ':');
diff --git a/http.c b/http.c
index 2af9782330..e138b4b96f 100644
--- a/http.c
+++ b/http.c
@@ -196,7 +196,7 @@ static inline int is_hdr_continuation(const char *ptr, const size_t size)
return size && (*ptr == ' ' || *ptr == '\t');
}
-static size_t fwrite_wwwauth(char *ptr, size_t eltsize, size_t nmemb, void *p)
+static size_t fwrite_wwwauth(char *ptr, size_t eltsize, size_t nmemb, void *p UNUSED)
{
size_t size = eltsize * nmemb;
struct strvec *values = &http_auth.wwwauth_headers;
@@ -295,7 +295,8 @@ exit:
return size;
}
-size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf)
+size_t fwrite_null(char *ptr UNUSED, size_t eltsize UNUSED, size_t nmemb,
+ void *data UNUSED)
{
return nmemb;
}
@@ -821,7 +822,9 @@ static void curl_dump_info(char *data, size_t size)
strbuf_release(&buf);
}
-static int curl_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
+static int curl_trace(CURL *handle UNUSED, curl_infotype type,
+ char *data, size_t size,
+ void *userp UNUSED)
{
const char *text;
enum { NO_FILTER = 0, DO_FILTER = 1 };
diff --git a/object-file.c b/object-file.c
index 5ebe1b00c5..7dc0c4bfbb 100644
--- a/object-file.c
+++ b/object-file.c
@@ -2306,11 +2306,11 @@ int repo_has_object_file(struct repository *r,
* report the minimal fsck error here, and rely on the caller to
* give more context.
*/
-static int hash_format_check_report(struct fsck_options *opts,
- const struct object_id *oid,
- enum object_type object_type,
- enum fsck_msg_type msg_type,
- enum fsck_msg_id msg_id,
+static int hash_format_check_report(struct fsck_options *opts UNUSED,
+ const struct object_id *oid UNUSED,
+ enum object_type object_type UNUSED,
+ enum fsck_msg_type msg_type UNUSED,
+ enum fsck_msg_id msg_id UNUSED,
const char *message)
{
error(_("object fails fsck: %s"), message);
diff --git a/refs.c b/refs.c
index 14605cbffc..fcae5dddc6 100644
--- a/refs.c
+++ b/refs.c
@@ -1613,7 +1613,7 @@ struct do_for_each_ref_help {
void *cb_data;
};
-static int do_for_each_ref_helper(struct repository *r,
+static int do_for_each_ref_helper(struct repository *r UNUSED,
const char *refname,
const struct object_id *oid,
int flags,
diff --git a/revision.c b/revision.c
index 03dcf4f106..2f4c53ea20 100644
--- a/revision.c
+++ b/revision.c
@@ -2970,7 +2970,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (!revs->def)
revs->def = opt ? opt->def : NULL;
if (opt && opt->tweak)
- opt->tweak(revs, opt);
+ opt->tweak(revs);
if (revs->show_merge)
prepare_show_merge(revs);
if (revs->def && !revs->pending.nr && !revs->rev_input_given) {
diff --git a/revision.h b/revision.h
index 7f219cde62..82ab400139 100644
--- a/revision.h
+++ b/revision.h
@@ -429,7 +429,7 @@ void repo_init_revisions(struct repository *r,
*/
struct setup_revision_opt {
const char *def;
- void (*tweak)(struct rev_info *, struct setup_revision_opt *);
+ void (*tweak)(struct rev_info *);
unsigned int assume_dashdash:1,
allow_exclude_promisor_objects:1,
free_removed_argv_elements:1;
diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c
index 5cf0b26dca..f29d18ef94 100644
--- a/t/helper/test-dump-split-index.c
+++ b/t/helper/test-dump-split-index.c
@@ -7,7 +7,7 @@
#include "split-index.h"
#include "ewah/ewok.h"
-static void show_bit(size_t pos, void *data)
+static void show_bit(size_t pos, void *data UNUSED)
{
printf(" %d", (int)pos);
}
diff --git a/t/helper/test-oid-array.c b/t/helper/test-oid-array.c
index eef68833b7..aafe398ef0 100644
--- a/t/helper/test-oid-array.c
+++ b/t/helper/test-oid-array.c
@@ -4,7 +4,7 @@
#include "setup.h"
#include "strbuf.h"
-static int print_oid(const struct object_id *oid, void *data)
+static int print_oid(const struct object_id *oid, void *data UNUSED)
{
puts(oid_to_hex(oid));
return 0;
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index 13865425dd..48552e6a9e 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -277,11 +277,6 @@ static int cmd_delete_reflog(struct ref_store *refs, const char **argv)
return refs_delete_reflog(refs, refname);
}
-static int cmd_reflog_expire(struct ref_store *refs, const char **argv)
-{
- die("not supported yet");
-}
-
static int cmd_delete_ref(struct ref_store *refs, const char **argv)
{
const char *msg = notnull(*argv++, "msg");
@@ -336,7 +331,6 @@ static struct command commands[] = {
{ "reflog-exists", cmd_reflog_exists },
{ "create-reflog", cmd_create_reflog },
{ "delete-reflog", cmd_delete_reflog },
- { "reflog-expire", cmd_reflog_expire },
/*
* backend transaction functions can't be tested separately
*/