From: Rusty Russell Date: Sun, 6 Nov 2016 06:41:53 +0000 (+1030) Subject: ccanlint: mark unused parameters. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=1ddb7420f1ac53c060aec62e26702d1d7029fc54 ccanlint: mark unused parameters. Signed-off-by: Rusty Russell --- diff --git a/tools/ccanlint/tests/avoids_cpp_reserved.c b/tools/ccanlint/tests/avoids_cpp_reserved.c index 78ba6ca8..8e496180 100644 --- a/tools/ccanlint/tests/avoids_cpp_reserved.c +++ b/tools/ccanlint/tests/avoids_cpp_reserved.c @@ -13,7 +13,7 @@ #include #include -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -34,7 +34,8 @@ static struct ccan_file *main_header(struct manifest *m) } static void check_headers_no_cpp(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char *contents; char *tmpsrc, *tmpobj, *cmdout; diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index 5549fc13..26943faa 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/tools/ccanlint/tests/depends_accurate.c @@ -70,7 +70,8 @@ static bool check_dep_includes(struct manifest *m, } static void check_depends_accurate(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct list_head *list; unsigned int i, core_deps, test_deps; diff --git a/tools/ccanlint/tests/depends_build.c b/tools/ccanlint/tests/depends_build.c index d4ebcb1d..24fb7ca3 100644 --- a/tools/ccanlint/tests/depends_build.c +++ b/tools/ccanlint/tests/depends_build.c @@ -15,7 +15,7 @@ #include #include "build.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -76,7 +76,8 @@ char *build_submodule(struct manifest *m, const char *flags, } static void check_depends_built(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct list_head *list; diff --git a/tools/ccanlint/tests/depends_build_without_features.c b/tools/ccanlint/tests/depends_build_without_features.c index f9f582af..cacb5002 100644 --- a/tools/ccanlint/tests/depends_build_without_features.c +++ b/tools/ccanlint/tests/depends_build_without_features.c @@ -16,7 +16,7 @@ #include "reduce_features.h" #include "build.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -24,7 +24,7 @@ static const char *can_build(struct manifest *m) } static void check_depends_built_without_features(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct list_head *list; diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c index 088b1e0c..50f15422 100644 --- a/tools/ccanlint/tests/depends_exist.c +++ b/tools/ccanlint/tests/depends_exist.c @@ -46,7 +46,8 @@ static bool add_dep(struct manifest *m, /* FIXME: check this is still true once we reduce features. */ static void check_depends_exist(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { unsigned int i; char **deps; @@ -77,7 +78,7 @@ static void check_depends_exist(struct manifest *m, } static void check_test_depends_exist(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { unsigned int i; diff --git a/tools/ccanlint/tests/examples_exist.c b/tools/ccanlint/tests/examples_exist.c index c42a2e4e..19d61a89 100644 --- a/tools/ccanlint/tests/examples_exist.c +++ b/tools/ccanlint/tests/examples_exist.c @@ -62,7 +62,7 @@ static char *add_example(struct manifest *m, struct ccan_file *source, /* FIXME: We should have one example per function in header. */ static void extract_examples(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *f, *mainh = NULL; /* gcc complains uninitialized */ diff --git a/tools/ccanlint/tests/examples_relevant.c b/tools/ccanlint/tests/examples_relevant.c index ad718db3..1fc1f3bb 100644 --- a/tools/ccanlint/tests/examples_relevant.c +++ b/tools/ccanlint/tests/examples_relevant.c @@ -14,7 +14,7 @@ #include static void examples_relevant_check(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *f; diff --git a/tools/ccanlint/tests/examples_run.c b/tools/ccanlint/tests/examples_run.c index 8ea6a9bf..6c746b64 100644 --- a/tools/ccanlint/tests/examples_run.c +++ b/tools/ccanlint/tests/examples_run.c @@ -188,7 +188,7 @@ static char *unexpected(struct ccan_file *i, const char *input, } static void run_examples(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *i; struct list_head *list; diff --git a/tools/ccanlint/tests/hash_if.c b/tools/ccanlint/tests/hash_if.c index 78b8a967..e647ca21 100644 --- a/tools/ccanlint/tests/hash_if.c +++ b/tools/ccanlint/tests/hash_if.c @@ -15,7 +15,8 @@ #include static void check_hash_if(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct list_head *list; const char *explanation = diff --git a/tools/ccanlint/tests/headers_idempotent.c b/tools/ccanlint/tests/headers_idempotent.c index 1b2916bd..56c37ef7 100644 --- a/tools/ccanlint/tests/headers_idempotent.c +++ b/tools/ccanlint/tests/headers_idempotent.c @@ -178,7 +178,8 @@ static void check_idem(struct ccan_file *f, struct score *score) } static void check_idempotent(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct ccan_file *f; diff --git a/tools/ccanlint/tests/info_compiles.c b/tools/ccanlint/tests/info_compiles.c index 4ec07a0e..e1485963 100644 --- a/tools/ccanlint/tests/info_compiles.c +++ b/tools/ccanlint/tests/info_compiles.c @@ -16,7 +16,8 @@ #include static void check_info_compiles(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char *info_c_file, *info, *output; int fd; diff --git a/tools/ccanlint/tests/info_documentation_exists.c b/tools/ccanlint/tests/info_documentation_exists.c index 47e72e57..c3f02226 100644 --- a/tools/ccanlint/tests/info_documentation_exists.c +++ b/tools/ccanlint/tests/info_documentation_exists.c @@ -25,7 +25,8 @@ static struct ccanlint info_documentation_exists = { .needs = "info_exists" }; -static void create_info_template_doc(struct manifest *m, struct score *score) +static void create_info_template_doc(struct manifest *m, + struct score *score UNNEEDED) { int fd; FILE *new; @@ -71,7 +72,7 @@ static void create_info_template_doc(struct manifest *m, struct score *score) } static void check_info_documentation_exists(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct list_head *infodocs = get_ccan_file_docs(m->info_file); diff --git a/tools/ccanlint/tests/info_exists.c b/tools/ccanlint/tests/info_exists.c index 9f6f2066..5e4459bc 100644 --- a/tools/ccanlint/tests/info_exists.c +++ b/tools/ccanlint/tests/info_exists.c @@ -14,7 +14,7 @@ #include static void check_has_info(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { if (m->info_file) { @@ -57,7 +57,8 @@ static const char template[] = " return 1;\n" "}\n"; -static void create_info_template(struct manifest *m, struct score *score) +static void create_info_template(struct manifest *m, + struct score *score UNNEEDED) { FILE *info; const char *filename; diff --git a/tools/ccanlint/tests/info_ported.c b/tools/ccanlint/tests/info_ported.c index 3479cfc4..80e347c7 100644 --- a/tools/ccanlint/tests/info_ported.c +++ b/tools/ccanlint/tests/info_ported.c @@ -27,8 +27,9 @@ static const char *can_build(struct manifest *m) return tal_fmt(m, "'_info ported' says '%s'", msg); } -static void check_info_ported(struct manifest *m, - unsigned int *timeleft, struct score *score) +static void check_info_ported(struct manifest *m UNNEEDED, + unsigned int *timeleft UNNEEDED, + struct score *score) { score->pass = true; score->score = 1; diff --git a/tools/ccanlint/tests/info_summary_single_line.c b/tools/ccanlint/tests/info_summary_single_line.c index 760c80b3..b45e00ba 100644 --- a/tools/ccanlint/tests/info_summary_single_line.c +++ b/tools/ccanlint/tests/info_summary_single_line.c @@ -4,7 +4,7 @@ #include static void check_info_summary_single_line(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct list_head *infodocs = get_ccan_file_docs(m->info_file); diff --git a/tools/ccanlint/tests/license_comment.c b/tools/ccanlint/tests/license_comment.c index abe0204e..ef865a4d 100644 --- a/tools/ccanlint/tests/license_comment.c +++ b/tools/ccanlint/tests/license_comment.c @@ -36,7 +36,8 @@ static bool line_has_license_flavour(const char *line, const char *shortname) } static void check_license_comment(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct list_head *list; diff --git a/tools/ccanlint/tests/license_depends_compat.c b/tools/ccanlint/tests/license_depends_compat.c index 10858d9b..4e73858f 100644 --- a/tools/ccanlint/tests/license_depends_compat.c +++ b/tools/ccanlint/tests/license_depends_compat.c @@ -11,7 +11,7 @@ #include static void check_license_depends_compat(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct manifest *i; diff --git a/tools/ccanlint/tests/license_exists.c b/tools/ccanlint/tests/license_exists.c index 85ff7985..3482bfee 100644 --- a/tools/ccanlint/tests/license_exists.c +++ b/tools/ccanlint/tests/license_exists.c @@ -94,7 +94,8 @@ static void handle_license_link(struct manifest *m, struct score *score) extern struct ccanlint license_exists; static void check_has_license(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char buf[PATH_MAX]; ssize_t len; diff --git a/tools/ccanlint/tests/license_file_compat.c b/tools/ccanlint/tests/license_file_compat.c index 08cc31b9..e9273d24 100644 --- a/tools/ccanlint/tests/license_file_compat.c +++ b/tools/ccanlint/tests/license_file_compat.c @@ -12,7 +12,7 @@ #include static void check_license_file_compat(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct list_head *list; diff --git a/tools/ccanlint/tests/main_header_compiles.c b/tools/ccanlint/tests/main_header_compiles.c index f54c6173..1b741d4f 100644 --- a/tools/ccanlint/tests/main_header_compiles.c +++ b/tools/ccanlint/tests/main_header_compiles.c @@ -13,7 +13,7 @@ #include #include -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -34,7 +34,8 @@ static struct ccan_file *main_header(struct manifest *m) } static void check_includes_build(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char *contents; char *tmpsrc, *tmpobj, *cmdout; diff --git a/tools/ccanlint/tests/main_header_exists.c b/tools/ccanlint/tests/main_header_exists.c index 2af9afc0..52a7e43c 100644 --- a/tools/ccanlint/tests/main_header_exists.c +++ b/tools/ccanlint/tests/main_header_exists.c @@ -14,7 +14,8 @@ #include static void check_has_main_header(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct ccan_file *f; diff --git a/tools/ccanlint/tests/module_builds.c b/tools/ccanlint/tests/module_builds.c index cb13a0b6..c33971e6 100644 --- a/tools/ccanlint/tests/module_builds.c +++ b/tools/ccanlint/tests/module_builds.c @@ -15,7 +15,7 @@ #include #include "build.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -42,7 +42,7 @@ char *build_module(struct manifest *m, } static void do_build(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { char *errstr; diff --git a/tools/ccanlint/tests/module_links.c b/tools/ccanlint/tests/module_links.c index 403fff1a..9a2c0be5 100644 --- a/tools/ccanlint/tests/module_links.c +++ b/tools/ccanlint/tests/module_links.c @@ -14,7 +14,7 @@ #include #include -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -65,7 +65,8 @@ static char *lib_list(const struct manifest *m) } static void check_use_build(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char *contents; char *tmpfile, *cmdout; diff --git a/tools/ccanlint/tests/no_trailing_whitespace.c b/tools/ccanlint/tests/no_trailing_whitespace.c index 60ecee79..74f759e7 100644 --- a/tools/ccanlint/tests/no_trailing_whitespace.c +++ b/tools/ccanlint/tests/no_trailing_whitespace.c @@ -21,7 +21,7 @@ static char *get_trailing_whitespace(const tal_t *ctx, const char *line) } static void check_trailing_whitespace(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct list_head *list; diff --git a/tools/ccanlint/tests/objects_build.c b/tools/ccanlint/tests/objects_build.c index d0bd7365..58f36437 100644 --- a/tools/ccanlint/tests/objects_build.c +++ b/tools/ccanlint/tests/objects_build.c @@ -15,7 +15,7 @@ #include #include "build.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -74,7 +74,8 @@ void build_objects(struct manifest *m, } static void check_objs_build(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { const char *flags; diff --git a/tools/ccanlint/tests/objects_build_with_stringchecks.c b/tools/ccanlint/tests/objects_build_with_stringchecks.c index 1e99c100..083e7923 100644 --- a/tools/ccanlint/tests/objects_build_with_stringchecks.c +++ b/tools/ccanlint/tests/objects_build_with_stringchecks.c @@ -92,7 +92,7 @@ static struct ccan_file *get_main_header(struct manifest *m) } static void build_objects_with_stringchecks(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *i; diff --git a/tools/ccanlint/tests/objects_build_without_features.c b/tools/ccanlint/tests/objects_build_without_features.c index 4406842f..a32c0f62 100644 --- a/tools/ccanlint/tests/objects_build_without_features.c +++ b/tools/ccanlint/tests/objects_build_without_features.c @@ -4,7 +4,7 @@ #include "build.h" static void check_objs_build_without_features(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { const char *flags = tal_fmt(score, "%s %s", diff --git a/tools/ccanlint/tests/reduce_features.c b/tools/ccanlint/tests/reduce_features.c index b46c85fc..b49922b5 100644 --- a/tools/ccanlint/tests/reduce_features.c +++ b/tools/ccanlint/tests/reduce_features.c @@ -130,7 +130,8 @@ static struct htable_option *get_config_options(struct manifest *m) } static void do_reduce_features(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct htable_option *options_used, *options_avail, *options; struct htable_option_iter i; diff --git a/tools/ccanlint/tests/tests_compile.c b/tools/ccanlint/tests/tests_compile.c index f6995085..0bafcc64 100644 --- a/tools/ccanlint/tests/tests_compile.c +++ b/tools/ccanlint/tests/tests_compile.c @@ -16,7 +16,7 @@ #include "reduce_features.h" #include "tests_compile.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -54,7 +54,7 @@ char *test_obj_list(const struct manifest *m, bool link_with_module, return list; } -char *test_lib_list(const struct manifest *m, enum compile_type ctype) +char *test_lib_list(const struct manifest *m, enum compile_type ctype UNNEEDED) { unsigned int i; char **libs; @@ -211,7 +211,7 @@ struct ccanlint tests_compile = { REGISTER_TEST(tests_compile); -static const char *features_reduced(struct manifest *m) +static const char *features_reduced(struct manifest *m UNNEEDED) { if (features_were_reduced) return NULL; diff --git a/tools/ccanlint/tests/tests_exist.c b/tools/ccanlint/tests/tests_exist.c index 69e01df6..24c4d877 100644 --- a/tools/ccanlint/tests/tests_exist.c +++ b/tools/ccanlint/tests/tests_exist.c @@ -22,7 +22,7 @@ static struct ccanlint tests_exist = { }; REGISTER_TEST(tests_exist); -static void handle_no_tests(struct manifest *m, struct score *score) +static void handle_no_tests(struct manifest *m, struct score *score UNNEEDED) { FILE *run; struct ccan_file *i; @@ -104,7 +104,8 @@ static void handle_no_tests(struct manifest *m, struct score *score) } static void check_tests_exist(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct stat st; char *test_dir = path_join(m, m->dir, "test"); diff --git a/tools/ccanlint/tests/tests_helpers_compile.c b/tools/ccanlint/tests/tests_helpers_compile.c index 6384bd38..0f728fb9 100644 --- a/tools/ccanlint/tests/tests_helpers_compile.c +++ b/tools/ccanlint/tests/tests_helpers_compile.c @@ -14,7 +14,7 @@ #include #include "reduce_features.h" -static const char *can_run(struct manifest *m) +static const char *can_run(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -33,7 +33,7 @@ static bool compile(struct manifest *m, } static void compile_test_helpers(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score, const char *flags, enum compile_type ctype) @@ -83,7 +83,7 @@ struct ccanlint tests_helpers_compile = { REGISTER_TEST(tests_helpers_compile); -static const char *features_reduced(struct manifest *m) +static const char *features_reduced(struct manifest *m UNNEEDED) { if (features_were_reduced) return NULL; diff --git a/tools/ccanlint/tests/tests_pass_valgrind.c b/tools/ccanlint/tests/tests_pass_valgrind.c index 2f4df18b..700efeb9 100644 --- a/tools/ccanlint/tests/tests_pass_valgrind.c +++ b/tools/ccanlint/tests/tests_pass_valgrind.c @@ -158,7 +158,7 @@ static const char *concat(struct score *score, char *bits[]) /* FIXME: Run examples, too! */ static void do_run_tests_vg(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *i; @@ -199,7 +199,7 @@ static void do_run_tests_vg(struct manifest *m, } static void do_leakcheck_vg(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *i;