From 60c0544742931da63db623ad7a79ba3758704cc1 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 14 Nov 2011 16:42:43 +0000 Subject: Simplify fz_try/fz_catch by removing failed flag. The failed flag can be removed by having the fz_throw (and fz_rethrow) functions do the popping of the stack. --- fitz/base_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fitz/base_error.c') diff --git a/fitz/base_error.c b/fitz/base_error.c index 3ef69a60..b844fb6a 100644 --- a/fitz/base_error.c +++ b/fitz/base_error.c @@ -36,9 +36,9 @@ void fz_warn(fz_context *ctx, char *fmt, ...) static void throw(fz_error_context *ex) { - if (ex->top >= 0) - longjmp(ex->stack[ex->top].buffer, 1); - else { + if (ex->top >= 0) { + longjmp(ex->stack[ex->top--].buffer, 1); + } else { fprintf(stderr, "uncaught exception: %s\n", ex->message); exit(EXIT_FAILURE); } -- cgit v1.2.3