]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/file_analysis.c
ccanlint: keep separate array of compiled versions.
[ccan] / tools / ccanlint / file_analysis.c
index 7ce65479bde929cb3e036ff73514522a9f4cddad..91eb10a7253e5f1de93211bfd8ad4b890834d9c8 100644 (file)
@@ -81,11 +81,12 @@ struct ccan_file *new_ccan_file(const void *ctx, const char *dir, char *name)
        f->lines = NULL;
        f->line_info = NULL;
        f->doc_sections = NULL;
-       f->compiled = NULL;
+       f->compiled[COMPILE_NORMAL] = f->compiled[COMPILE_NOFEAT] = NULL;
        f->name = talloc_steal(f, name);
        f->fullname = talloc_asprintf(f, "%s/%s", dir, f->name);
        f->contents = NULL;
        f->cov_compiled = NULL;
+       f->simplified = NULL;
        return f;
 }
 
@@ -228,7 +229,7 @@ struct manifest *get_manifest(const void *ctx, const char *dir)
 
        m = talloc_linked(ctx, talloc(NULL, struct manifest));
        m->info_file = NULL;
-       m->compiled = NULL;
+       m->compiled[COMPILE_NORMAL] = m->compiled[COMPILE_NOFEAT] = NULL;
        m->dir = talloc_steal(m, canon_dir);
        list_head_init(&m->c_files);
        list_head_init(&m->h_files);
@@ -348,7 +349,7 @@ static char *remove_comments(const char *line, bool in_comment,
 
 static bool is_empty(const char *line)
 {
-       return strspn(line, " \t") == strlen(line);
+       return strspn(line, " \r\t") == strlen(line);
 }
 
 static bool continues(const char *line)