tools: simplify get_safe_ccan_deps
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Aug 2011 23:55:39 +0000 (09:25 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Aug 2011 23:55:39 +0000 (09:25 +0930)
There's no reason to hand in the name of the compiled _info file,
since we don't compile it up in safe mode.

tools/ccan_depends.c
tools/ccanlint/compulsory_tests/depends_exist.c
tools/depends.c
tools/tools.h

index b055e44eb1f53e1aee4c5e6f42731c195ce66555..4dda6fa274d65965daaceb4707b377b8bc1989ff 100644 (file)
@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
                                recurse, NULL);
        else
                deps = get_safe_ccan_deps(talloc_autofree_context(),
-                                         argv[1], recurse, NULL);
+                                         argv[1], recurse);
 
        for (i = 0; deps[i]; i++)
                if (strstarts(deps[i], "ccan/") == ccan)
index b6be1f94b91ddd47f50538caa862cc9d511f44ed..a90a7196e6172adabdabef1ea799baf3211b678c 100644 (file)
@@ -45,8 +45,7 @@ static void check_depends_exist(struct manifest *m,
                *strrchr(updir, '/') = '\0';
 
        if (safe_mode)
-               deps = get_safe_ccan_deps(m, m->dir, true,
-                                         &m->info_file->compiled);
+               deps = get_safe_ccan_deps(m, m->dir, true);
        else
                deps = get_deps(m, m->dir, true, &m->info_file->compiled);
 
index 16f7cb69777cf733f73dda0e2358b2d32308bfb6..efb42004324b5022d4858c2d5f8fe8aad04a0cbf 100644 (file)
@@ -255,11 +255,11 @@ char **get_deps(const void *ctx, const char *dir,
 }
 
 char **get_safe_ccan_deps(const void *ctx, const char *dir,
-                         bool recurse, char **infofile)
+                         bool recurse)
 {
        if (!recurse) {
                unsigned int num;
-               return get_one_safe_deps(ctx, dir, &num, infofile);
+               return get_one_safe_deps(ctx, dir, &num, NULL);
        }
-       return get_all_deps(ctx, dir, infofile, get_one_safe_deps);
+       return get_all_deps(ctx, dir, NULL, get_one_safe_deps);
 }
index f08eb1ddb0fad0ecc4ac644926b323cc26682eb4..f3e132d97a37110c92da61ba48d3f82e7c46f3e8 100644 (file)
@@ -24,8 +24,7 @@ char **get_deps(const void *ctx, const char *dir, bool recurse,
                char **infofile);
 
 /* This is safer: just looks for ccan/ strings in info */
-char **get_safe_ccan_deps(const void *ctx, const char *dir,
-                         bool recurse, char **infofile);
+char **get_safe_ccan_deps(const void *ctx, const char *dir, bool recurse);
 
 /* This also needs to compile the info file. */
 char **get_libs(const void *ctx, const char *dir,