diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-08 22:39:07 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-08 22:39:07 +0100 |
commit | 2064b68718ea5f15de76d661ae1f307d67a0cf26 (patch) | |
tree | 3b8f93932cb4a13ab6001f165de7714ec7e86848 /src/mds-kbdc/process-includes.c | |
parent | update the texinfo manual for the new use of fail_if (diff) | |
download | mds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.gz mds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.bz2 mds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.xz |
with a few exceptions and some remaining files, never return directly on failure, always goto fail by invoking fail_if
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/process-includes.c | 10 |
1 files changed, 5 insertions, 5 deletions
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++) |