Browse Source

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.
Rusty Russell 14 years ago
parent
commit
6165b3afe4
4 changed files with 6 additions and 8 deletions
  1. 1 1
      tools/ccan_depends.c
  2. 1 2
      tools/ccanlint/compulsory_tests/depends_exist.c
  3. 3 3
      tools/depends.c
  4. 1 2
      tools/tools.h

+ 1 - 1
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)

+ 1 - 2
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);
 

+ 3 - 3
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);
 }

+ 1 - 2
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,