summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-03-11 22:07:53 +0100
committerTor Andersson <tor@ghostscript.com>2009-03-11 22:07:53 +0100
commit2e04ad6b587c9a34d18819165152ace7657cf443 (patch)
tree61fcaf8afa4509a38fd3deab41ad100ad6939cbe /fitz
parent9f6a77c2d17128a44bf2fc9fead449a05354def5 (diff)
downloadmupdf-2e04ad6b587c9a34d18819165152ace7657cf443.tar.xz
Remove fz_outofmem constant.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/base_hash.c14
-rw-r--r--fitz/filt_a85d.c4
-rw-r--r--fitz/filt_a85e.c4
-rw-r--r--fitz/filt_ahxd.c4
-rw-r--r--fitz/filt_ahxe.c4
-rw-r--r--fitz/filt_arc4.c4
-rw-r--r--fitz/filt_dctd.c4
-rw-r--r--fitz/filt_dcte.c6
-rw-r--r--fitz/filt_faxd.c12
-rw-r--r--fitz/filt_faxe.c14
-rw-r--r--fitz/filt_flate.c8
-rw-r--r--fitz/filt_jbig2d.c6
-rw-r--r--fitz/filt_jpxd.c4
-rw-r--r--fitz/filt_lzwd.c4
-rw-r--r--fitz/filt_lzwe.c6
-rw-r--r--fitz/filt_null.c4
-rw-r--r--fitz/filt_pipeline.c6
-rw-r--r--fitz/filt_predict.c10
-rw-r--r--fitz/filt_rld.c4
-rw-r--r--fitz/filt_rle.c14
-rw-r--r--fitz/node_misc2.c32
-rw-r--r--fitz/node_optimize.c2
-rw-r--r--fitz/node_path.c40
-rw-r--r--fitz/node_text.c18
-rw-r--r--fitz/node_tree.c4
-rw-r--r--fitz/obj_array.c18
-rw-r--r--fitz/obj_dict.c22
-rw-r--r--fitz/obj_parse.c4
-rw-r--r--fitz/obj_simple.c20
-rw-r--r--fitz/res_font.c20
-rw-r--r--fitz/stm_buffer.c16
-rw-r--r--fitz/stm_filter.c2
-rw-r--r--fitz/stm_misc.c4
-rw-r--r--fitz/stm_open.c6
-rw-r--r--fitz/stm_read.c10
35 files changed, 177 insertions, 177 deletions
diff --git a/fitz/base_hash.c b/fitz/base_hash.c
index 894d33e0..1b817209 100644
--- a/fitz/base_hash.c
+++ b/fitz/base_hash.c
@@ -45,7 +45,7 @@ static unsigned hash(unsigned char *s, int len)
return hash;
}
-fz_error
+fz_error
fz_newhash(fz_hashtable **tablep, int initialsize, int keylen)
{
fz_hashtable *table;
@@ -54,7 +54,7 @@ fz_newhash(fz_hashtable **tablep, int initialsize, int keylen)
table = *tablep = fz_malloc(sizeof(fz_hashtable));
if (!table)
- return fz_throw("outofmem: hash table struct");
+ return fz_rethrow(-1, "out of memory: hash table struct");
table->keylen = keylen;
table->size = initialsize;
@@ -65,7 +65,7 @@ fz_newhash(fz_hashtable **tablep, int initialsize, int keylen)
{
fz_free(table);
*tablep = nil;
- return fz_throw("outofmem: hash table entries (size=%d)", initialsize);
+ return fz_rethrow(-1, "out of memory: hash table entries (size=%d)", initialsize);
}
memset(table->ents, 0, sizeof(fz_hashentry) * table->size);
@@ -105,7 +105,7 @@ fz_drophash(fz_hashtable *table)
fz_free(table);
}
-fz_error
+fz_error
fz_resizehash(fz_hashtable *table, int newsize)
{
fz_error error;
@@ -124,7 +124,7 @@ fz_resizehash(fz_hashtable *table, int newsize)
newents = fz_malloc(sizeof(fz_hashentry) * newsize);
if (!newents)
- return fz_throw("outofmem: hash table (size=%d)", newsize);
+ return fz_rethrow(-1, "out of memory: hash table (size=%d)", newsize);
table->size = newsize;
table->load = 0;
@@ -171,7 +171,7 @@ fz_hashfind(fz_hashtable *table, void *key)
}
}
-fz_error
+fz_error
fz_hashinsert(fz_hashtable *table, void *key, void *val)
{
fz_error error;
@@ -209,7 +209,7 @@ fz_hashinsert(fz_hashtable *table, void *key, void *val)
return fz_okay;
}
-fz_error
+fz_error
fz_hashremove(fz_hashtable *table, void *key)
{
fz_hashentry *ents = table->ents;
diff --git a/fitz/filt_a85d.c b/fitz/filt_a85d.c
index f064091c..8d485a3c 100644
--- a/fitz/filt_a85d.c
+++ b/fitz/filt_a85d.c
@@ -20,7 +20,7 @@ static inline int iswhite(int a)
return 0;
}
-fz_error
+fz_error
fz_newa85d(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_a85d, f, a85d);
@@ -34,7 +34,7 @@ fz_dropa85d(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processa85d(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_a85d *f = (fz_a85d*)filter;
diff --git a/fitz/filt_a85e.c b/fitz/filt_a85e.c
index 6b06cd77..e2450bb5 100644
--- a/fitz/filt_a85e.c
+++ b/fitz/filt_a85e.c
@@ -9,7 +9,7 @@ struct fz_a85e_s
int c;
};
-fz_error
+fz_error
fz_newa85e(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_a85e, f, a85e);
@@ -22,7 +22,7 @@ fz_dropa85e(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processa85e(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_a85e *f = (fz_a85e*)filter;
diff --git a/fitz/filt_ahxd.c b/fitz/filt_ahxd.c
index 56bc2aad..5e1fe17c 100644
--- a/fitz/filt_ahxd.c
+++ b/fitz/filt_ahxd.c
@@ -38,7 +38,7 @@ static inline int fromhex(int a)
return 0;
}
-fz_error
+fz_error
fz_newahxd(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_ahxd, f, ahxd);
@@ -52,7 +52,7 @@ fz_dropahxd(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processahxd(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_ahxd *f = (fz_ahxd*)filter;
diff --git a/fitz/filt_ahxe.c b/fitz/filt_ahxe.c
index 8ca5345b..ffa66b69 100644
--- a/fitz/filt_ahxe.c
+++ b/fitz/filt_ahxe.c
@@ -11,7 +11,7 @@ struct fz_ahxe_s
static const char tohex[16] = "0123456789ABCDEF";
-fz_error
+fz_error
fz_newahxe(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_ahxe, f, ahxe);
@@ -24,7 +24,7 @@ fz_dropahxe(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processahxe(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_ahxe *f = (fz_ahxe*)filter;
diff --git a/fitz/filt_arc4.c b/fitz/filt_arc4.c
index a5aa4fcc..d3832ec0 100644
--- a/fitz/filt_arc4.c
+++ b/fitz/filt_arc4.c
@@ -9,7 +9,7 @@ struct fz_arc4c_s
fz_arc4 arc4;
};
-fz_error
+fz_error
fz_newarc4filter(fz_filter **fp, unsigned char *key, unsigned keylen)
{
FZ_NEWFILTER(fz_arc4c, f, arc4filter);
@@ -22,7 +22,7 @@ fz_droparc4filter(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processarc4filter(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_arc4c *f = (fz_arc4c*)filter;
diff --git a/fitz/filt_dctd.c b/fitz/filt_dctd.c
index 5814c6ab..39e97a0d 100644
--- a/fitz/filt_dctd.c
+++ b/fitz/filt_dctd.c
@@ -48,7 +48,7 @@ static void myskipinput(j_decompress_ptr cinfo, long n)
src->super.next_input_byte = in->rp;
}
-fz_error
+fz_error
fz_newdctd(fz_filter **fp, fz_obj *params)
{
fz_error err;
@@ -112,7 +112,7 @@ fz_dropdctd(fz_filter *filter)
jpeg_destroy_decompress(&d->cinfo);
}
-fz_error
+fz_error
fz_processdctd(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_dctd *d = (fz_dctd*)filter;
diff --git a/fitz/filt_dcte.c b/fitz/filt_dcte.c
index 72422cbf..0949d9a9 100644
--- a/fitz/filt_dcte.c
+++ b/fitz/filt_dcte.c
@@ -29,7 +29,7 @@ static void myinitdest(j_compress_ptr cinfo) { /* empty */ }
static boolean myemptybuf(j_compress_ptr cinfo) { return FALSE; }
static void mytermdest(j_compress_ptr cinfo) { /* empty */ }
-fz_error
+fz_error
fz_newdcte(fz_filter **fp, fz_obj *params)
{
fz_error err;
@@ -155,7 +155,7 @@ static const unsigned char unzigzagorder[] =
#define unzigzag(x) (x)
#endif
-fz_error
+fz_error
fz_setquanttables(fz_dcte *e, unsigned int **qtables, int qfactor)
{
int i, j;
@@ -178,7 +178,7 @@ fz_setquanttables(fz_dcte *e, unsigned int **qtables, int qfactor)
return fz_okay;
}
-fz_error
+fz_error
fz_processdcte(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_dcte *e = (fz_dcte*)filter;
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index e0f35654..cc083138 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -41,7 +41,7 @@ struct fz_faxd_s
unsigned char *dst;
};
-fz_error
+fz_error
fz_newfaxd(fz_filter **fp, fz_obj *params)
{
fz_obj *obj;
@@ -95,7 +95,7 @@ fz_newfaxd(fz_filter **fp, fz_obj *params)
if (!fax->ref)
{
fz_free(fax);
- return fz_throw("outofmem: scanline buffer one");
+ return fz_rethrow(-1, "out of memory: scanline buffer one");
}
fax->dst = fz_malloc(fax->stride);
@@ -103,7 +103,7 @@ fz_newfaxd(fz_filter **fp, fz_obj *params)
{
fz_free(fax);
fz_free(fax->ref);
- return fz_throw("outofmem: scanline buffer two");
+ return fz_rethrow(-1, "out of memory: scanline buffer two");
}
memset(fax->ref, 0, fax->stride);
@@ -161,7 +161,7 @@ getcode(fz_faxd *fax, const cfd_node *table, int initialbits)
}
/* decode one 1d code */
-static fz_error
+static fz_error
dec1d(fz_faxd *fax)
{
int code;
@@ -200,7 +200,7 @@ dec1d(fz_faxd *fax)
}
/* decode one 2d code */
-static fz_error
+static fz_error
dec2d(fz_faxd *fax)
{
int code, b1, b2;
@@ -318,7 +318,7 @@ dec2d(fz_faxd *fax)
return 0;
}
-fz_error
+fz_error
fz_processfaxd(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
fz_faxd *fax = (fz_faxd*)f;
diff --git a/fitz/filt_faxe.c b/fitz/filt_faxe.c
index 3aa4f09a..db152ae5 100644
--- a/fitz/filt_faxe.c
+++ b/fitz/filt_faxe.c
@@ -31,7 +31,7 @@ struct fz_faxe_s
unsigned char *src;
};
-fz_error
+fz_error
fz_newfaxe(fz_filter **fp, fz_obj *params)
{
fz_obj *obj;
@@ -78,7 +78,7 @@ fz_newfaxe(fz_filter **fp, fz_obj *params)
if (!fax->ref)
{
fz_free(fax);
- return fz_throw("outofmemory: scanline buffer one");
+ return fz_rethrow(-1, "out of memoryory: scanline buffer one");
}
fax->src = fz_malloc(fax->stride);
@@ -86,7 +86,7 @@ fz_newfaxe(fz_filter **fp, fz_obj *params)
{
fz_free(fax);
fz_free(fax->ref);
- return fz_throw("outofmemory: scanline buffer two");
+ return fz_rethrow(-1, "out of memoryory: scanline buffer two");
}
memset(fax->ref, 0, fax->stride);
@@ -176,7 +176,7 @@ putrun(fz_faxe *fax, fz_buffer *out, int run, int c)
}
}
-static fz_error
+static fz_error
enc1d(fz_faxe *fax, unsigned char *line, fz_buffer *out)
{
int run;
@@ -200,7 +200,7 @@ enc1d(fz_faxe *fax, unsigned char *line, fz_buffer *out)
return fz_okay;
}
-static fz_error
+static fz_error
enc2d(fz_faxe *fax, unsigned char *ref, unsigned char *src, fz_buffer *out)
{
int a1, a2, b1, b2;
@@ -257,7 +257,7 @@ enc2d(fz_faxe *fax, unsigned char *ref, unsigned char *src, fz_buffer *out)
return fz_okay;
}
-static fz_error
+static fz_error
process(fz_faxe *fax, fz_buffer *in, fz_buffer *out)
{
fz_error error;
@@ -388,7 +388,7 @@ rtc:
return fz_iodone;
}
-fz_error
+fz_error
fz_processfaxe(fz_filter *p, fz_buffer *in, fz_buffer *out)
{
fz_faxe *fax = (fz_faxe*) p;
diff --git a/fitz/filt_flate.c b/fitz/filt_flate.c
index 65a84711..67158d5e 100644
--- a/fitz/filt_flate.c
+++ b/fitz/filt_flate.c
@@ -23,7 +23,7 @@ zfree(void *opaque, void *ptr)
fz_free(ptr);
}
-fz_error
+fz_error
fz_newflated(fz_filter **fp, fz_obj *params)
{
fz_error eo;
@@ -76,7 +76,7 @@ fz_dropflated(fz_filter *f)
fprintf(stderr, "inflateEnd: %s", zp->msg);
}
-fz_error
+fz_error
fz_processflated(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
z_streamp zp = &((fz_flate*)f)->z;
@@ -116,7 +116,7 @@ fz_processflated(fz_filter *f, fz_buffer *in, fz_buffer *out)
}
}
-fz_error
+fz_error
fz_newflatee(fz_filter **fp, fz_obj *params)
{
fz_obj *obj;
@@ -172,7 +172,7 @@ fz_dropflatee(fz_filter *f)
fz_free(f);
}
-fz_error
+fz_error
fz_processflatee(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
z_streamp zp = &((fz_flate*)f)->z;
diff --git a/fitz/filt_jbig2d.c b/fitz/filt_jbig2d.c
index 9dfeda61..0eece1fe 100644
--- a/fitz/filt_jbig2d.c
+++ b/fitz/filt_jbig2d.c
@@ -41,7 +41,7 @@ struct fz_jbig2d_s
int idx;
};
-fz_error
+fz_error
fz_newjbig2d(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_jbig2d, d, jbig2d);
@@ -58,7 +58,7 @@ fz_dropjbig2d(fz_filter *filter)
jbig2_ctx_free(d->ctx);
}
-fz_error
+fz_error
fz_setjbig2dglobalstream(fz_filter *filter, unsigned char *buf, int len)
{
fz_jbig2d *d = (fz_jbig2d*)filter;
@@ -68,7 +68,7 @@ fz_setjbig2dglobalstream(fz_filter *filter, unsigned char *buf, int len)
return fz_okay;
}
-fz_error
+fz_error
fz_processjbig2d(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_jbig2d *d = (fz_jbig2d*)filter;
diff --git a/fitz/filt_jpxd.c b/fitz/filt_jpxd.c
index eb940c93..c07f396c 100644
--- a/fitz/filt_jpxd.c
+++ b/fitz/filt_jpxd.c
@@ -34,7 +34,7 @@ struct fz_jpxd_s
int stage;
};
-fz_error
+fz_error
fz_newjpxd(fz_filter **fp, fz_obj *params)
{
int err;
@@ -70,7 +70,7 @@ fz_dropjpxd(fz_filter *filter)
if (d->image) jas_image_destroy(d->image);
}
-fz_error
+fz_error
fz_processjpxd(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_jpxd *d = (fz_jpxd*)filter;
diff --git a/fitz/filt_lzwd.c b/fitz/filt_lzwd.c
index 07bdddc8..9edffa71 100644
--- a/fitz/filt_lzwd.c
+++ b/fitz/filt_lzwd.c
@@ -42,7 +42,7 @@ struct fz_lzwd_s
lzw_code table[NUMCODES];
};
-fz_error
+fz_error
fz_newlzwd(fz_filter **fp, fz_obj *params)
{
int i;
@@ -117,7 +117,7 @@ static inline void unstuff(fz_lzwd *lzw, fz_buffer *in)
in->rp --;
}
-fz_error
+fz_error
fz_processlzwd(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_lzwd *lzw = (fz_lzwd*)filter;
diff --git a/fitz/filt_lzwe.c b/fitz/filt_lzwe.c
index a20043c0..6b271dfa 100644
--- a/fitz/filt_lzwe.c
+++ b/fitz/filt_lzwe.c
@@ -55,7 +55,7 @@ clearhash(fz_lzwe *lzw)
lzw->table[i].hash = -1;
}
-fz_error
+fz_error
fz_newlzwe(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_lzwe, lzw, lzwe);
@@ -128,7 +128,7 @@ putcode(fz_lzwe *lzw, fz_buffer *out, int code)
}
-static fz_error
+static fz_error
compress(fz_lzwe *lzw, fz_buffer *in, fz_buffer *out)
{
if (lzw->resume)
@@ -242,7 +242,7 @@ eof:
return fz_iodone;
}
-fz_error
+fz_error
fz_processlzwe(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_lzwe *lzw = (fz_lzwe*)filter;
diff --git a/fitz/filt_null.c b/fitz/filt_null.c
index 955354b1..ff19f64e 100644
--- a/fitz/filt_null.c
+++ b/fitz/filt_null.c
@@ -10,7 +10,7 @@ struct fz_nullfilter_s
int cur;
};
-fz_error
+fz_error
fz_newnullfilter(fz_filter **fp, int len)
{
FZ_NEWFILTER(fz_nullfilter, f, nullfilter);
@@ -24,7 +24,7 @@ fz_dropnullfilter(fz_filter *f)
{
}
-fz_error
+fz_error
fz_processnullfilter(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_nullfilter *f = (fz_nullfilter*)filter;
diff --git a/fitz/filt_pipeline.c b/fitz/filt_pipeline.c
index 33609a4a..fc4ccd22 100644
--- a/fitz/filt_pipeline.c
+++ b/fitz/filt_pipeline.c
@@ -16,7 +16,7 @@ struct fz_pipeline_s
int tailneedsin;
};
-fz_error
+fz_error
fz_chainpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail, fz_buffer *buf)
{
FZ_NEWFILTER(fz_pipeline, p, pipeline);
@@ -38,7 +38,7 @@ fz_unchainpipeline(fz_filter *filter, fz_filter **oldfp, fz_buffer **oldbp)
fz_dropfilter(filter);
}
-fz_error
+fz_error
fz_newpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail)
{
fz_error error;
@@ -67,7 +67,7 @@ fz_droppipeline(fz_filter *filter)
fz_dropbuffer(p->buffer);
}
-fz_error
+fz_error
fz_processpipeline(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_pipeline *p = (fz_pipeline*)filter;
diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c
index fc1bf1ea..1286ec08 100644
--- a/fitz/filt_predict.c
+++ b/fitz/filt_predict.c
@@ -23,7 +23,7 @@ struct fz_predict_s
int encode;
};
-fz_error
+fz_error
fz_newpredict(fz_filter **fp, fz_obj *params, int encode)
{
fz_obj *obj;
@@ -58,7 +58,7 @@ fz_newpredict(fz_filter **fp, fz_obj *params, int encode)
if (!p->ref)
{
fz_free(p);
- return fz_throw("outofmem: scanline buffer");
+ return fz_rethrow(-1, "out of memory: scanline buffer");
}
memset(p->ref, 0, p->stride);
}
@@ -187,7 +187,7 @@ png(fz_predict *p, unsigned char *in, unsigned char *out, int predictor)
}
}
-fz_error
+fz_error
fz_processpredict(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_predict *dec = (fz_predict*)filter;
@@ -240,13 +240,13 @@ fz_processpredict(fz_filter *filter, fz_buffer *in, fz_buffer *out)
}
}
-fz_error
+fz_error
fz_newpredictd(fz_filter **fp, fz_obj *params)
{
return fz_newpredict(fp, params, 0);
}
-fz_error
+fz_error
fz_newpredicte(fz_filter **fp, fz_obj *params)
{
return fz_newpredict(fp, params, 1);
diff --git a/fitz/filt_rld.c b/fitz/filt_rld.c
index 734c7005..8f3b842f 100644
--- a/fitz/filt_rld.c
+++ b/fitz/filt_rld.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error
+fz_error
fz_newrld(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_filter, f, rld);
@@ -13,7 +13,7 @@ fz_droprld(fz_filter *rld)
{
}
-fz_error
+fz_error
fz_processrld(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
int run, i;
diff --git a/fitz/filt_rle.c b/fitz/filt_rle.c
index 2dfdb91d..65c6c0e8 100644
--- a/fitz/filt_rle.c
+++ b/fitz/filt_rle.c
@@ -28,7 +28,7 @@ enum {
END
};
-fz_error
+fz_error
fz_newrle(fz_filter **fp, fz_obj *params)
{
FZ_NEWFILTER(fz_rle, enc, rle);
@@ -50,7 +50,7 @@ fz_droprle(fz_filter *enc)
{
}
-static fz_error
+static fz_error
putone(fz_rle *enc, fz_buffer *in, fz_buffer *out)
{
if (out->wp + 2 >= out->ep)
@@ -66,7 +66,7 @@ fprintf(stderr, "one '%c'\n", enc->buf[0]);
return fz_okay;
}
-static fz_error
+static fz_error
putsame(fz_rle *enc, fz_buffer *in, fz_buffer *out)
{
if (out->wp + enc->run >= out->ep)
@@ -81,7 +81,7 @@ fprintf(stderr, "same %d x '%c'\n", enc->run, enc->buf[0]);
return fz_okay;
}
-static fz_error
+static fz_error
putdiff(fz_rle *enc, fz_buffer *in, fz_buffer *out)
{
int i;
@@ -98,7 +98,7 @@ fprintf(stderr, "diff %d\n", enc->run);
return fz_okay;
}
-static fz_error
+static fz_error
puteod(fz_rle *enc, fz_buffer *in, fz_buffer *out)
{
if (out->wp + 1 >= out->ep)
@@ -112,7 +112,7 @@ fprintf(stderr, "eod\n");
return fz_okay;
}
-static fz_error
+static fz_error
savebuf(fz_rle *enc, fz_buffer *in, fz_buffer *out)
{
switch (enc->state)
@@ -126,7 +126,7 @@ savebuf(fz_rle *enc, fz_buffer *in, fz_buffer *out)
}
}
-fz_error
+fz_error
fz_processrle(fz_filter *filter, fz_buffer *in, fz_buffer *out)
{
fz_rle *enc = (fz_rle*)filter;
diff --git a/fitz/node_misc2.c b/fitz/node_misc2.c
index 17ab63c3..c26fc908 100644
--- a/fitz/node_misc2.c
+++ b/fitz/node_misc2.c
@@ -5,14 +5,14 @@
* Over
*/
-fz_error
+fz_error
fz_newovernode(fz_node **nodep)
{
fz_node *node;
node = *nodep = fz_malloc(sizeof (fz_overnode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode(node, FZ_NOVER);
@@ -47,14 +47,14 @@ fz_boundovernode(fz_overnode *node, fz_matrix ctm)
* Mask
*/
-fz_error
+fz_error
fz_newmasknode(fz_node **nodep)
{
fz_node *node;
node = *nodep = fz_malloc(sizeof (fz_masknode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode(node, FZ_NMASK);
@@ -80,14 +80,14 @@ fz_boundmasknode(fz_masknode *node, fz_matrix ctm)
* Blend
*/
-fz_error
+fz_error
fz_newblendnode(fz_node **nodep, fz_blendkind b, int k, int i)
{
fz_blendnode *node;
node = fz_malloc(sizeof (fz_blendnode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NBLEND);
@@ -132,14 +132,14 @@ fz_dropblendnode(fz_blendnode *node)
* Transform
*/
-fz_error
+fz_error
fz_newtransformnode(fz_node **nodep, fz_matrix m)
{
fz_transformnode *node;
node = fz_malloc(sizeof (fz_transformnode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NTRANSFORM);
@@ -160,14 +160,14 @@ fz_boundtransformnode(fz_transformnode *node, fz_matrix ctm)
* Link to tree
*/
-fz_error
+fz_error
fz_newlinknode(fz_node **nodep, fz_tree *subtree)
{
fz_linknode *node;
node = fz_malloc(sizeof (fz_linknode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NLINK);
@@ -192,7 +192,7 @@ fz_boundlinknode(fz_linknode *node, fz_matrix ctm)
* Solid color
*/
-fz_error
+fz_error
fz_newsolidnode(fz_node **nodep, float a, fz_colorspace *cs, int n, float *v)
{
fz_solidnode *node;
@@ -200,7 +200,7 @@ fz_newsolidnode(fz_node **nodep, float a, fz_colorspace *cs, int n, float *v)
node = fz_malloc(sizeof(fz_solidnode) + sizeof(float) * n);
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NCOLOR);
@@ -229,14 +229,14 @@ fz_dropsolidnode(fz_solidnode *node)
* Image node
*/
-fz_error
+fz_error
fz_newimagenode(fz_node **nodep, fz_image *image)
{
fz_imagenode *node;
node = fz_malloc(sizeof (fz_imagenode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NIMAGE);
@@ -266,14 +266,14 @@ fz_boundimagenode(fz_imagenode *node, fz_matrix ctm)
* Shade node
*/
-fz_error
+fz_error
fz_newshadenode(fz_node **nodep, fz_shade *shade)
{
fz_shadenode *node;
node = fz_malloc(sizeof (fz_shadenode));
if (!node)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
*nodep = (fz_node*)node;
fz_initnode((fz_node*)node, FZ_NSHADE);
diff --git a/fitz/node_optimize.c b/fitz/node_optimize.c
index 0d173efe..056fc782 100644
--- a/fitz/node_optimize.c
+++ b/fitz/node_optimize.c
@@ -222,7 +222,7 @@ retry:
*
*/
-fz_error
+fz_error
fz_optimizetree(fz_tree *tree)
{
if (getenv("DONTOPT"))
diff --git a/fitz/node_path.c b/fitz/node_path.c
index 8cd54300..a72b373d 100644
--- a/fitz/node_path.c
+++ b/fitz/node_path.c
@@ -1,14 +1,14 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error
+fz_error
fz_newpathnode(fz_pathnode **pathp)
{
fz_pathnode *path;
path = *pathp = fz_malloc(sizeof(fz_pathnode));
if (!path)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode((fz_node*)path, FZ_NPATH);
@@ -25,14 +25,14 @@ fz_newpathnode(fz_pathnode **pathp)
return fz_okay;
}
-fz_error
+fz_error
fz_clonepathnode(fz_pathnode **pathp, fz_pathnode *oldpath)
{
fz_pathnode *path;
path = *pathp = fz_malloc(sizeof(fz_pathnode));
if (!path)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode((fz_node*)path, FZ_NPATH);
@@ -48,7 +48,7 @@ fz_clonepathnode(fz_pathnode **pathp, fz_pathnode *oldpath)
path->els = fz_malloc(sizeof (fz_pathel) * path->len);
if (!path->els) {
fz_free(path);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
memcpy(path->els, oldpath->els, sizeof(fz_pathel) * path->len);
@@ -62,7 +62,7 @@ fz_droppathnode(fz_pathnode *node)
fz_free(node->els);
}
-static fz_error
+static fz_error
growpath(fz_pathnode *path, int n)
{
int newcap;
@@ -73,7 +73,7 @@ growpath(fz_pathnode *path, int n)
newcap = path->cap + 36;
newels = fz_realloc(path->els, sizeof (fz_pathel) * newcap);
if (!newels)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
path->cap = newcap;
path->els = newels;
}
@@ -81,36 +81,36 @@ growpath(fz_pathnode *path, int n)
return fz_okay;
}
-fz_error
+fz_error
fz_moveto(fz_pathnode *path, float x, float y)
{
if (growpath(path, 3) != nil)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
path->els[path->len++].k = FZ_MOVETO;
path->els[path->len++].v = x;
path->els[path->len++].v = y;
return fz_okay;
}
-fz_error
+fz_error
fz_lineto(fz_pathnode *path, float x, float y)
{
if (growpath(path, 3) != nil)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
path->els[path->len++].k = FZ_LINETO;
path->els[path->len++].v = x;
path->els[path->len++].v = y;
return fz_okay;
}
-fz_error
+fz_error
fz_curveto(fz_pathnode *path,
float x1, float y1,
float x2, float y2,
float x3, float y3)
{
if (growpath(path, 7) != nil)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
path->els[path->len++].k = FZ_CURVETO;
path->els[path->len++].v = x1;
path->els[path->len++].v = y1;
@@ -121,7 +121,7 @@ fz_curveto(fz_pathnode *path,
return fz_okay;
}
-fz_error
+fz_error
fz_curvetov(fz_pathnode *path, float x2, float y2, float x3, float y3)
{
float x1 = path->els[path->len-2].v;
@@ -129,22 +129,22 @@ fz_curvetov(fz_pathnode *path, float x2, float y2, float x3, float y3)
return fz_curveto(path, x1, y1, x2, y2, x3, y3);
}
-fz_error
+fz_error
fz_curvetoy(fz_pathnode *path, float x1, float y1, float x3, float y3)
{
return fz_curveto(path, x1, y1, x3, y3, x3, y3);
}
-fz_error
+fz_error
fz_closepath(fz_pathnode *path)
{
if (growpath(path, 1) != nil)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
path->els[path->len++].k = FZ_CLOSEPATH;
return fz_okay;
}
-fz_error
+fz_error
fz_endpath(fz_pathnode *path, fz_pathkind paint, fz_stroke *stroke, fz_dash *dash)
{
if (path->len == 0)
@@ -321,7 +321,7 @@ fz_debugpathnode(fz_pathnode *path, int indent)
}
}
-fz_error
+fz_error
fz_newdash(fz_dash **dashp, float phase, int len, float *array)
{
fz_dash *dash;
@@ -329,7 +329,7 @@ fz_newdash(fz_dash **dashp, float phase, int len, float *array)
dash = *dashp = fz_malloc(sizeof(fz_dash) + sizeof(float) * len);
if (!dash)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
dash->len = len;
dash->phase = phase;
diff --git a/fitz/node_text.c b/fitz/node_text.c
index 5abca20a..fda8d577 100644
--- a/fitz/node_text.c
+++ b/fitz/node_text.c
@@ -1,14 +1,14 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error
+fz_error
fz_newtextnode(fz_textnode **textp, fz_font *font)
{
fz_textnode *text;
text = fz_malloc(sizeof(fz_textnode));
if (!text)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode((fz_node*)text, FZ_NTEXT);
@@ -22,14 +22,14 @@ fz_newtextnode(fz_textnode **textp, fz_font *font)
return fz_okay;
}
-fz_error
+fz_error
fz_clonetextnode(fz_textnode **textp, fz_textnode *oldtext)
{
fz_textnode *text;
text = *textp = fz_malloc(sizeof(fz_textnode));
if (!text)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
fz_initnode((fz_node*)text, FZ_NTEXT);
@@ -44,7 +44,7 @@ fz_clonetextnode(fz_textnode **textp, fz_textnode *oldtext)
{
fz_dropfont(text->font);
fz_free(text);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
memcpy(text->els, oldtext->els, sizeof(fz_textel) * text->len);
@@ -109,7 +109,7 @@ fz_boundtextnode(fz_textnode *text, fz_matrix ctm)
return bbox;
}
-static fz_error
+static fz_error
growtext(fz_textnode *text, int n)
{
int newcap;
@@ -120,7 +120,7 @@ growtext(fz_textnode *text, int n)
newcap = text->cap + 36;
newels = fz_realloc(text->els, sizeof (fz_textel) * newcap);
if (!newels)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
text->cap = newcap;
text->els = newels;
}
@@ -128,11 +128,11 @@ growtext(fz_textnode *text, int n)
return fz_okay;
}
-fz_error
+fz_error
fz_addtext(fz_textnode *text, int gid, int ucs, float x, float y)
{
if (growtext(text, 1) != nil)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
text->els[text->len].ucs = ucs;
text->els[text->len].gid = gid;
text->els[text->len].x = x;
diff --git a/fitz/node_tree.c b/fitz/node_tree.c
index 9e75b8aa..6dc035e1 100644
--- a/fitz/node_tree.c
+++ b/fitz/node_tree.c
@@ -1,14 +1,14 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error
+fz_error
fz_newtree(fz_tree **treep)
{
fz_tree *tree;
tree = *treep = fz_malloc(sizeof (fz_tree));
if (!tree)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
tree->refs = 1;
tree->root = nil;
diff --git a/fitz/obj_array.c b/fitz/obj_array.c
index ce0309eb..fcd0edc7 100644
--- a/fitz/obj_array.c
+++ b/fitz/obj_array.c
@@ -3,7 +3,7 @@
void fz_droparray(fz_obj *obj);
-fz_error
+fz_error
fz_newarray(fz_obj **op, int initialcap)
{
fz_obj *obj;
@@ -11,7 +11,7 @@ fz_newarray(fz_obj **op, int initialcap)
obj = *op = fz_malloc(sizeof (fz_obj));
if (!obj)
- return fz_throw("outofmem: array struct");
+ return fz_rethrow(-1, "out of memory: array struct");
obj->refs = 1;
obj->kind = FZ_ARRAY;
@@ -23,7 +23,7 @@ fz_newarray(fz_obj **op, int initialcap)
if (!obj->u.a.items)
{
fz_free(obj);
- return fz_throw("outofmem: array item buffer");
+ return fz_rethrow(-1, "out of memory: array item buffer");
}
for (i = 0; i < obj->u.a.cap; i++)
@@ -32,7 +32,7 @@ fz_newarray(fz_obj **op, int initialcap)
return fz_okay;
}
-fz_error
+fz_error
fz_copyarray(fz_obj **op, fz_obj *obj)
{
fz_error error;
@@ -61,7 +61,7 @@ fz_copyarray(fz_obj **op, fz_obj *obj)
return fz_okay;
}
-fz_error
+fz_error
fz_deepcopyarray(fz_obj **op, fz_obj *obj)
{
fz_error error;
@@ -155,7 +155,7 @@ fz_arrayget(fz_obj *obj, int i)
return obj->u.a.items[i];
}
-fz_error
+fz_error
fz_arrayput(fz_obj *obj, int i, fz_obj *item)
{
if (!fz_isarray(obj))
@@ -172,7 +172,7 @@ fz_arrayput(fz_obj *obj, int i, fz_obj *item)
return fz_okay;
}
-static fz_error
+static fz_error
growarray(fz_obj *obj)
{
fz_obj **newitems;
@@ -182,7 +182,7 @@ growarray(fz_obj *obj)
newcap = obj->u.a.cap * 2;
newitems = fz_realloc(obj->u.a.items, sizeof (fz_obj*) * newcap);
if (!newitems)
- return fz_throw("outofmem: resize item buffer");
+ return fz_rethrow(-1, "out of memory: resize item buffer");
obj->u.a.items = newitems;
for (i = obj->u.a.cap ; i < newcap; i++)
@@ -192,7 +192,7 @@ growarray(fz_obj *obj)
return fz_okay;
}
-fz_error
+fz_error
fz_arraypush(fz_obj *obj, fz_obj *item)
{
fz_error error;
diff --git a/fitz/obj_dict.c b/fitz/obj_dict.c
index 6493baf3..c956fa4d 100644
--- a/fitz/obj_dict.c
+++ b/fitz/obj_dict.c
@@ -23,7 +23,7 @@ static inline int keystrcmp(fz_obj *key, char *s)
return -1;
}
-fz_error
+fz_error
fz_newdict(fz_obj **op, int initialcap)
{
fz_obj *obj;
@@ -31,7 +31,7 @@ fz_newdict(fz_obj **op, int initialcap)
obj = *op = fz_malloc(sizeof (fz_obj));
if (!obj)
- return fz_throw("outofmem: dict struct");
+ return fz_rethrow(-1, "out of memory: dict struct");
obj->refs = 1;
obj->kind = FZ_DICT;
@@ -44,7 +44,7 @@ fz_newdict(fz_obj **op, int initialcap)
if (!obj->u.d.items)
{
fz_free(obj);
- return fz_throw("outofmem: dict item buffer");
+ return fz_rethrow(-1, "out of memory: dict item buffer");
}
for (i = 0; i < obj->u.d.cap; i++)
@@ -56,7 +56,7 @@ fz_newdict(fz_obj **op, int initialcap)
return fz_okay;
}
-fz_error
+fz_error
fz_copydict(fz_obj **op, fz_obj *obj)
{
fz_error error;
@@ -84,7 +84,7 @@ fz_copydict(fz_obj **op, fz_obj *obj)
return fz_okay;
}
-fz_error
+fz_error
fz_deepcopydict(fz_obj **op, fz_obj *obj)
{
fz_error error;
@@ -154,7 +154,7 @@ fz_deepcopydict(fz_obj **op, fz_obj *obj)
return fz_okay;
}
-static fz_error
+static fz_error
growdict(fz_obj *obj)
{
fz_keyval *newitems;
@@ -165,7 +165,7 @@ growdict(fz_obj *obj)
newitems = fz_realloc(obj->u.d.items, sizeof(fz_keyval) * newcap);
if (!newitems)
- return fz_throw("outofmem: resize item buffer");
+ return fz_rethrow(-1, "out of memory: resize item buffer");
obj->u.d.items = newitems;
for (i = obj->u.d.cap; i < newcap; i++)
@@ -275,7 +275,7 @@ fz_dictgetsa(fz_obj *obj, char *key, char *abbrev)
return fz_dictgets(obj, abbrev);
}
-fz_error
+fz_error
fz_dictput(fz_obj *obj, fz_obj *key, fz_obj *val)
{
fz_error error;
@@ -319,7 +319,7 @@ fz_dictput(fz_obj *obj, fz_obj *key, fz_obj *val)
return fz_okay;
}
-fz_error
+fz_error
fz_dictputs(fz_obj *obj, char *key, fz_obj *val)
{
fz_error error;
@@ -334,7 +334,7 @@ fz_dictputs(fz_obj *obj, char *key, fz_obj *val)
return fz_okay;
}
-fz_error
+fz_error
fz_dictdels(fz_obj *obj, char *key)
{
int i;
@@ -355,7 +355,7 @@ fz_dictdels(fz_obj *obj, char *key)
return fz_okay;
}
-fz_error
+fz_error
fz_dictdel(fz_obj *obj, fz_obj *key)
{
if (fz_isname(key))
diff --git a/fitz/obj_parse.c b/fitz/obj_parse.c
index 1a063223..ba60f5eb 100644
--- a/fitz/obj_parse.c
+++ b/fitz/obj_parse.c
@@ -465,7 +465,7 @@ static fz_error parseobj(fz_obj **obj, char **sp, struct vap *v)
return error; /* already rethrown */
}
-fz_error
+fz_error
fz_packobj(fz_obj **op, char *fmt, ...)
{
fz_error error;
@@ -484,7 +484,7 @@ fz_packobj(fz_obj **op, char *fmt, ...)
return fz_okay;
}
-fz_error
+fz_error
fz_parseobj(fz_obj **op, char *str)
{
return parseobj(op, &str, nil);
diff --git a/fitz/obj_simple.c b/fitz/obj_simple.c
index 2e664625..320d085d 100644
--- a/fitz/obj_simple.c
+++ b/fitz/obj_simple.c
@@ -7,18 +7,18 @@ extern void fz_dropdict(fz_obj *dict);
#define NEWOBJ(KIND,SIZE) \
fz_obj *o; \
o = *op = fz_malloc(SIZE); \
- if (!o) return fz_throw("outofmem: dynamic object"); \
+ if (!o) return fz_rethrow(-1, "out of memory: dynamic object"); \
o->refs = 1; \
o->kind = KIND;
-fz_error
+fz_error
fz_newnull(fz_obj **op)
{
NEWOBJ(FZ_NULL, sizeof (fz_obj));
return fz_okay;
}
-fz_error
+fz_error
fz_newbool(fz_obj **op, int b)
{
NEWOBJ(FZ_BOOL, sizeof (fz_obj));
@@ -26,7 +26,7 @@ fz_newbool(fz_obj **op, int b)
return fz_okay;
}
-fz_error
+fz_error
fz_newint(fz_obj **op, int i)
{
NEWOBJ(FZ_INT, sizeof (fz_obj));
@@ -34,7 +34,7 @@ fz_newint(fz_obj **op, int i)
return fz_okay;
}
-fz_error
+fz_error
fz_newreal(fz_obj **op, float f)
{
NEWOBJ(FZ_REAL, sizeof (fz_obj));
@@ -42,7 +42,7 @@ fz_newreal(fz_obj **op, float f)
return fz_okay;
}
-fz_error
+fz_error
fz_newstring(fz_obj **op, char *str, int len)
{
NEWOBJ(FZ_STRING, offsetof(fz_obj, u.s.buf) + len + 1);
@@ -52,7 +52,7 @@ fz_newstring(fz_obj **op, char *str, int len)
return fz_okay;
}
-fz_error
+fz_error
fz_newname(fz_obj **op, char *str)
{
NEWOBJ(FZ_NAME, offsetof(fz_obj, u.n) + strlen(str) + 1);
@@ -60,7 +60,7 @@ fz_newname(fz_obj **op, char *str)
return fz_okay;
}
-fz_error
+fz_error
fz_newindirect(fz_obj **op, int objid, int genid)
{
NEWOBJ(FZ_INDIRECT, sizeof (fz_obj));
@@ -69,7 +69,7 @@ fz_newindirect(fz_obj **op, int objid, int genid)
return fz_okay;
}
-fz_error
+fz_error
fz_newpointer(fz_obj **op, void *p)
{
NEWOBJ(FZ_POINTER, sizeof (fz_obj));
@@ -236,7 +236,7 @@ fz_topointer(fz_obj *obj)
return fz_okay;
}
-fz_error
+fz_error
fz_newnamefromstring(fz_obj **op, fz_obj *str)
{
NEWOBJ(FZ_NAME, offsetof(fz_obj, u.n) + fz_tostrlen(str) + 1);
diff --git a/fitz/res_font.c b/fitz/res_font.c
index 1261f2c4..00bb10d4 100644
--- a/fitz/res_font.c
+++ b/fitz/res_font.c
@@ -105,7 +105,7 @@ char *ft_errorstring(int err)
return "Unknown error";
}
-static fz_error
+static fz_error
fz_initfreetype(void)
{
int code;
@@ -125,7 +125,7 @@ fz_initfreetype(void)
return fz_okay;
}
-fz_error
+fz_error
fz_newfontfromfile(fz_font **fontp, char *path, int index)
{
fz_error error;
@@ -138,7 +138,7 @@ fz_newfontfromfile(fz_font **fontp, char *path, int index)
font = fz_newfont();
if (!font)
- return fz_throw("outofmem: font struct");
+ return fz_rethrow(-1, "out of memory: font struct");
code = FT_New_Face(fz_ftlib, path, index, (FT_Face*)&font->ftface);
if (code)
@@ -151,7 +151,7 @@ fz_newfontfromfile(fz_font **fontp, char *path, int index)
return fz_okay;
}
-fz_error
+fz_error
fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index)
{
fz_error error;
@@ -164,7 +164,7 @@ fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index)
font = fz_newfont();
if (!font)
- return fz_throw("outofmem: font struct");
+ return fz_rethrow(-1, "out of memory: font struct");
code = FT_New_Memory_Face(fz_ftlib, data, len, index, (FT_Face*)&font->ftface);
if (code)
@@ -177,7 +177,7 @@ fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index)
return fz_okay;
}
-fz_error
+fz_error
fz_renderftglyph(fz_glyph *glyph, fz_font *font, int gid, fz_matrix trm)
{
FT_Face face = font->ftface;
@@ -299,7 +299,7 @@ fz_renderftglyph(fz_glyph *glyph, fz_font *font, int gid, fz_matrix trm)
* Type 3 fonts...
*/
-fz_error
+fz_error
fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix)
{
fz_font *font;
@@ -307,13 +307,13 @@ fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix)
font = fz_newfont();
if (!font)
- return fz_throw("outofmem: font struct");
+ return fz_rethrow(-1, "out of memory: font struct");
font->t3procs = fz_malloc(sizeof(fz_tree*) * 256);
if (!font->t3procs)
{
fz_free(font);
- return fz_throw("outofmem: type3 font charproc array");
+ return fz_rethrow(-1, "out of memory: type3 font charproc array");
}
font->t3matrix = matrix;
@@ -326,7 +326,7 @@ fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix)
return fz_okay;
}
-fz_error
+fz_error
fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int gid, fz_matrix trm)
{
fz_error error;
diff --git a/fitz/stm_buffer.c b/fitz/stm_buffer.c
index 128d6e8e..102d7327 100644
--- a/fitz/stm_buffer.c
+++ b/fitz/stm_buffer.c
@@ -1,14 +1,14 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error
+fz_error
fz_newbuffer(fz_buffer **bp, int size)
{
fz_buffer *b;
b = *bp = fz_malloc(sizeof(fz_buffer));
if (!b)
- return fz_throw("outofmem: buffer struct");
+ return fz_rethrow(-1, "out of memory: buffer struct");
b->refs = 1;
b->ownsdata = 1;
@@ -16,7 +16,7 @@ fz_newbuffer(fz_buffer **bp, int size)
if (!b->bp)
{
fz_free(b);
- return fz_throw("outofmem: buffer memory");
+ return fz_rethrow(-1, "out of memory: buffer memory");
}
b->rp = b->bp;
@@ -27,14 +27,14 @@ fz_newbuffer(fz_buffer **bp, int size)
return fz_okay;
}
-fz_error
+fz_error
fz_newbufferwithmemory(fz_buffer **bp, unsigned char *data, int size)
{
fz_buffer *b;
b = *bp = fz_malloc(sizeof(fz_buffer));
if (!b)
- return fz_throw("outofmem: buffer struct");
+ return fz_rethrow(-1, "out of memory: buffer struct");
b->refs = 1;
b->ownsdata = 0;
@@ -66,7 +66,7 @@ fz_dropbuffer(fz_buffer *buf)
}
}
-fz_error
+fz_error
fz_growbuffer(fz_buffer *buf)
{
unsigned char *newbp;
@@ -80,7 +80,7 @@ fz_growbuffer(fz_buffer *buf)
newbp = fz_realloc(buf->bp, ep * 2);
if (!newbp)
- return fz_throw("outofmem: resize buffer memory");
+ return fz_rethrow(-1, "out of memory: resize buffer memory");
buf->bp = newbp;
buf->rp = buf->bp + rp;
@@ -90,7 +90,7 @@ fz_growbuffer(fz_buffer *buf)
return fz_okay;
}
-fz_error
+fz_error
fz_rewindbuffer(fz_buffer *buf)
{
if (!buf->ownsdata)
diff --git a/fitz/stm_filter.c b/fitz/stm_filter.c
index 159740e8..f41c4112 100644
--- a/fitz/stm_filter.c
+++ b/fitz/stm_filter.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error
+fz_error
fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
fz_error reason;
diff --git a/fitz/stm_misc.c b/fitz/stm_misc.c
index c051d112..7dedb50b 100644
--- a/fitz/stm_misc.c
+++ b/fitz/stm_misc.c
@@ -9,7 +9,7 @@
* Read a line terminated by LF or CR or CRLF.
*/
-fz_error
+fz_error
fz_readline(fz_stream *stm, char *mem, int n)
{
fz_error error;
@@ -46,7 +46,7 @@ fz_readline(fz_stream *stm, char *mem, int n)
* a freshly allocated buffer.
*/
-fz_error
+fz_error
fz_readall(fz_buffer **bufp, fz_stream *stm, int sizehint)
{
fz_error error;
diff --git a/fitz/stm_open.c b/fitz/stm_open.c
index c10809a0..c1f73f48 100644
--- a/fitz/stm_open.c
+++ b/fitz/stm_open.c
@@ -71,7 +71,7 @@ fz_error fz_openrfile(fz_stream **stmp, char *path)
stm = newstm(FZ_SFILE);
if (!stm)
- return fz_throw("outofmem: stream struct");
+ return fz_rethrow(-1, "out of memory: stream struct");
error = fz_newbuffer(&stm->buffer, FZ_BUFSIZE);
if (error)
@@ -99,7 +99,7 @@ fz_error fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *src)
stm = newstm(FZ_SFILTER);
if (!stm)
- return fz_throw("outofmem: stream struct");
+ return fz_rethrow(-1, "out of memory: stream struct");
error = fz_newbuffer(&stm->buffer, FZ_BUFSIZE);
if (error)
@@ -121,7 +121,7 @@ fz_error fz_openrbuffer(fz_stream **stmp, fz_buffer *buf)
stm = newstm(FZ_SBUFFER);
if (!stm)
- return fz_throw("outofmem: stream struct");
+ return fz_rethrow(-1, "out of memory: stream struct");
stm->buffer = fz_keepbuffer(buf);
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index 330d4ce7..adb79908 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -5,7 +5,7 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error
+fz_error
fz_readimp(fz_stream *stm)
{
fz_buffer *buf = stm->buffer;
@@ -93,7 +93,7 @@ fz_readimp(fz_stream *stm)
error = fz_growbuffer(buf);
if (error)
{
- stm->dead = 1;
+ stm->dead = 1;
return fz_rethrow(error, "cannot grow buffer");
}
}
@@ -151,7 +151,7 @@ fz_tell(fz_stream *stm)
}
}
-fz_error
+fz_error
fz_seek(fz_stream *stm, int offset, int whence)
{
fz_error error;
@@ -224,7 +224,7 @@ fz_seek(fz_stream *stm, int offset, int whence)
}
}
-fz_error
+fz_error
fz_read(int *np, fz_stream *stm, unsigned char *mem, int n)
{
fz_error error;
@@ -254,7 +254,7 @@ fz_read(int *np, fz_stream *stm, unsigned char *mem, int n)
return fz_okay;
}
-fz_error
+fz_error
fz_readerror(fz_stream *stm)
{
fz_error error;