]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: mark unused parameters.
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 6 Nov 2016 06:41:53 +0000 (17:11 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 6 Nov 2016 06:41:53 +0000 (17:11 +1030)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
32 files changed:
tools/ccanlint/tests/avoids_cpp_reserved.c
tools/ccanlint/tests/depends_accurate.c
tools/ccanlint/tests/depends_build.c
tools/ccanlint/tests/depends_build_without_features.c
tools/ccanlint/tests/depends_exist.c
tools/ccanlint/tests/examples_exist.c
tools/ccanlint/tests/examples_relevant.c
tools/ccanlint/tests/examples_run.c
tools/ccanlint/tests/hash_if.c
tools/ccanlint/tests/headers_idempotent.c
tools/ccanlint/tests/info_compiles.c
tools/ccanlint/tests/info_documentation_exists.c
tools/ccanlint/tests/info_exists.c
tools/ccanlint/tests/info_ported.c
tools/ccanlint/tests/info_summary_single_line.c
tools/ccanlint/tests/license_comment.c
tools/ccanlint/tests/license_depends_compat.c
tools/ccanlint/tests/license_exists.c
tools/ccanlint/tests/license_file_compat.c
tools/ccanlint/tests/main_header_compiles.c
tools/ccanlint/tests/main_header_exists.c
tools/ccanlint/tests/module_builds.c
tools/ccanlint/tests/module_links.c
tools/ccanlint/tests/no_trailing_whitespace.c
tools/ccanlint/tests/objects_build.c
tools/ccanlint/tests/objects_build_with_stringchecks.c
tools/ccanlint/tests/objects_build_without_features.c
tools/ccanlint/tests/reduce_features.c
tools/ccanlint/tests/tests_compile.c
tools/ccanlint/tests/tests_exist.c
tools/ccanlint/tests/tests_helpers_compile.c
tools/ccanlint/tests/tests_pass_valgrind.c

index 78ba6ca8b87fbecdbd7a23db1593d424f537ae22..8e49618023ac814dce9f2faabcede4c077440651 100644 (file)
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <ctype.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";
@@ -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;
index 5549fc13360de3f96735a75622b9cd871ef6fa1f..26943faa628a6e98fa93ab5badb9e7c67d511c20 100644 (file)
@@ -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;
index d4ebcb1da9af945ddf5652afdcda76d185eb8b0c..24fb7ca3d68de7e281a8cdfdac123d19ea423958 100644 (file)
@@ -15,7 +15,7 @@
 #include <ctype.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";
@@ -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;
 
index f9f582aff79aada824d8d05465634b20506fd136..cacb5002532c8f8f0e8b39c4d7bb39956f722c57 100644 (file)
@@ -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;
index 088b1e0cd6472a702bd974c1051b7770eb1b0597..50f154221f3bb46e931da8d845b768a9c4f025b7 100644 (file)
@@ -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;
index c42a2e4e9ff27c5f183b498e798c3ae10a1e238f..19d61a89e3a058135495c607dc2b733b1c15ecba 100644 (file)
@@ -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 */
index ad718db3a54cf5a566d677f8e24e265082b58560..1fc1f3bb67a21fe795916f91fa00e8f9543eb223 100644 (file)
@@ -14,7 +14,7 @@
 #include <ctype.h>
 
 static void examples_relevant_check(struct manifest *m,
-                                   unsigned int *timeleft,
+                                   unsigned int *timeleft UNNEEDED,
                                    struct score *score)
 {
        struct ccan_file *f;
index 8ea6a9bf515806fa58e22bbe480c96e8b4065460..6c746b64a3722f362b6908f59abd4f39f1c5a5a5 100644 (file)
@@ -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;
index 78b8a9674e484dd26b3ca4b19a75ae325fcfc488..e647ca2190aa4e25978ff0e4f4b608036156672d 100644 (file)
@@ -15,7 +15,8 @@
 #include <ctype.h>
 
 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 =
index 1b2916bda3cb1ec1293ba59f7cda7f4b5ea6f8c8..56c37ef7cbb59489d771d41d7b5f6562359a90b9 100644 (file)
@@ -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;
 
index 4ec07a0e0486b916c568c0d421f9161e86b5be9b..e1485963e8fbb479be8aac8da0c9c098fb923695 100644 (file)
@@ -16,7 +16,8 @@
 #include <ctype.h>
 
 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;
index 47e72e5777edcb9824f5a5c069678285054ea872..c3f02226b869b5182c8fe49a76a9133c98bc9ddf 100644 (file)
@@ -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);
index 9f6f2066ddf90dc5d0149f68ee62827ae7d2f3cd..5e4459bcbe02d362213bcf35e99a33c37c14f175 100644 (file)
@@ -14,7 +14,7 @@
 #include <ccan/noerr/noerr.h>
 
 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;
index 3479cfc417291781c81b47d22f0770f87e7957b0..80e347c73343df3983a4513a4fe1b73b56ed59b4 100644 (file)
@@ -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;
index 760c80b31c23810f659a952380516db1abd6eae2..b45e00bab4344c6dcf2f2c0220b133335e564131 100644 (file)
@@ -4,7 +4,7 @@
 #include <ccan/str/str.h>
 
 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);
index abe0204e9c32c2ea9aa7d0142d243d4585a57ee9..ef865a4d6f74fdaa51fe277dae1324e791b3513b 100644 (file)
@@ -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;
 
index 10858d9ba5a23c4f7a7ee7104abb8113f0cbfb2b..4e73858f1c6146ed39e786e8f06aedb1b6526f81 100644 (file)
@@ -11,7 +11,7 @@
 #include <err.h>
 
 static void check_license_depends_compat(struct manifest *m,
-                                        unsigned int *timeleft,
+                                        unsigned int *timeleft UNNEEDED,
                                         struct score *score)
 {
        struct manifest *i;
index 85ff79854082a096756f037ec1b415de4ee50cdd..3482bfee7745d6913a76380e8648a18695e62d65 100644 (file)
@@ -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;
index 08cc31b9a1b2ddd66fbfe76f89b69b19d60b95fc..e9273d2443372cab2bd04d642300788cede5515d 100644 (file)
@@ -12,7 +12,7 @@
 #include <ccan/str/str.h>
 
 static void check_license_file_compat(struct manifest *m,
-                                     unsigned int *timeleft,
+                                     unsigned int *timeleft UNNEEDED,
                                      struct score *score)
 {
        struct list_head *list;
index f54c6173a53578e76c6e805cf281ef7319a6c19a..1b741d4fd7c5c4b7aa0d77694023f42d4db04f35 100644 (file)
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <ctype.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";
@@ -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;
index 2af9afc00892a7561fdf92f6b514f777ef78c0b5..52a7e43c52b169dd7c3689dfafedfddf99c95a7d 100644 (file)
@@ -14,7 +14,8 @@
 #include <ccan/noerr/noerr.h>
 
 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;
 
index cb13a0b63e6a53933705d9e3370f9237d8243238..c33971e60de35906eab8bebf40dbba1610cb8b97 100644 (file)
@@ -15,7 +15,7 @@
 #include <ctype.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";
@@ -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;
index 403fff1a56120d31926359ca64af51afd3480732..9a2c0be5b4ccf2b36a59227f7c757c2477b41487 100644 (file)
@@ -14,7 +14,7 @@
 #include <string.h>
 #include <ctype.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";
@@ -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;
index 60ecee7962aae030b6570af27790b2a4c67ff7fd..74f759e7b30c2189e465c920046751ebf356fe3c 100644 (file)
@@ -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;
index d0bd7365dc7c52024975626c0e950a2a6e1d8e87..58f364373a5f63b5624cd0a55bf39d65bbcd931c 100644 (file)
@@ -15,7 +15,7 @@
 #include <ctype.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";
@@ -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;
 
index 1e99c100c1ce8725b4964d0e66b0d1f10c173854..083e7923ac8fca2ca34d39dfa960bb2209dc8fd2 100644 (file)
@@ -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;
index 4406842fd984d88fd802aee32e41c71f4ccf99e1..a32c0f6248346f1c63b7c643450a2c278e51f16f 100644 (file)
@@ -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",
index b46c85fcfef081c685c74f673436f12d39e9ab28..b49922b5d11b27b310b0b843870ee2be8310ed4a 100644 (file)
@@ -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;
index f6995085c4f08d42ebe9a5c2feb9037a676f08c4..0bafcc64e5ddb6124d956eb265c24fe62eff7ce9 100644 (file)
@@ -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;
index 69e01df6e909ee64c0501384dcc25291efe7afa3..24c4d8776ac241265f371767b1a4292e74f353e2 100644 (file)
@@ -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");
index 6384bd38421b3d10cf4a74c0c77a9d974f0a2433..0f728fb9420160b7bf852ce8210289056d59a163 100644 (file)
@@ -14,7 +14,7 @@
 #include <ctype.h>
 #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;
index 2f4df18b47e4382a3ea8d7032f78411fece3b536..700efeb94110cce2cbc6d636ebd9b4f8f790c972 100644 (file)
@@ -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;