From b8e538eceaaa203aeffbd97d053bcbc75646efbc Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 11 May 2012 20:13:47 -0500 Subject: [PATCH] main: use pkg_cflags() instead of custom code (issue #11) --- main.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index 0c7f0a8..5aa6672 100644 --- a/main.c +++ b/main.c @@ -110,17 +110,6 @@ print_fragment(pkg_fragment_t *frag) printf("%s ", frag->data); } -static void -collect_cflags(pkg_t *pkg, void *data, unsigned int flags) -{ - pkg_fragment_t **list = data; - pkg_fragment_t *frag; - (void) flags; - - PKG_FOREACH_LIST_ENTRY(pkg->cflags, frag) - *list = pkg_fragment_copy(*list, frag); -} - static void print_cflags(pkg_fragment_t *list) { @@ -406,10 +395,10 @@ pkg_queue_walk(pkg_queue_t *head) if (want_cflags) { - pkg_fragment_t *list = NULL; + pkg_fragment_t *list; wanted_something++; - pkg_traverse(&world, collect_cflags, &list, maximum_traverse_depth, global_traverse_flags | PKGF_SEARCH_PRIVATE); + list = pkg_cflags(&world, maximum_traverse_depth, global_traverse_flags | PKGF_SEARCH_PRIVATE); print_cflags(list); pkg_fragment_free(list);