]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/avoids_cpp_reserved.c
ccanlint: handle nested modules when mentioned in examples.
[ccan] / tools / ccanlint / tests / avoids_cpp_reserved.c
index 68d4ad603b91479db6ff6b34acf35f473a02cf57..e094f270b1461bdfa80512e38b62fb9295719117 100644 (file)
@@ -36,7 +36,6 @@ static struct ccan_file *main_header(struct manifest *m)
 }
 
 static void check_headers_no_cpp(struct manifest *m,
-                                bool keep,
                                 unsigned int *timeleft, struct score *score)
 {
        char *contents;
@@ -44,8 +43,8 @@ static void check_headers_no_cpp(struct manifest *m,
        int fd;
        struct ccan_file *mainh = main_header(m);
 
-       tmpsrc = maybe_temp_file(m, "-included.c", keep, mainh->fullname);
-       tmpobj = maybe_temp_file(m, ".o", keep, tmpsrc);
+       tmpsrc = temp_file(m, "-included.c", mainh->fullname);
+       tmpobj = temp_file(m, ".o", tmpsrc);
 
        /* We don't fail you for this. */
        score->pass = true;
@@ -86,7 +85,7 @@ static void check_headers_no_cpp(struct manifest *m,
                   "#define using #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n"
                   "#define virtual #DONT_USE_CPLUSPLUS_RESERVED_NAMES\n"
                   "#include <ccan/%s/%s.h>\n",
-                                  m->basename, m->basename);
+                                  m->modname, m->basename);
        if (write(fd, contents, strlen(contents)) != strlen(contents))
                err(1, "writing to temporary file %s", tmpsrc);
        close(fd);