X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Freduce_features.c;h=34a897061bb4fbe16c69800bf699f930d753502b;hp=54c26f9736c6a96d3c49e6e0f50eb7379abcc5bb;hb=HEAD;hpb=dc8042b42500f79f613b1197df6cdf739615a89f diff --git a/tools/ccanlint/tests/reduce_features.c b/tools/ccanlint/tests/reduce_features.c index 54c26f97..34a89706 100644 --- a/tools/ccanlint/tests/reduce_features.c +++ b/tools/ccanlint/tests/reduce_features.c @@ -83,7 +83,7 @@ static struct htable_option *get_used_options(struct manifest *m) info = get_ccan_line_info(f); struct pp_conditions *prev = NULL; - for (i = 0; i < f->num_lines; i++) { + for (i = 0; f->lines[i]; i++) { if (info[i].cond && info[i].cond != prev) { num += add_options(opts, info[i].cond); prev = info[i].cond; @@ -130,7 +130,8 @@ static struct htable_option *get_config_options(struct manifest *m) } static void do_reduce_features(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct htable_option *options_used, *options_avail, *options; struct htable_option_iter i; @@ -180,6 +181,7 @@ static void do_reduce_features(struct manifest *m, err(1, "Creating reduced-features/config.h"); if (!write_all(fd, hdr, strlen(hdr))) err(1, "Writing reduced-features/config.h"); + htable_option_free(options); close(fd); features_were_reduced = true; }