]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/module_builds.c
ccanlint: Move ccanlint test options from _info comments to code
[ccan] / tools / ccanlint / tests / module_builds.c
index cffb84bce34038db9e62beeb933550e4ab6e5ab9..c33971e60de35906eab8bebf40dbba1610cb8b97 100644 (file)
@@ -1,7 +1,7 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
+#include <ccan/take/take.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -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";
@@ -24,14 +24,14 @@ static const char *can_build(struct manifest *m)
 
 static char *obj_list(const struct manifest *m, enum compile_type ctype)
 {
-       char *list = talloc_strdup(m, "");
+       char *list = tal_strdup(m, "");
        struct ccan_file *i;
 
        /* Objects from all the C files. */
-       list_for_each(&m->c_files, i, list)
-               list = talloc_asprintf_append(list, "%s ",
-                                             i->compiled[ctype]);
-
+       list_for_each(&m->c_files, i, list) {
+               list = tal_strcat(m, take(list), i->compiled[ctype]);
+               list = tal_strcat(m, take(list), " ");
+       }
        return list;
 }
 
@@ -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;
@@ -57,7 +57,7 @@ static void do_build(struct manifest *m,
        m->compiled[COMPILE_NORMAL]
                = build_module(m, COMPILE_NORMAL, &errstr);
        if (!m->compiled[COMPILE_NORMAL]) {
-               score_file_error(score, NULL, 0, "%s", errstr);
+               score_error(score, m->modname,"%s", errstr);
                return;
        }