From 2064b68718ea5f15de76d661ae1f307d67a0cf26 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 8 Dec 2014 22:39:07 +0100 Subject: with a few exceptions and some remaining files, never return directly on failure, always goto fail by invoking fail_if MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/process-includes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mds-kbdc/process-includes.c') diff --git a/src/mds-kbdc/process-includes.c b/src/mds-kbdc/process-includes.c index 57e0502..2faaf3f 100644 --- a/src/mds-kbdc/process-includes.c +++ b/src/mds-kbdc/process-includes.c @@ -242,8 +242,7 @@ static int process_include(mds_kbdc_tree_include_t* restrict tree) */ static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree) { -#define p(expr) if ((r = process_includes_in_tree(tree->expr))) return r - int r; +#define p(expr) fail_if (process_includes_in_tree(tree->expr)) again: if (tree == NULL) return 0; @@ -257,8 +256,7 @@ static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree) case C(FOR): p (for_.inner); break; case C(IF): p (if_.inner); p (if_.otherwise); break; case C(INCLUDE): - if ((r = process_include(&(tree->include)))) - return r; + fail_if (process_include(&(tree->include))); break; default: break; @@ -266,6 +264,8 @@ static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree) tree = tree->next; goto again; + fail: + return -1; #undef p } @@ -290,7 +290,7 @@ int process_includes(mds_kbdc_parsed_t* restrict result_) { struct stat* old; if (xxrealloc(old, included, included_size += 4, struct stat)) - return included = old, -1; + fail_if (included = old, 1); } for (i = 0; i < included_ptr; i++) -- cgit v1.2.3-70-g09d2