From: Rusty Russell Date: Mon, 29 Aug 2011 23:55:39 +0000 (+0930) Subject: tools: simplify get_safe_ccan_deps X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=6165b3afe402099a7473a1f518dc26ea3b74ee84;hp=9361a12f2fc1da0054faadbbdecaa341d0a6fc28 tools: simplify get_safe_ccan_deps There's no reason to hand in the name of the compiled _info file, since we don't compile it up in safe mode. --- diff --git a/tools/ccan_depends.c b/tools/ccan_depends.c index b055e44e..4dda6fa2 100644 --- a/tools/ccan_depends.c +++ b/tools/ccan_depends.c @@ -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) diff --git a/tools/ccanlint/compulsory_tests/depends_exist.c b/tools/ccanlint/compulsory_tests/depends_exist.c index b6be1f94..a90a7196 100644 --- a/tools/ccanlint/compulsory_tests/depends_exist.c +++ b/tools/ccanlint/compulsory_tests/depends_exist.c @@ -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); diff --git a/tools/depends.c b/tools/depends.c index 16f7cb69..efb42004 100644 --- a/tools/depends.c +++ b/tools/depends.c @@ -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); } diff --git a/tools/tools.h b/tools/tools.h index f08eb1dd..f3e132d9 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -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,