summaryrefslogtreecommitdiff
path: root/fitz/filt_faxd.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-11 19:29:42 -0500
committerRobin Watts <robin.watts@artifex.com>2011-09-14 17:44:13 +0100
commit89ae81f651bfa112b8e07317eb6983beaf7cb212 (patch)
tree3f99dad1253b795629e66d45b915c1d72043242b /fitz/filt_faxd.c
parentcefb81f1886685580a40b17b5e495a8a8a1ebeaf (diff)
downloadmupdf-89ae81f651bfa112b8e07317eb6983beaf7cb212.tar.xz
Initial import of exception handling code
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
Diffstat (limited to 'fitz/filt_faxd.c')
-rw-r--r--fitz/filt_faxd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index dcf56cf3..d36c8c76 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -345,13 +345,13 @@ dec1d(fz_faxd *fax)
code = get_code(fax, cf_white_decode, cfd_white_initial_bits);
if (code == UNCOMPRESSED)
- return fz_throw("uncompressed data in faxd");
+ return fz_error_make("uncompressed data in faxd");
if (code < 0)
- return fz_throw("negative code in 1d faxd");
+ return fz_error_make("negative code in 1d faxd");
if (fax->a + code > fax->columns)
- return fz_throw("overflow in 1d faxd");
+ return fz_error_make("overflow in 1d faxd");
if (fax->c)
setbits(fax->dst, fax->a, fax->a + code);
@@ -386,13 +386,13 @@ dec2d(fz_faxd *fax)
code = get_code(fax, cf_white_decode, cfd_white_initial_bits);
if (code == UNCOMPRESSED)
- return fz_throw("uncompressed data in faxd");
+ return fz_error_make("uncompressed data in faxd");
if (code < 0)
- return fz_throw("negative code in 2d faxd");
+ return fz_error_make("negative code in 2d faxd");
if (fax->a + code > fax->columns)
- return fz_throw("overflow in 2d faxd");
+ return fz_error_make("overflow in 2d faxd");
if (fax->c)
setbits(fax->dst, fax->a, fax->a + code);
@@ -485,13 +485,13 @@ dec2d(fz_faxd *fax)
break;
case UNCOMPRESSED:
- return fz_throw("uncompressed data in faxd");
+ return fz_error_make("uncompressed data in faxd");
case ERROR:
- return fz_throw("invalid code in 2d faxd");
+ return fz_error_make("invalid code in 2d faxd");
default:
- return fz_throw("invalid code in 2d faxd (%d)", code);
+ return fz_error_make("invalid code in 2d faxd (%d)", code);
}
return 0;
@@ -560,14 +560,14 @@ loop:
fax->eolc = 0;
error = dec1d(fax);
if (error)
- return fz_rethrow(error, "cannot decode 1d code");
+ return fz_error_note(error, "cannot decode 1d code");
}
else if (fax->dim == 2)
{
fax->eolc = 0;
error = dec2d(fax);
if (error)
- return fz_rethrow(error, "cannot decode 2d code");
+ return fz_error_note(error, "cannot decode 2d code");
}
/* no eol check after makeup codes nor in the middle of an H code */