summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/common/pdfapp.c10
-rw-r--r--apps/mozilla/moz_main.c8
-rw-r--r--apps/pdfapp.h2
-rw-r--r--apps/pdfclean.c24
-rw-r--r--apps/pdfdraw.c12
-rw-r--r--apps/pdfinfo.c34
-rw-r--r--apps/pdfshow.c8
-rw-r--r--apps/unix/x11pdf.c2
-rw-r--r--apps/windows/winmain.c4
-rw-r--r--fitz/base_error.c8
-rw-r--r--fitz/base_hash.c12
-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.c6
-rw-r--r--fitz/filt_dcte.c8
-rw-r--r--fitz/filt_faxd.c12
-rw-r--r--fitz/filt_faxe.c14
-rw-r--r--fitz/filt_flate.c12
-rw-r--r--fitz/filt_jbig2d.c6
-rw-r--r--fitz/filt_jpxd.c4
-rw-r--r--fitz/filt_lzwd.c6
-rw-r--r--fitz/filt_lzwe.c8
-rw-r--r--fitz/filt_null.c4
-rw-r--r--fitz/filt_pipeline.c14
-rw-r--r--fitz/filt_predict.c8
-rw-r--r--fitz/filt_rld.c4
-rw-r--r--fitz/filt_rle.c16
-rw-r--r--fitz/fitz_base.h30
-rw-r--r--fitz/fitz_draw.h20
-rw-r--r--fitz/fitz_stream.h138
-rw-r--r--fitz/fitz_tree.h72
-rw-r--r--fitz/node_misc2.c16
-rw-r--r--fitz/node_optimize.c2
-rw-r--r--fitz/node_path.c22
-rw-r--r--fitz/node_text.c8
-rw-r--r--fitz/node_tree.c2
-rw-r--r--fitz/obj_array.c18
-rw-r--r--fitz/obj_dict.c24
-rw-r--r--fitz/obj_parse.c36
-rw-r--r--fitz/obj_simple.c18
-rw-r--r--fitz/res_font.c18
-rw-r--r--fitz/stm_buffer.c8
-rw-r--r--fitz/stm_filter.c4
-rw-r--r--fitz/stm_misc.c8
-rw-r--r--fitz/stm_open.c14
-rw-r--r--fitz/stm_read.c22
-rw-r--r--fitzdraw/glyphcache.c6
-rw-r--r--fitzdraw/imagescale.c8
-rw-r--r--fitzdraw/meshdraw.c4
-rw-r--r--fitzdraw/pathfill.c10
-rw-r--r--fitzdraw/pathscan.c12
-rw-r--r--fitzdraw/pathstroke.c60
-rw-r--r--fitzdraw/pixmap.c8
-rw-r--r--fitzdraw/render.c48
-rw-r--r--mupdf/cmapdump.c2
-rw-r--r--mupdf/mupdf.h196
-rw-r--r--mupdf/pdf_annot.c12
-rw-r--r--mupdf/pdf_build.c82
-rw-r--r--mupdf/pdf_cmap.c24
-rw-r--r--mupdf/pdf_cmap_load.c12
-rw-r--r--mupdf/pdf_cmap_parse.c40
-rw-r--r--mupdf/pdf_colorspace1.c30
-rw-r--r--mupdf/pdf_crypt.c18
-rw-r--r--mupdf/pdf_font.c20
-rw-r--r--mupdf/pdf_fontfile.c16
-rw-r--r--mupdf/pdf_fontmtx.c8
-rw-r--r--mupdf/pdf_function.c58
-rw-r--r--mupdf/pdf_image.c12
-rw-r--r--mupdf/pdf_interpret.c30
-rw-r--r--mupdf/pdf_lex.c4
-rw-r--r--mupdf/pdf_nametree.c12
-rw-r--r--mupdf/pdf_open.c48
-rw-r--r--mupdf/pdf_outline.c8
-rw-r--r--mupdf/pdf_page.c16
-rw-r--r--mupdf/pdf_pagetree.c8
-rw-r--r--mupdf/pdf_parse.c20
-rw-r--r--mupdf/pdf_pattern.c4
-rw-r--r--mupdf/pdf_repair.c8
-rw-r--r--mupdf/pdf_resources.c36
-rw-r--r--mupdf/pdf_shade.c20
-rw-r--r--mupdf/pdf_shade1.c12
-rw-r--r--mupdf/pdf_shade4.c20
-rw-r--r--mupdf/pdf_store.c12
-rw-r--r--mupdf/pdf_stream.c38
-rw-r--r--mupdf/pdf_type3.c8
-rw-r--r--mupdf/pdf_unicode.c16
-rw-r--r--mupdf/pdf_xobject.c4
-rw-r--r--mupdf/pdf_xref.c24
91 files changed, 890 insertions, 890 deletions
diff --git a/apps/common/pdfapp.c b/apps/common/pdfapp.c
index b3507097..e94e096b 100644
--- a/apps/common/pdfapp.c
+++ b/apps/common/pdfapp.c
@@ -21,7 +21,7 @@ void pdfapp_warn(pdfapp_t *app, const char *fmt, ...)
winwarn(app, buf);
}
-void pdfapp_error(pdfapp_t *app, fz_error *error)
+void pdfapp_error(pdfapp_t *app, fz_error error)
{
winerror(app, error);
}
@@ -52,7 +52,7 @@ char *pdfapp_usage(pdfapp_t *app)
void pdfapp_init(pdfapp_t *app)
{
- fz_error *error;
+ fz_error error;
memset(app, 0, sizeof(pdfapp_t));
@@ -66,7 +66,7 @@ void pdfapp_init(pdfapp_t *app)
void pdfapp_open(pdfapp_t *app, char *filename)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
char *password = "";
@@ -244,7 +244,7 @@ void pdfapp_panview(pdfapp_t *app, int newx, int newy)
void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage)
{
char buf[256];
- fz_error *error;
+ fz_error error;
fz_matrix ctm;
fz_rect bbox;
fz_obj *obj;
@@ -632,7 +632,7 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen)
{
ucsbuf[0] = 0;
#if 0 /* pdf_loadtextfromtree needs rewriting, so removing this temporarily */
- fz_error *error;
+ fz_error error;
pdf_textline *line, *ln;
int y, c;
int i, p;
diff --git a/apps/mozilla/moz_main.c b/apps/mozilla/moz_main.c
index 4e78596f..bf393353 100644
--- a/apps/mozilla/moz_main.c
+++ b/apps/mozilla/moz_main.c
@@ -61,7 +61,7 @@ void pdfmoz_warn(pdfmoz_t *moz, const char *fmt, ...)
NPN_Status(moz->inst, moz->error);
}
-void pdfmoz_error(pdfmoz_t *moz, fz_error *error)
+void pdfmoz_error(pdfmoz_t *moz, fz_error error)
{
strcpy(moz->error, error->msg);
InvalidateRect(moz->hwnd, NULL, FALSE);
@@ -71,7 +71,7 @@ void pdfmoz_error(pdfmoz_t *moz, fz_error *error)
void pdfmoz_open(pdfmoz_t *moz, char *filename)
{
SCROLLINFO si;
- fz_error *error;
+ fz_error error;
fz_obj *obj;
char *password = "";
pdf_pagetree *pages;
@@ -256,7 +256,7 @@ fz_matrix pdfmoz_pagectm(pdfmoz_t *moz, int pagenum)
void pdfmoz_loadpage(pdfmoz_t *moz, int pagenum)
{
page_t *page = moz->pages + pagenum;
- fz_error *error;
+ fz_error error;
if (page->page)
return;
@@ -269,7 +269,7 @@ void pdfmoz_loadpage(pdfmoz_t *moz, int pagenum)
void pdfmoz_drawpage(pdfmoz_t *moz, int pagenum)
{
page_t *page = moz->pages + pagenum;
- fz_error *error;
+ fz_error error;
fz_matrix ctm;
fz_rect bbox;
diff --git a/apps/pdfapp.h b/apps/pdfapp.h
index 9f03505e..0acccc2b 100644
--- a/apps/pdfapp.h
+++ b/apps/pdfapp.h
@@ -9,7 +9,7 @@ typedef struct pdfapp_s pdfapp_t;
enum { ARROW, HAND, WAIT };
extern void winwarn(pdfapp_t*, char *s);
-extern void winerror(pdfapp_t*, fz_error *error);
+extern void winerror(pdfapp_t*, fz_error error);
extern void wintitle(pdfapp_t*, char *title);
extern void winresize(pdfapp_t*, int w, int h);
extern void winconvert(pdfapp_t*, fz_pixmap *image);
diff --git a/apps/pdfclean.c b/apps/pdfclean.c
index 58fc9b68..208d2786 100644
--- a/apps/pdfclean.c
+++ b/apps/pdfclean.c
@@ -24,7 +24,7 @@ int doencrypt = 0;
int dogarbage = 0;
int doexpand = 0;
-void die(fz_error *eo)
+void die(fz_error eo)
{
fz_catch(eo, "aborting");
exit(1);
@@ -32,7 +32,7 @@ void die(fz_error *eo)
void openxref(char *filename, char *password)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
error = pdf_newxref(&xref);
@@ -81,11 +81,11 @@ void openxref(char *filename, char *password)
* Garbage collect objects not reachable from the trailer.
*/
-static fz_error *sweepref(pdf_xref *xref, fz_obj *ref);
+static fz_error sweepref(pdf_xref *xref, fz_obj *ref);
-static fz_error *sweepobj(pdf_xref *xref, fz_obj *obj)
+static fz_error sweepobj(pdf_xref *xref, fz_obj *obj)
{
- fz_error *error;
+ fz_error error;
int i;
if (fz_isdict(obj))
@@ -114,9 +114,9 @@ static fz_error *sweepobj(pdf_xref *xref, fz_obj *obj)
return fz_okay;
}
-static fz_error *sweepref(pdf_xref *xref, fz_obj *ref)
+static fz_error sweepref(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
fz_obj *len;
int oid, gen;
@@ -160,7 +160,7 @@ static fz_error *sweepref(pdf_xref *xref, fz_obj *ref)
void preloadobjstms(void)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
int oid;
@@ -178,7 +178,7 @@ void preloadobjstms(void)
void copystream(fz_obj *obj, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_buffer *buf;
error = pdf_loadrawstream(&buf, xref, oid, gen);
@@ -203,7 +203,7 @@ void copystream(fz_obj *obj, int oid, int gen)
void expandstream(fz_obj *obj, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_buffer *buf;
fz_obj *newdict, *newlen;
@@ -239,7 +239,7 @@ void expandstream(fz_obj *obj, int oid, int gen)
void saveobject(int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
fz_obj *type;
@@ -361,7 +361,7 @@ int main(int argc, char **argv)
unsigned perms = 0xfffff0c0; /* nothing allowed */
int keylen = 40;
char *password = "";
- fz_error *error;
+ fz_error error;
int c, oid;
int lastfree;
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index cc7ce53e..a095cc29 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -21,7 +21,7 @@ char *basename;
pdf_xref *xref = nil;
pdf_pagetree *pagetree = nil;
-void die(fz_error *eo)
+void die(fz_error eo)
{
fz_catch(eo, "aborting");
if (drawgc)
@@ -31,7 +31,7 @@ void die(fz_error *eo)
void openxref(char *filename, char *password)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
basename = strrchr(filename, '/');
@@ -138,7 +138,7 @@ void gettime(long *time_)
void drawloadpage(int pagenum, struct benchmark *loadtimes)
{
- fz_error *error;
+ fz_error error;
fz_obj *pageobj;
long start;
long end;
@@ -197,7 +197,7 @@ void drawfreepage(void)
void drawpnm(int pagenum, struct benchmark *loadtimes, struct benchmark *drawtimes)
{
- fz_error *error;
+ fz_error error;
fz_matrix ctm;
fz_irect bbox;
fz_pixmap *pix;
@@ -323,7 +323,7 @@ void drawpnm(int pagenum, struct benchmark *loadtimes, struct benchmark *drawtim
void drawtxt(int pagenum)
{
#if 0 /* removed temporarily pending rewrite of pdf_loadtextfromtree */
- fz_error *error;
+ fz_error error;
pdf_textline *line;
fz_matrix ctm;
@@ -429,7 +429,7 @@ void drawpages(char *pagelist)
int main(int argc, char **argv)
{
- fz_error *error;
+ fz_error error;
char *password = "";
int c;
enum { NO_FILE_OPENED, NO_PAGES_DRAWN, DREW_PAGES } state;
diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c
index c785391d..46bf11f0 100644
--- a/apps/pdfinfo.c
+++ b/apps/pdfinfo.c
@@ -28,7 +28,7 @@ pdf_xref *src = nil;
pdf_outline *srcoutline = nil;
pdf_pagetree *srcpages = nil;
-void die(fz_error *eo)
+void die(fz_error eo)
{
fz_catch(eo, "aborting");
if (drawgc)
@@ -61,7 +61,7 @@ void closesrc(void)
void opensrc(char *filename, char *password, int loadpages)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
closesrc();
@@ -230,10 +230,10 @@ gatherglobalinfo()
info->u.info.obj = src->info;
}
-fz_error *
+fz_error
gatherdimensions(int page, fz_obj *pageref, fz_obj *pageobj)
{
- fz_error *error;
+ fz_error error;
fz_obj *ref;
fz_rect bbox;
fz_obj *obj;
@@ -280,10 +280,10 @@ gatherdimensions(int page, fz_obj *pageref, fz_obj *pageobj)
return fz_okay;
}
-fz_error *
+fz_error
gatherfonts(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -365,10 +365,10 @@ gatherfonts(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
gatherimages(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -557,10 +557,10 @@ gatherimages(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
gatherforms(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -655,10 +655,10 @@ gatherforms(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
gatherpsobjs(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -730,10 +730,10 @@ gatherpsobjs(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
gathershadings(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -790,10 +790,10 @@ gathershadings(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
gatherpatterns(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
int i;
for (i = 0; i < fz_dictlen(dict); i++)
@@ -889,7 +889,7 @@ gatherpatterns(int page, fz_obj *pageref, fz_obj *pageobj, fz_obj *dict)
void
gatherinfo(int show, int page)
{
- fz_error *error;
+ fz_error error;
fz_obj *pageref;
fz_obj *pageobj;
fz_obj *rsrc;
diff --git a/apps/pdfshow.c b/apps/pdfshow.c
index f9026938..22c6c247 100644
--- a/apps/pdfshow.c
+++ b/apps/pdfshow.c
@@ -7,7 +7,7 @@
pdf_xref *xref = NULL;
-void die(fz_error *eo)
+void die(fz_error eo)
{
fz_catch(eo, "aborting");
exit(1);
@@ -15,7 +15,7 @@ void die(fz_error *eo)
void openxref(char *filename, char *password)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
error = pdf_newxref(&xref);
@@ -115,7 +115,7 @@ void showsafe(unsigned char *buf, int n)
void showstream(int num, int gen)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
unsigned char buf[2048];
int n;
@@ -147,7 +147,7 @@ void showstream(int num, int gen)
void showobject(int num, int gen)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
if (!xref)
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c
index 18507f62..42fd6a98 100644
--- a/apps/unix/x11pdf.c
+++ b/apps/unix/x11pdf.c
@@ -82,7 +82,7 @@ void winwarn(pdfapp_t *app, char *msg)
fprintf(stderr, "mupdf: %s\n", msg);
}
-void winerror(pdfapp_t *app, fz_error *error)
+void winerror(pdfapp_t *app, fz_error error)
{
fz_catch(error, "aborting");
exit(1);
diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c
index 678736f1..3a6aea87 100644
--- a/apps/windows/winmain.c
+++ b/apps/windows/winmain.c
@@ -107,7 +107,7 @@ void winwarn(pdfapp_t *app, char *msg)
MessageBoxA(hwndframe, msg, "MuPDF: Warning", MB_ICONWARNING);
}
-void winerror(pdfapp_t *app, fz_error *error)
+void winerror(pdfapp_t *app, fz_error error)
{
char msg[4096];
char buf[200];
@@ -233,7 +233,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#define SETUCS(ID) \
{ \
- fz_error *error; \
+ fz_error error; \
unsigned short *ucs; \
error = pdf_toucs2(&ucs, obj); \
if (!error) \
diff --git a/fitz/base_error.c b/fitz/base_error.c
index c0d4a42f..44df2b59 100644
--- a/fitz/base_error.c
+++ b/fitz/base_error.c
@@ -10,7 +10,7 @@ void fz_warn(char *fmt, ...)
fprintf(stderr, "\n");
}
-fz_error * fz_throwimp(const char *func, const char *file, int line, char *fmt, ...)
+fz_error fz_throwimp(const char *func, const char *file, int line, char *fmt, ...)
{
va_list ap;
fprintf(stderr, "+ %s:%d: %s(): ", file, line, func);
@@ -18,10 +18,10 @@ fz_error * fz_throwimp(const char *func, const char *file, int line, char *fmt,
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
- return ((fz_error*)-1);
+ return ((fz_error)-1);
}
-fz_error * fz_rethrowimp(fz_error *cause, const char *func, const char *file, int line, char *fmt, ...)
+fz_error fz_rethrowimp(fz_error cause, const char *func, const char *file, int line, char *fmt, ...)
{
va_list ap;
fprintf(stderr, "| %s:%d: %s(): ", file, line, func);
@@ -32,7 +32,7 @@ fz_error * fz_rethrowimp(fz_error *cause, const char *func, const char *file, in
return cause;
}
-fz_error * fz_catchimp(fz_error *cause, const char *func, const char *file, int line, char *fmt, ...)
+fz_error fz_catchimp(fz_error cause, const char *func, const char *file, int line, char *fmt, ...)
{
va_list ap;
fprintf(stderr, "\\ %s:%d: %s(): ", file, line, func);
diff --git a/fitz/base_hash.c b/fitz/base_hash.c
index bbf90807..894d33e0 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;
@@ -105,10 +105,10 @@ fz_drophash(fz_hashtable *table)
fz_free(table);
}
-fz_error *
+fz_error
fz_resizehash(fz_hashtable *table, int newsize)
{
- fz_error *error;
+ fz_error error;
fz_hashentry *newents;
fz_hashentry *oldents;
int oldload;
@@ -171,10 +171,10 @@ fz_hashfind(fz_hashtable *table, void *key)
}
}
-fz_error *
+fz_error
fz_hashinsert(fz_hashtable *table, void *key, void *val)
{
- fz_error *error;
+ fz_error error;
fz_hashentry *ents;
unsigned size;
unsigned pos;
@@ -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 92ae2f6f..f064091c 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 4ae8a6b1..6b06cd77 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 a7fb336d..56bc2aad 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 4ccd1098..8ca5345b 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 968db7b2..a5aa4fcc 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 6054a9e6..5814c6ab 100644
--- a/fitz/filt_dctd.c
+++ b/fitz/filt_dctd.c
@@ -48,10 +48,10 @@ 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;
+ fz_error err;
fz_obj *obj;
int colortransform;
@@ -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 bb95ad9b..72422cbf 100644
--- a/fitz/filt_dcte.c
+++ b/fitz/filt_dcte.c
@@ -29,10 +29,10 @@ 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;
+ fz_error err;
fz_obj *obj;
int i;
@@ -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 7223f802..e0f35654 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;
@@ -126,7 +126,7 @@ static inline void eatbits(fz_faxd *fax, int nbits)
fax->bidx += nbits;
}
-static inline fz_error * fillbits(fz_faxd *fax, fz_buffer *in)
+static inline fz_error fillbits(fz_faxd *fax, fz_buffer *in)
{
while (fax->bidx >= 8)
{
@@ -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,11 +318,11 @@ 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;
- fz_error *error;
+ fz_error error;
int i;
unsigned char *tmp;
diff --git a/fitz/filt_faxe.c b/fitz/filt_faxe.c
index d9358546..3aa4f09a 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;
@@ -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,10 +257,10 @@ 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;
+ fz_error error;
int i, n;
while (1)
@@ -388,11 +388,11 @@ 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;
- fz_error *error;
+ fz_error error;
/* restore partial bits */
*out->wp = fax->bsave;
diff --git a/fitz/filt_flate.c b/fitz/filt_flate.c
index 056e8670..73105800 100644
--- a/fitz/filt_flate.c
+++ b/fitz/filt_flate.c
@@ -17,10 +17,10 @@ zmalloc(void *opaque, unsigned int items, unsigned int size)
return fz_malloc(items * size);
}
-fz_error *
+fz_error
fz_newflated(fz_filter **fp, fz_obj *params)
{
- fz_error *eo;
+ fz_error eo;
fz_obj *obj;
int zipfmt;
int ei;
@@ -70,7 +70,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;
@@ -110,11 +110,11 @@ 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;
- fz_error *eo;
+ fz_error eo;
int effort;
int zipfmt;
int ei;
@@ -166,7 +166,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 7ec5dec0..9dfeda61 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 35323e29..eb940c93 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 ef491f04..07bdddc8 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;
@@ -97,7 +97,7 @@ static inline void eatbits(fz_lzwd *lzw, int nbits)
lzw->bidx += nbits;
}
-static inline fz_error * fillbits(fz_lzwd *lzw, fz_buffer *in)
+static inline fz_error fillbits(fz_lzwd *lzw, fz_buffer *in)
{
while (lzw->bidx >= 8)
{
@@ -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 c691456b..a20043c0 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,11 +242,11 @@ 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;
- fz_error *error;
+ fz_error error;
/* restore partial bits */
*out->wp = lzw->bsave;
diff --git a/fitz/filt_null.c b/fitz/filt_null.c
index 08478c0b..955354b1 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 c6b28ebd..33609a4a 100644
--- a/fitz/filt_pipeline.c
+++ b/fitz/filt_pipeline.c
@@ -5,7 +5,7 @@
typedef struct fz_pipeline_s fz_pipeline;
-fz_error * fz_processpipeline(fz_filter *filter, fz_buffer *in, fz_buffer *out);
+fz_error fz_processpipeline(fz_filter *filter, fz_buffer *in, fz_buffer *out);
struct fz_pipeline_s
{
@@ -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,10 +38,10 @@ 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;
+ fz_error error;
FZ_NEWFILTER(fz_pipeline, p, pipeline);
p->head = fz_keepfilter(head);
@@ -67,11 +67,11 @@ 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;
- fz_error *e;
+ fz_error e;
if (p->buffer->eof)
goto tail;
@@ -89,7 +89,7 @@ head:
{
if (p->tailneedsin && !p->head->produced)
{
- fz_error *be = nil;
+ fz_error be = nil;
if (p->buffer->rp > p->buffer->bp)
be = fz_rewindbuffer(p->buffer);
else
diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c
index fff5a8ce..fc1bf1ea 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;
@@ -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 53acd615..734c7005 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 f0284d4c..2dfdb91d 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,11 +126,11 @@ 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;
- fz_error *error;
+ fz_error error;
unsigned char c;
while (1)
diff --git a/fitz/fitz_base.h b/fitz/fitz_base.h
index 4ce6fbc0..211ed8dc 100644
--- a/fitz/fitz_base.h
+++ b/fitz/fitz_base.h
@@ -177,17 +177,17 @@ char *cleanname(char *name);
typedef int fz_error;
-#define fz_outofmem ((fz_error*)-1)
+#define fz_outofmem ((fz_error)-1)
#define fz_throw(...) fz_throwimp(__func__, __FILE__, __LINE__, __VA_ARGS__)
#define fz_rethrow(cause, ...) fz_rethrowimp(cause, __func__, __FILE__, __LINE__, __VA_ARGS__)
#define fz_catch(cause, ...) fz_catchimp(cause, __func__, __FILE__, __LINE__, __VA_ARGS__)
-#define fz_okay ((fz_error*)0)
+#define fz_okay ((fz_error)0)
void fz_warn(char *fmt, ...) __printflike(1,2);
-fz_error *fz_throwimp(const char *func, const char *file, int line, char *fmt, ...) __printflike(4, 5);
-fz_error *fz_rethrowimp(fz_error *cause, const char *func, const char *file, int line, char *fmt, ...) __printflike(5, 6);
-fz_error *fz_catchimp(fz_error *cause, const char *func, const char *file, int line, char *fmt, ...) __printflike(5, 6);
+fz_error fz_throwimp(const char *func, const char *file, int line, char *fmt, ...) __printflike(4, 5);
+fz_error fz_rethrowimp(fz_error cause, const char *func, const char *file, int line, char *fmt, ...) __printflike(5, 6);
+fz_error fz_catchimp(fz_error cause, const char *func, const char *file, int line, char *fmt, ...) __printflike(5, 6);
typedef struct fz_memorycontext_s fz_memorycontext;
@@ -213,15 +213,15 @@ char *fz_strdup(char *s);
typedef struct fz_hashtable_s fz_hashtable;
-fz_error *fz_newhash(fz_hashtable **tablep, int initialsize, int keylen);
-fz_error *fz_resizehash(fz_hashtable *table, int newsize);
+fz_error fz_newhash(fz_hashtable **tablep, int initialsize, int keylen);
+fz_error fz_resizehash(fz_hashtable *table, int newsize);
void fz_debughash(fz_hashtable *table);
void fz_emptyhash(fz_hashtable *table);
void fz_drophash(fz_hashtable *table);
void *fz_hashfind(fz_hashtable *table, void *key);
-fz_error *fz_hashinsert(fz_hashtable *table, void *key, void *val);
-fz_error *fz_hashremove(fz_hashtable *table, void *key);
+fz_error fz_hashinsert(fz_hashtable *table, void *key, void *val);
+fz_error fz_hashremove(fz_hashtable *table, void *key);
int fz_hashlen(fz_hashtable *table);
void *fz_hashgetkey(fz_hashtable *table, int idx);
@@ -323,18 +323,18 @@ struct fz_pixmap_s
fz_sample *samples;
};
-fz_error *fz_newpixmapwithrect(fz_pixmap **mapp, fz_irect bbox, int n);
-fz_error *fz_newpixmap(fz_pixmap **mapp, int x, int y, int w, int h, int n);
-fz_error *fz_newpixmapcopy(fz_pixmap **pixp, fz_pixmap *old);
+fz_error fz_newpixmapwithrect(fz_pixmap **mapp, fz_irect bbox, int n);
+fz_error fz_newpixmap(fz_pixmap **mapp, int x, int y, int w, int h, int n);
+fz_error fz_newpixmapcopy(fz_pixmap **pixp, fz_pixmap *old);
void fz_debugpixmap(fz_pixmap *map, char *prefix);
void fz_clearpixmap(fz_pixmap *map);
void fz_droppixmap(fz_pixmap *map);
-fz_error *fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom);
+fz_error fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom);
/* needed for tiled rendering */
-fz_error *fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom);
-fz_error *fz_scalepixmaptile(fz_pixmap *dstp, int xoffs, int yoffs,
+fz_error fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom);
+fz_error fz_scalepixmaptile(fz_pixmap *dstp, int xoffs, int yoffs,
fz_pixmap *tile, int xdenom, int ydenom);
diff --git a/fitz/fitz_draw.h b/fitz/fitz_draw.h
index fc7d0a78..494374da 100644
--- a/fitz/fitz_draw.h
+++ b/fitz/fitz_draw.h
@@ -37,22 +37,22 @@ struct fz_ael_s
fz_edge **edges;
};
-fz_error *fz_newgel(fz_gel **gelp);
-fz_error *fz_insertgel(fz_gel *gel, float x0, float y0, float x1, float y1);
+fz_error fz_newgel(fz_gel **gelp);
+fz_error fz_insertgel(fz_gel *gel, float x0, float y0, float x1, float y1);
fz_irect fz_boundgel(fz_gel *gel);
void fz_resetgel(fz_gel *gel, fz_irect clip);
void fz_sortgel(fz_gel *gel);
void fz_dropgel(fz_gel *gel);
-fz_error *fz_newael(fz_ael **aelp);
+fz_error fz_newael(fz_ael **aelp);
void fz_dropael(fz_ael *ael);
-fz_error *fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill,
+fz_error fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill,
fz_irect clip, fz_pixmap *pix, unsigned char *argb, int over);
-fz_error *fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness);
-fz_error *fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth);
-fz_error *fz_dashpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth);
+fz_error fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness);
+fz_error fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth);
+fz_error fz_dashpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth);
/*
@@ -121,9 +121,9 @@ struct fz_renderer_s
extern void fz_accelerate();
-fz_error *fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem);
+fz_error fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem);
void fz_droprenderer(fz_renderer *gc);
-fz_error *fz_rendertree(fz_pixmap **out, fz_renderer *gc, fz_tree *tree, fz_matrix ctm, fz_irect bbox, int white);
-fz_error *fz_rendertreeover(fz_renderer *gc, fz_pixmap *dest, fz_tree *tree, fz_matrix ctm);
+fz_error fz_rendertree(fz_pixmap **out, fz_renderer *gc, fz_tree *tree, fz_matrix ctm, fz_irect bbox, int white);
+fz_error fz_rendertreeover(fz_renderer *gc, fz_pixmap *dest, fz_tree *tree, fz_matrix ctm);
diff --git a/fitz/fitz_stream.h b/fitz/fitz_stream.h
index a904d04b..17d6c4e0 100644
--- a/fitz/fitz_stream.h
+++ b/fitz/fitz_stream.h
@@ -60,21 +60,21 @@ struct fz_obj_s
} u;
};
-fz_error *fz_newnull(fz_obj **op);
-fz_error *fz_newbool(fz_obj **op, int b);
-fz_error *fz_newint(fz_obj **op, int i);
-fz_error *fz_newreal(fz_obj **op, float f);
-fz_error *fz_newname(fz_obj **op, char *str);
-fz_error *fz_newstring(fz_obj **op, char *str, int len);
-fz_error *fz_newindirect(fz_obj **op, int oid, int gid);
-fz_error *fz_newpointer(fz_obj **op, void *p);
-
-fz_error *fz_newarray(fz_obj **op, int initialcap);
-fz_error *fz_newdict(fz_obj **op, int initialcap);
-fz_error *fz_copyarray(fz_obj **op, fz_obj *array);
-fz_error *fz_copydict(fz_obj **op, fz_obj *dict);
-fz_error *fz_deepcopyarray(fz_obj **op, fz_obj *array);
-fz_error *fz_deepcopydict(fz_obj **op, fz_obj *dict);
+fz_error fz_newnull(fz_obj **op);
+fz_error fz_newbool(fz_obj **op, int b);
+fz_error fz_newint(fz_obj **op, int i);
+fz_error fz_newreal(fz_obj **op, float f);
+fz_error fz_newname(fz_obj **op, char *str);
+fz_error fz_newstring(fz_obj **op, char *str, int len);
+fz_error fz_newindirect(fz_obj **op, int oid, int gid);
+fz_error fz_newpointer(fz_obj **op, void *p);
+
+fz_error fz_newarray(fz_obj **op, int initialcap);
+fz_error fz_newdict(fz_obj **op, int initialcap);
+fz_error fz_copyarray(fz_obj **op, fz_obj *array);
+fz_error fz_copydict(fz_obj **op, fz_obj *dict);
+fz_error fz_deepcopyarray(fz_obj **op, fz_obj *array);
+fz_error fz_deepcopydict(fz_obj **op, fz_obj *dict);
fz_obj *fz_keepobj(fz_obj *obj);
void fz_dropobj(fz_obj *obj);
@@ -104,12 +104,12 @@ int fz_tonum(fz_obj *obj);
int fz_togen(fz_obj *obj);
void *fz_topointer(fz_obj *obj);
-fz_error *fz_newnamefromstring(fz_obj **op, fz_obj *str);
+fz_error fz_newnamefromstring(fz_obj **op, fz_obj *str);
int fz_arraylen(fz_obj *array);
fz_obj *fz_arrayget(fz_obj *array, int i);
-fz_error *fz_arrayput(fz_obj *array, int i, fz_obj *obj);
-fz_error *fz_arraypush(fz_obj *array, fz_obj *obj);
+fz_error fz_arrayput(fz_obj *array, int i, fz_obj *obj);
+fz_error fz_arraypush(fz_obj *array, fz_obj *obj);
int fz_dictlen(fz_obj *dict);
fz_obj *fz_dictgetkey(fz_obj *dict, int idx);
@@ -117,19 +117,19 @@ fz_obj *fz_dictgetval(fz_obj *dict, int idx);
fz_obj *fz_dictget(fz_obj *dict, fz_obj *key);
fz_obj *fz_dictgets(fz_obj *dict, char *key);
fz_obj *fz_dictgetsa(fz_obj *dict, char *key, char *abbrev);
-fz_error *fz_dictput(fz_obj *dict, fz_obj *key, fz_obj *val);
-fz_error *fz_dictputs(fz_obj *dict, char *key, fz_obj *val);
-fz_error *fz_dictdel(fz_obj *dict, fz_obj *key);
-fz_error *fz_dictdels(fz_obj *dict, char *key);
+fz_error fz_dictput(fz_obj *dict, fz_obj *key, fz_obj *val);
+fz_error fz_dictputs(fz_obj *dict, char *key, fz_obj *val);
+fz_error fz_dictdel(fz_obj *dict, fz_obj *key);
+fz_error fz_dictdels(fz_obj *dict, char *key);
void fz_sortdict(fz_obj *dict);
int fz_sprintobj(char *s, int n, fz_obj *obj, int tight);
int fz_fprintobj(FILE *fp, fz_obj *obj, int tight);
void fz_debugobj(fz_obj *obj);
-fz_error *fz_parseobj(fz_obj **objp, char *s);
-fz_error *fz_packobj(fz_obj **objp, char *fmt, ...);
-fz_error *fz_unpackobj(fz_obj *obj, char *fmt, ...);
+fz_error fz_parseobj(fz_obj **objp, char *s);
+fz_error fz_packobj(fz_obj **objp, char *fmt, ...);
+fz_error fz_unpackobj(fz_obj *obj, char *fmt, ...);
char *fz_objkindstr(fz_obj *obj);
@@ -165,11 +165,11 @@ struct fz_buffer_s
int eof;
};
-fz_error *fz_newbuffer(fz_buffer **bufp, int size);
-fz_error *fz_newbufferwithmemory(fz_buffer **bufp, unsigned char *data, int size);
+fz_error fz_newbuffer(fz_buffer **bufp, int size);
+fz_error fz_newbufferwithmemory(fz_buffer **bufp, unsigned char *data, int size);
-fz_error *fz_rewindbuffer(fz_buffer *buf);
-fz_error *fz_growbuffer(fz_buffer *buf);
+fz_error fz_rewindbuffer(fz_buffer *buf);
+fz_error fz_growbuffer(fz_buffer *buf);
fz_buffer *fz_keepbuffer(fz_buffer *buf);
void fz_dropbuffer(fz_buffer *buf);
@@ -202,16 +202,16 @@ void fz_dropbuffer(fz_buffer *buf);
typedef struct fz_filter_s fz_filter;
-#define fz_ioneedin ((fz_error*)1)
-#define fz_ioneedout ((fz_error*)2)
-#define fz_iodone ((fz_error*)3)
+#define fz_ioneedin ((fz_error)1)
+#define fz_ioneedout ((fz_error)2)
+#define fz_iodone ((fz_error)3)
/*
* Evil looking macro to create an initialize a filter struct.
*/
#define FZ_NEWFILTER(TYPE,VAR,NAME) \
- fz_error * fz_process ## NAME (fz_filter*,fz_buffer*,fz_buffer*); \
+ fz_error fz_process ## NAME (fz_filter*,fz_buffer*,fz_buffer*); \
void fz_drop ## NAME (fz_filter*); \
TYPE *VAR; \
*fp = fz_malloc(sizeof(TYPE)); \
@@ -228,7 +228,7 @@ typedef struct fz_filter_s fz_filter;
struct fz_filter_s
{
int refs;
- fz_error* (*process)(fz_filter *filter, fz_buffer *in, fz_buffer *out);
+ fz_error (*process)(fz_filter *filter, fz_buffer *in, fz_buffer *out);
void (*drop)(fz_filter *filter);
int consumed;
int produced;
@@ -236,37 +236,37 @@ struct fz_filter_s
int done;
};
-fz_error *fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out);
+fz_error fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out);
fz_filter *fz_keepfilter(fz_filter *f);
void fz_dropfilter(fz_filter *f);
-fz_error *fz_newpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail);
-fz_error *fz_chainpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail, fz_buffer *buf);
+fz_error fz_newpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail);
+fz_error fz_chainpipeline(fz_filter **fp, fz_filter *head, fz_filter *tail, fz_buffer *buf);
void fz_unchainpipeline(fz_filter *pipe, fz_filter **oldfp, fz_buffer **oldbp);
/* stop and reverse! special case needed for postscript only */
void fz_pushbackahxd(fz_filter *filter, fz_buffer *in, fz_buffer *out, int n);
-fz_error *fz_newnullfilter(fz_filter **fp, int len);
-fz_error *fz_newarc4filter(fz_filter **fp, unsigned char *key, unsigned keylen);
-fz_error *fz_newa85d(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newa85e(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newahxd(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newahxe(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newrld(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newrle(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newdctd(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newdcte(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newfaxd(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newfaxe(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newflated(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newflatee(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newlzwd(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newlzwe(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newpredictd(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newpredicte(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newjbig2d(fz_filter **filterp, fz_obj *param);
-fz_error *fz_newjpxd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newnullfilter(fz_filter **fp, int len);
+fz_error fz_newarc4filter(fz_filter **fp, unsigned char *key, unsigned keylen);
+fz_error fz_newa85d(fz_filter **filterp, fz_obj *param);
+fz_error fz_newa85e(fz_filter **filterp, fz_obj *param);
+fz_error fz_newahxd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newahxe(fz_filter **filterp, fz_obj *param);
+fz_error fz_newrld(fz_filter **filterp, fz_obj *param);
+fz_error fz_newrle(fz_filter **filterp, fz_obj *param);
+fz_error fz_newdctd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newdcte(fz_filter **filterp, fz_obj *param);
+fz_error fz_newfaxd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newfaxe(fz_filter **filterp, fz_obj *param);
+fz_error fz_newflated(fz_filter **filterp, fz_obj *param);
+fz_error fz_newflatee(fz_filter **filterp, fz_obj *param);
+fz_error fz_newlzwd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newlzwe(fz_filter **filterp, fz_obj *param);
+fz_error fz_newpredictd(fz_filter **filterp, fz_obj *param);
+fz_error fz_newpredicte(fz_filter **filterp, fz_obj *param);
+fz_error fz_newjbig2d(fz_filter **filterp, fz_obj *param);
+fz_error fz_newjpxd(fz_filter **filterp, fz_obj *param);
/*
* Basic crypto functions.
@@ -328,7 +328,7 @@ struct fz_stream_s
fz_buffer *buffer;
fz_filter *filter;
fz_stream *chain;
- fz_error *error; /* delayed error from readbyte and peekbyte */
+ fz_error error; /* delayed error from readbyte and peekbyte */
int file;
};
@@ -336,14 +336,14 @@ struct fz_stream_s
* Various stream creation functions.
*/
-fz_error *fz_openrfile(fz_stream **stmp, char *filename);
+fz_error fz_openrfile(fz_stream **stmp, char *filename);
/* write to memory buffers! */
-fz_error *fz_openrmemory(fz_stream **stmp, unsigned char *mem, int len);
-fz_error *fz_openrbuffer(fz_stream **stmp, fz_buffer *buf);
+fz_error fz_openrmemory(fz_stream **stmp, unsigned char *mem, int len);
+fz_error fz_openrbuffer(fz_stream **stmp, fz_buffer *buf);
/* almost like fork() exec() pipe() */
-fz_error *fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *chain);
+fz_error fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *chain);
/*
* Functions that are common to both input and output streams.
@@ -353,19 +353,19 @@ fz_stream *fz_keepstream(fz_stream *stm);
void fz_dropstream(fz_stream *stm);
int fz_tell(fz_stream *stm);
-fz_error * fz_seek(fz_stream *stm, int offset, int whence);
+fz_error fz_seek(fz_stream *stm, int offset, int whence);
/*
* Input stream functions.
*/
int fz_rtell(fz_stream *stm);
-fz_error * fz_rseek(fz_stream *stm, int offset, int whence);
+fz_error fz_rseek(fz_stream *stm, int offset, int whence);
-fz_error * fz_readimp(fz_stream *stm);
-fz_error * fz_read(int *np, fz_stream *stm, unsigned char *buf, int len);
-fz_error * fz_readall(fz_buffer **bufp, fz_stream *stm, int sizehint);
-fz_error * fz_readline(fz_stream *stm, char *buf, int max);
+fz_error fz_readimp(fz_stream *stm);
+fz_error fz_read(int *np, fz_stream *stm, unsigned char *buf, int len);
+fz_error fz_readall(fz_buffer **bufp, fz_stream *stm, int sizehint);
+fz_error fz_readline(fz_stream *stm, char *buf, int max);
/*
* Error handling when reading with readbyte/peekbyte is non-standard.
@@ -374,7 +374,7 @@ fz_error * fz_readline(fz_stream *stm, char *buf, int max);
* So we have to be careful to check the error status eventually.
*/
-fz_error *fz_readerror(fz_stream *stm);
+fz_error fz_readerror(fz_stream *stm);
int fz_readbytex(fz_stream *stm);
int fz_peekbytex(fz_stream *stm);
diff --git a/fitz/fitz_tree.h b/fitz/fitz_tree.h
index 0ad0aef7..205441ad 100644
--- a/fitz/fitz_tree.h
+++ b/fitz/fitz_tree.h
@@ -20,7 +20,7 @@ struct fz_tree_s
};
/* tree operations */
-fz_error *fz_newtree(fz_tree **treep);
+fz_error fz_newtree(fz_tree **treep);
fz_tree *fz_keeptree(fz_tree *tree);
void fz_droptree(fz_tree *tree);
@@ -31,7 +31,7 @@ void fz_insertnodelast(fz_node *parent, fz_node *child);
void fz_insertnodeafter(fz_node *prev, fz_node *child);
void fz_removenode(fz_node *child);
-fz_error *fz_optimizetree(fz_tree *tree);
+fz_error fz_optimizetree(fz_tree *tree);
/* node types */
@@ -153,10 +153,10 @@ fz_rect fz_boundnode(fz_node *node, fz_matrix ctm);
void fz_dropnode(fz_node *node);
/* branch nodes */
-fz_error *fz_newovernode(fz_node **nodep);
-fz_error *fz_newmasknode(fz_node **nodep);
-fz_error *fz_newblendnode(fz_node **nodep, fz_blendkind b, int k, int i);
-fz_error *fz_newtransformnode(fz_node **nodep, fz_matrix m);
+fz_error fz_newovernode(fz_node **nodep);
+fz_error fz_newmasknode(fz_node **nodep);
+fz_error fz_newblendnode(fz_node **nodep, fz_blendkind b, int k, int i);
+fz_error fz_newtransformnode(fz_node **nodep, fz_matrix m);
int fz_istransformnode(fz_node *node);
int fz_isovernode(fz_node *node);
@@ -164,10 +164,10 @@ int fz_ismasknode(fz_node *node);
int fz_isblendnode(fz_node *node);
/* leaf nodes */
-fz_error *fz_newlinknode(fz_node **nodep, fz_tree *subtree);
-fz_error *fz_newsolidnode(fz_node **nodep, float a, fz_colorspace *cs, int n, float *v);
-fz_error *fz_newimagenode(fz_node **nodep, fz_image *image);
-fz_error *fz_newshadenode(fz_node **nodep, fz_shade *shade);
+fz_error fz_newlinknode(fz_node **nodep, fz_tree *subtree);
+fz_error fz_newsolidnode(fz_node **nodep, float a, fz_colorspace *cs, int n, float *v);
+fz_error fz_newimagenode(fz_node **nodep, fz_image *image);
+fz_error fz_newshadenode(fz_node **nodep, fz_shade *shade);
int fz_islinknode(fz_node *node);
int fz_issolidnode(fz_node *node);
@@ -243,21 +243,21 @@ struct fz_pathnode_s
fz_pathel *els;
};
-fz_error *fz_newpathnode(fz_pathnode **pathp);
-fz_error *fz_clonepathnode(fz_pathnode **pathp, fz_pathnode *oldpath);
-fz_error *fz_moveto(fz_pathnode*, float x, float y);
-fz_error *fz_lineto(fz_pathnode*, float x, float y);
-fz_error *fz_curveto(fz_pathnode*, float, float, float, float, float, float);
-fz_error *fz_curvetov(fz_pathnode*, float, float, float, float);
-fz_error *fz_curvetoy(fz_pathnode*, float, float, float, float);
-fz_error *fz_closepath(fz_pathnode*);
-fz_error *fz_endpath(fz_pathnode*, fz_pathkind paint, fz_stroke *stroke, fz_dash *dash);
+fz_error fz_newpathnode(fz_pathnode **pathp);
+fz_error fz_clonepathnode(fz_pathnode **pathp, fz_pathnode *oldpath);
+fz_error fz_moveto(fz_pathnode*, float x, float y);
+fz_error fz_lineto(fz_pathnode*, float x, float y);
+fz_error fz_curveto(fz_pathnode*, float, float, float, float, float, float);
+fz_error fz_curvetov(fz_pathnode*, float, float, float, float);
+fz_error fz_curvetoy(fz_pathnode*, float, float, float, float);
+fz_error fz_closepath(fz_pathnode*);
+fz_error fz_endpath(fz_pathnode*, fz_pathkind paint, fz_stroke *stroke, fz_dash *dash);
fz_rect fz_boundpathnode(fz_pathnode *node, fz_matrix ctm);
void fz_debugpathnode(fz_pathnode *node, int indent);
void fz_printpathnode(fz_pathnode *node, int indent);
-fz_error *fz_newdash(fz_dash **dashp, float phase, int len, float *array);
+fz_error fz_newdash(fz_dash **dashp, float phase, int len, float *array);
void fz_dropdash(fz_dash *dash);
/*
@@ -300,10 +300,10 @@ struct fz_textnode_s
fz_textel *els;
};
-fz_error *fz_newtextnode(fz_textnode **textp, fz_font *face);
-fz_error *fz_clonetextnode(fz_textnode **textp, fz_textnode *oldtext);
-fz_error *fz_addtext(fz_textnode *text, int gid, int ucs, float x, float y);
-fz_error *fz_endtext(fz_textnode *text);
+fz_error fz_newtextnode(fz_textnode **textp, fz_font *face);
+fz_error fz_clonetextnode(fz_textnode **textp, fz_textnode *oldtext);
+fz_error fz_addtext(fz_textnode *text, int gid, int ucs, float x, float y);
+fz_error fz_endtext(fz_textnode *text);
typedef struct fz_colorcube_s fz_colorcube;
typedef struct fz_colorcube1_s fz_colorcube1;
@@ -371,13 +371,13 @@ struct fz_glyph_s
unsigned char *samples;
};
-fz_error * fz_newfreetypefont(fz_font **fontp, char *name, int substitute);
-fz_error * fz_loadfreetypefontfile(fz_font *font, char *path, int index);
-fz_error * fz_loadfreetypefontbuffer(fz_font *font, unsigned char *data, int len, int index);
-fz_error * fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix);
+fz_error fz_newfreetypefont(fz_font **fontp, char *name, int substitute);
+fz_error fz_loadfreetypefontfile(fz_font *font, char *path, int index);
+fz_error fz_loadfreetypefontbuffer(fz_font *font, unsigned char *data, int len, int index);
+fz_error fz_newtype3font(fz_font **fontp, char *name, fz_matrix matrix);
-fz_error * fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index);
-fz_error * fz_newfontfromfile(fz_font **fontp, char *path, int index);
+fz_error fz_newfontfrombuffer(fz_font **fontp, unsigned char *data, int len, int index);
+fz_error fz_newfontfromfile(fz_font **fontp, char *path, int index);
fz_font * fz_keepfont(fz_font *font);
void fz_dropfont(fz_font *font);
@@ -385,10 +385,10 @@ void fz_dropfont(fz_font *font);
void fz_debugfont(fz_font *font);
void fz_setfontbbox(fz_font *font, int xmin, int ymin, int xmax, int ymax);
-fz_error * fz_renderftglyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm);
-fz_error * fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm);
-fz_error * fz_newglyphcache(fz_glyphcache **arenap, int slots, int size);
-fz_error * fz_renderglyph(fz_glyphcache*, fz_glyph*, fz_font*, int, fz_matrix);
+fz_error fz_renderftglyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm);
+fz_error fz_rendert3glyph(fz_glyph *glyph, fz_font *font, int cid, fz_matrix trm);
+fz_error fz_newglyphcache(fz_glyphcache **arenap, int slots, int size);
+fz_error fz_renderglyph(fz_glyphcache*, fz_glyph*, fz_font*, int, fz_matrix);
void fz_debugglyphcache(fz_glyphcache *);
void fz_dropglyphcache(fz_glyphcache *);
@@ -397,7 +397,7 @@ void fz_dropglyphcache(fz_glyphcache *);
struct fz_image_s
{
int refs;
- fz_error* (*loadtile)(fz_image*,fz_pixmap*);
+ fz_error (*loadtile)(fz_image*,fz_pixmap*);
void (*drop)(fz_image*);
fz_colorspace *cs;
int w, h, n, a;
@@ -431,5 +431,5 @@ fz_shade *fz_keepshade(fz_shade *shade);
void fz_dropshade(fz_shade *shade);
fz_rect fz_boundshade(fz_shade *shade, fz_matrix ctm);
-fz_error *fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *dsts, fz_pixmap *dstp);
+fz_error fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *dsts, fz_pixmap *dstp);
diff --git a/fitz/node_misc2.c b/fitz/node_misc2.c
index be442dd0..17ab63c3 100644
--- a/fitz/node_misc2.c
+++ b/fitz/node_misc2.c
@@ -5,7 +5,7 @@
* Over
*/
-fz_error *
+fz_error
fz_newovernode(fz_node **nodep)
{
fz_node *node;
@@ -47,7 +47,7 @@ fz_boundovernode(fz_overnode *node, fz_matrix ctm)
* Mask
*/
-fz_error *
+fz_error
fz_newmasknode(fz_node **nodep)
{
fz_node *node;
@@ -80,7 +80,7 @@ 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;
@@ -132,7 +132,7 @@ fz_dropblendnode(fz_blendnode *node)
* Transform
*/
-fz_error *
+fz_error
fz_newtransformnode(fz_node **nodep, fz_matrix m)
{
fz_transformnode *node;
@@ -160,7 +160,7 @@ 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;
@@ -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;
@@ -229,7 +229,7 @@ fz_dropsolidnode(fz_solidnode *node)
* Image node
*/
-fz_error *
+fz_error
fz_newimagenode(fz_node **nodep, fz_image *image)
{
fz_imagenode *node;
@@ -266,7 +266,7 @@ 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;
diff --git a/fitz/node_optimize.c b/fitz/node_optimize.c
index 78a014f7..0d173efe 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 3b288347..8cd54300 100644
--- a/fitz/node_path.c
+++ b/fitz/node_path.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error *
+fz_error
fz_newpathnode(fz_pathnode **pathp)
{
fz_pathnode *path;
@@ -25,7 +25,7 @@ fz_newpathnode(fz_pathnode **pathp)
return fz_okay;
}
-fz_error *
+fz_error
fz_clonepathnode(fz_pathnode **pathp, fz_pathnode *oldpath)
{
fz_pathnode *path;
@@ -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;
@@ -81,7 +81,7 @@ 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)
@@ -92,7 +92,7 @@ fz_moveto(fz_pathnode *path, float x, float y)
return fz_okay;
}
-fz_error *
+fz_error
fz_lineto(fz_pathnode *path, float x, float y)
{
if (growpath(path, 3) != nil)
@@ -103,7 +103,7 @@ fz_lineto(fz_pathnode *path, float x, float y)
return fz_okay;
}
-fz_error *
+fz_error
fz_curveto(fz_pathnode *path,
float x1, float y1,
float x2, float y2,
@@ -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,13 +129,13 @@ 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)
@@ -144,7 +144,7 @@ fz_closepath(fz_pathnode *path)
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;
diff --git a/fitz/node_text.c b/fitz/node_text.c
index dc89c3eb..5abca20a 100644
--- a/fitz/node_text.c
+++ b/fitz/node_text.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error *
+fz_error
fz_newtextnode(fz_textnode **textp, fz_font *font)
{
fz_textnode *text;
@@ -22,7 +22,7 @@ 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;
@@ -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;
@@ -128,7 +128,7 @@ 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)
diff --git a/fitz/node_tree.c b/fitz/node_tree.c
index 1bdac451..9e75b8aa 100644
--- a/fitz/node_tree.c
+++ b/fitz/node_tree.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_tree.h"
-fz_error *
+fz_error
fz_newtree(fz_tree **treep)
{
fz_tree *tree;
diff --git a/fitz/obj_array.c b/fitz/obj_array.c
index 72a533f3..ce0309eb 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;
@@ -32,10 +32,10 @@ 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;
+ fz_error error;
fz_obj *new;
int i;
@@ -61,10 +61,10 @@ 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;
+ fz_error error;
fz_obj *new;
fz_obj *val;
int i;
@@ -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;
@@ -192,10 +192,10 @@ growarray(fz_obj *obj)
return fz_okay;
}
-fz_error *
+fz_error
fz_arraypush(fz_obj *obj, fz_obj *item)
{
- fz_error *error;
+ fz_error error;
if (!fz_isarray(obj))
return fz_throw("assert: not an array (%s)", fz_objkindstr(obj));
diff --git a/fitz/obj_dict.c b/fitz/obj_dict.c
index d8c6226e..6493baf3 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;
@@ -56,10 +56,10 @@ 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;
+ fz_error error;
fz_obj *new;
int i;
@@ -84,10 +84,10 @@ 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;
+ fz_error error;
fz_obj *new;
fz_obj *val;
int i;
@@ -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;
@@ -275,10 +275,10 @@ 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;
+ fz_error error;
char *s;
int i;
@@ -319,10 +319,10 @@ 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;
+ fz_error error;
fz_obj *keyobj;
error = fz_newname(&keyobj, key);
if (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 4282ca3d..1a063223 100644
--- a/fitz/obj_parse.c
+++ b/fitz/obj_parse.c
@@ -30,7 +30,7 @@ static inline int isregular(int ch)
return !isdelim(ch) && !iswhite(ch) && ch != EOF;
}
-static fz_error *parseobj(fz_obj **obj, char **sp, struct vap *v);
+static fz_error parseobj(fz_obj **obj, char **sp, struct vap *v);
static inline int fromhex(char ch)
{
@@ -60,9 +60,9 @@ static void parsekeyword(char **sp, char *b, char *eb)
*sp = s;
}
-static fz_error *parsename(fz_obj **obj, char **sp)
+static fz_error parsename(fz_obj **obj, char **sp)
{
- fz_error *error;
+ fz_error error;
char buf[64];
char *s = *sp;
char *p = buf;
@@ -79,9 +79,9 @@ static fz_error *parsename(fz_obj **obj, char **sp)
return fz_okay;
}
-static fz_error *parsenumber(fz_obj **obj, char **sp)
+static fz_error parsenumber(fz_obj **obj, char **sp)
{
- fz_error *error;
+ fz_error error;
char buf[32];
char *s = *sp;
char *p = buf;
@@ -106,9 +106,9 @@ static fz_error *parsenumber(fz_obj **obj, char **sp)
return fz_okay;
}
-static fz_error *parsedict(fz_obj **obj, char **sp, struct vap *v)
+static fz_error parsedict(fz_obj **obj, char **sp, struct vap *v)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
fz_obj *dict = nil;
fz_obj *key = nil;
fz_obj *val = nil;
@@ -184,9 +184,9 @@ cleanup:
return error; /* already rethrown */
}
-static fz_error *parsearray(fz_obj **obj, char **sp, struct vap *v)
+static fz_error parsearray(fz_obj **obj, char **sp, struct vap *v)
{
- fz_error *error;
+ fz_error error;
fz_obj *a;
fz_obj *o;
char *s = *sp;
@@ -230,9 +230,9 @@ static fz_error *parsearray(fz_obj **obj, char **sp, struct vap *v)
return fz_okay;
}
-static fz_error *parsestring(fz_obj **obj, char **sp)
+static fz_error parsestring(fz_obj **obj, char **sp)
{
- fz_error *error;
+ fz_error error;
char buf[512];
char *s = *sp;
char *p = buf;
@@ -297,9 +297,9 @@ static fz_error *parsestring(fz_obj **obj, char **sp)
return fz_okay;
}
-static fz_error *parsehexstring(fz_obj **obj, char **sp)
+static fz_error parsehexstring(fz_obj **obj, char **sp)
{
- fz_error *error;
+ fz_error error;
char buf[512];
char *s = *sp;
char *p = buf;
@@ -336,9 +336,9 @@ static fz_error *parsehexstring(fz_obj **obj, char **sp)
return fz_okay;
}
-static fz_error *parseobj(fz_obj **obj, char **sp, struct vap *v)
+static fz_error parseobj(fz_obj **obj, char **sp, struct vap *v)
{
- fz_error *error;
+ fz_error error;
char buf[32];
int oid, gid, len;
char *tmp;
@@ -465,10 +465,10 @@ 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;
+ fz_error error;
struct vap v;
va_list ap;
@@ -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 d21bcda8..2e664625 100644
--- a/fitz/obj_simple.c
+++ b/fitz/obj_simple.c
@@ -11,14 +11,14 @@ extern void fz_dropdict(fz_obj *dict);
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 946997ae..1261f2c4 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,10 +125,10 @@ fz_initfreetype(void)
return fz_okay;
}
-fz_error *
+fz_error
fz_newfontfromfile(fz_font **fontp, char *path, int index)
{
- fz_error *error;
+ fz_error error;
fz_font *font;
int code;
@@ -151,10 +151,10 @@ 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;
+ fz_error error;
fz_font *font;
int 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;
@@ -326,10 +326,10 @@ 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;
+ fz_error error;
fz_renderer *gc;
fz_tree *tree;
fz_matrix ctm;
diff --git a/fitz/stm_buffer.c b/fitz/stm_buffer.c
index 21764cde..128d6e8e 100644
--- a/fitz/stm_buffer.c
+++ b/fitz/stm_buffer.c
@@ -1,7 +1,7 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error *
+fz_error
fz_newbuffer(fz_buffer **bp, int size)
{
fz_buffer *b;
@@ -27,7 +27,7 @@ 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;
@@ -66,7 +66,7 @@ fz_dropbuffer(fz_buffer *buf)
}
}
-fz_error *
+fz_error
fz_growbuffer(fz_buffer *buf)
{
unsigned char *newbp;
@@ -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 edcdb200..159740e8 100644
--- a/fitz/stm_filter.c
+++ b/fitz/stm_filter.c
@@ -1,10 +1,10 @@
#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;
+ fz_error reason;
unsigned char *oldrp;
unsigned char *oldwp;
diff --git a/fitz/stm_misc.c b/fitz/stm_misc.c
index 4a51aeb8..c051d112 100644
--- a/fitz/stm_misc.c
+++ b/fitz/stm_misc.c
@@ -9,10 +9,10 @@
* 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;
+ fz_error error;
char *s = mem;
int c = EOF;
@@ -46,10 +46,10 @@ 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;
+ fz_error error;
fz_buffer *buf;
int c;
diff --git a/fitz/stm_open.c b/fitz/stm_open.c
index c01ad725..c10809a0 100644
--- a/fitz/stm_open.c
+++ b/fitz/stm_open.c
@@ -64,9 +64,9 @@ fz_dropstream(fz_stream *stm)
}
}
-fz_error * fz_openrfile(fz_stream **stmp, char *path)
+fz_error fz_openrfile(fz_stream **stmp, char *path)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
stm = newstm(FZ_SFILE);
@@ -92,9 +92,9 @@ fz_error * fz_openrfile(fz_stream **stmp, char *path)
return fz_okay;
}
-fz_error * fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *src)
+fz_error fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *src)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
stm = newstm(FZ_SFILTER);
@@ -115,7 +115,7 @@ fz_error * fz_openrfilter(fz_stream **stmp, fz_filter *flt, fz_stream *src)
return fz_okay;
}
-fz_error * fz_openrbuffer(fz_stream **stmp, fz_buffer *buf)
+fz_error fz_openrbuffer(fz_stream **stmp, fz_buffer *buf)
{
fz_stream *stm;
@@ -131,9 +131,9 @@ fz_error * fz_openrbuffer(fz_stream **stmp, fz_buffer *buf)
return fz_okay;
}
-fz_error * fz_openrmemory(fz_stream **stmp, unsigned char *mem, int len)
+fz_error fz_openrmemory(fz_stream **stmp, unsigned char *mem, int len)
{
- fz_error *error;
+ fz_error error;
fz_buffer *buf;
error = fz_newbufferwithmemory(&buf, mem, len);
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index 1e3bd502..330d4ce7 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -5,12 +5,12 @@
#include "fitz_base.h"
#include "fitz_stream.h"
-fz_error *
+fz_error
fz_readimp(fz_stream *stm)
{
fz_buffer *buf = stm->buffer;
- fz_error *error;
- fz_error *reason;
+ fz_error error;
+ fz_error reason;
int produced;
int n;
@@ -151,10 +151,10 @@ fz_tell(fz_stream *stm)
}
}
-fz_error *
+fz_error
fz_seek(fz_stream *stm, int offset, int whence)
{
- fz_error *error;
+ fz_error error;
fz_buffer *buf = stm->buffer;
int t, c;
@@ -224,10 +224,10 @@ 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;
+ fz_error error;
fz_buffer *buf = stm->buffer;
int i = 0;
@@ -254,10 +254,10 @@ 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;
+ fz_error error;
if (stm->error)
{
error = stm->error;
@@ -276,7 +276,7 @@ fz_readbytex(fz_stream *stm)
{
if (!buf->eof && !stm->error)
{
- fz_error *error = fz_readimp(stm);
+ fz_error error = fz_readimp(stm);
if (error)
stm->error = fz_rethrow(error, "cannot read data");
}
@@ -294,7 +294,7 @@ fz_peekbytex(fz_stream *stm)
{
if (!buf->eof && !stm->error)
{
- fz_error *error = fz_readimp(stm);
+ fz_error error = fz_readimp(stm);
if (error)
stm->error = fz_rethrow(error, "cannot read data");
}
diff --git a/fitzdraw/glyphcache.c b/fitzdraw/glyphcache.c
index 38beb677..cc39f437 100644
--- a/fitzdraw/glyphcache.c
+++ b/fitzdraw/glyphcache.c
@@ -57,7 +57,7 @@ static unsigned int hashkey(fz_key *key)
return hash;
}
-fz_error *
+fz_error
fz_newglyphcache(fz_glyphcache **arenap, int slots, int size)
{
fz_glyphcache *arena;
@@ -313,10 +313,10 @@ evictall(fz_glyphcache *arena)
arena->used = 0;
}
-fz_error *
+fz_error
fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
fz_key key;
fz_val *val;
int size;
diff --git a/fitzdraw/imagescale.c b/fitzdraw/imagescale.c
index d8f28917..065a250e 100644
--- a/fitzdraw/imagescale.c
+++ b/fitzdraw/imagescale.c
@@ -179,7 +179,7 @@ void (*fz_scol2)(byte *src, byte *dst, int w, int denom) = scol2;
void (*fz_scol4)(byte *src, byte *dst, int w, int denom) = scol4;
void (*fz_scol5)(byte *src, byte *dst, int w, int denom) = scol5;
-fz_error *
+fz_error
fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom)
{
int ow = (w + xdenom - 1) / xdenom;
@@ -188,7 +188,7 @@ fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom
}
/* TODO: refactor */
-fz_error *
+fz_error
fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xdenom, int ydenom)
{
unsigned char *buf;
@@ -271,10 +271,10 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
return fz_okay;
}
-fz_error *
+fz_error
fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
- fz_error *error;
+ fz_error error;
fz_pixmap *dst;
unsigned char *buf;
int y, iy, oy;
diff --git a/fitzdraw/meshdraw.c b/fitzdraw/meshdraw.c
index cede57d3..2eedcbc2 100644
--- a/fitzdraw/meshdraw.c
+++ b/fitzdraw/meshdraw.c
@@ -312,12 +312,12 @@ fz_drawtriangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n)
* mesh drawing
*/
-fz_error *
+fz_error
fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap *dest)
{
unsigned char clut[256][3];
unsigned char *s, *d;
- fz_error *error;
+ fz_error error;
fz_pixmap *temp;
float rgb[3];
float tri[3][MAXN];
diff --git a/fitzdraw/pathfill.c b/fitzdraw/pathfill.c
index cf76f216..92aff3b4 100644
--- a/fitzdraw/pathfill.c
+++ b/fitzdraw/pathfill.c
@@ -2,7 +2,7 @@
#include "fitz_tree.h"
#include "fitz_draw.h"
-static fz_error *
+static fz_error
line(fz_gel *gel, fz_matrix *ctm, float x0, float y0, float x1, float y1)
{
float tx0 = ctm->a * x0 + ctm->c * y0 + ctm->e;
@@ -12,14 +12,14 @@ line(fz_gel *gel, fz_matrix *ctm, float x0, float y0, float x1, float y1)
return fz_insertgel(gel, tx0, ty0, tx1, ty1);
}
-static fz_error *
+static fz_error
bezier(fz_gel *gel, fz_matrix *ctm, float flatness,
float xa, float ya,
float xb, float yb,
float xc, float yc,
float xd, float yd)
{
- fz_error *error;
+ fz_error error;
float dmax;
float xab, yab;
float xbc, ybc;
@@ -66,10 +66,10 @@ bezier(fz_gel *gel, fz_matrix *ctm, float flatness,
return bezier(gel, ctm, flatness, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error *
+fz_error
fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness)
{
- fz_error *error;
+ fz_error error;
float x1, y1, x2, y2, x3, y3;
float cx = 0;
float cy = 0;
diff --git a/fitzdraw/pathscan.c b/fitzdraw/pathscan.c
index 647b872f..dec7c73f 100644
--- a/fitzdraw/pathscan.c
+++ b/fitzdraw/pathscan.c
@@ -12,7 +12,7 @@ enum { HSCALE = 17, VSCALE = 15, SF = 1 };
* See Mike Abrash -- Graphics Programming Black Book (notably chapter 40)
*/
-fz_error *
+fz_error
fz_newgel(fz_gel **gelp)
{
fz_gel *gel;
@@ -108,7 +108,7 @@ cliplerpx(int val, int m, int x0, int y0, int x1, int y1, int *out)
}
}
-fz_error *
+fz_error
fz_insertgel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1)
{
fz_edge *edge;
@@ -237,7 +237,7 @@ fz_sortgel(fz_gel *gel)
* Active Edge List -- keep track of active edges while sweeping
*/
-fz_error *
+fz_error
fz_newael(fz_ael **aelp)
{
fz_ael *ael;
@@ -297,7 +297,7 @@ sortael(fz_edge **a, int n)
}
}
-static fz_error *
+static fz_error
insertael(fz_ael *ael, fz_gel *gel, int y, int *e)
{
/* insert edges that start here */
@@ -452,11 +452,11 @@ static inline void blit(fz_pixmap *pix, int x, int y,
fz_path_1c1(list, cov, len, dst);
}
-fz_error *
+fz_error
fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill, fz_irect clip,
fz_pixmap *pix, unsigned char *argb, int over)
{
- fz_error *error;
+ fz_error error;
unsigned char *deltas;
int y, e;
int yd, yc;
diff --git a/fitzdraw/pathstroke.c b/fitzdraw/pathstroke.c
index 1c5c7a6c..7b560313 100644
--- a/fitzdraw/pathstroke.c
+++ b/fitzdraw/pathstroke.c
@@ -26,7 +26,7 @@ struct sctx
fz_point cur;
};
-static fz_error *
+static fz_error
line(struct sctx *s, float x0, float y0, float x1, float y1)
{
float tx0 = s->ctm->a * x0 + s->ctm->c * y0 + s->ctm->e;
@@ -36,13 +36,13 @@ line(struct sctx *s, float x0, float y0, float x1, float y1)
return fz_insertgel(s->gel, tx0, ty0, tx1, ty1);
}
-static fz_error *
+static fz_error
arc(struct sctx *s,
float xc, float yc,
float x0, float y0,
float x1, float y1)
{
- fz_error *error;
+ fz_error error;
float th0, th1, r;
float theta;
float ox, oy, nx, ny;
@@ -85,10 +85,10 @@ arc(struct sctx *s,
return fz_okay;
}
-static fz_error *
+static fz_error
linestroke(struct sctx *s, fz_point a, fz_point b)
{
- fz_error *error;
+ fz_error error;
float dx = b.x - a.x;
float dy = b.y - a.y;
@@ -105,10 +105,10 @@ linestroke(struct sctx *s, fz_point a, fz_point b)
return fz_okay;
}
-static fz_error *
+static fz_error
linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c)
{
- fz_error *error;
+ fz_error error;
float miterlimit = s->miterlimit;
float linewidth = s->linewidth;
int linejoin = s->linejoin;
@@ -208,10 +208,10 @@ linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c)
return fz_okay;
}
-static fz_error *
+static fz_error
linecap(struct sctx *s, fz_point a, fz_point b)
{
- fz_error *error;
+ fz_error error;
float flatness = s->flatness;
float linewidth = s->linewidth;
int linecap = s->linecap;
@@ -268,10 +268,10 @@ linecap(struct sctx *s, fz_point a, fz_point b)
return fz_okay;
}
-static fz_error *
+static fz_error
linedot(struct sctx *s, fz_point a)
{
- fz_error *error;
+ fz_error error;
float flatness = s->flatness;
float linewidth = s->linewidth;
int n = ceil(M_PI / (M_SQRT2 * sqrt(flatness / linewidth)));
@@ -295,10 +295,10 @@ linedot(struct sctx *s, fz_point a)
return fz_okay;
}
-static fz_error *
+static fz_error
strokeflush(struct sctx *s)
{
- fz_error *error;
+ fz_error error;
if (s->sn == 2)
{
@@ -318,10 +318,10 @@ strokeflush(struct sctx *s)
return fz_okay;
}
-static fz_error *
+static fz_error
strokemoveto(struct sctx *s, fz_point cur)
{
- fz_error *error;
+ fz_error error;
error = strokeflush(s);
if (error) return error;
@@ -334,10 +334,10 @@ strokemoveto(struct sctx *s, fz_point cur)
return fz_okay;
}
-static fz_error *
+static fz_error
strokelineto(struct sctx *s, fz_point cur)
{
- fz_error *error;
+ fz_error error;
float dx = cur.x - s->seg[s->sn-1].x;
float dy = cur.y - s->seg[s->sn-1].y;
@@ -368,10 +368,10 @@ strokelineto(struct sctx *s, fz_point cur)
return fz_okay;
}
-static fz_error *
+static fz_error
strokeclosepath(struct sctx *s)
{
- fz_error *error;
+ fz_error error;
if (s->sn == 2)
{
@@ -398,14 +398,14 @@ strokeclosepath(struct sctx *s)
return fz_okay;
}
-static fz_error *
+static fz_error
strokebezier(struct sctx *s,
float xa, float ya,
float xb, float yb,
float xc, float yc,
float xd, float yd)
{
- fz_error *error;
+ fz_error error;
float dmax;
float xab, yab;
float xbc, ybc;
@@ -457,10 +457,10 @@ strokebezier(struct sctx *s,
return strokebezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error *
+fz_error
fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth)
{
- fz_error *error;
+ fz_error error;
struct sctx s;
fz_point p0, p1, p2, p3;
int i;
@@ -530,7 +530,7 @@ fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, flo
return strokeflush(&s);
}
-static fz_error *
+static fz_error
dashmoveto(struct sctx *s, fz_point a)
{
s->toggle = 1;
@@ -554,10 +554,10 @@ dashmoveto(struct sctx *s, fz_point a)
return fz_okay;
}
-static fz_error *
+static fz_error
dashlineto(struct sctx *s, fz_point b)
{
- fz_error *error;
+ fz_error error;
float dx, dy;
float total, used, ratio;
fz_point a;
@@ -600,14 +600,14 @@ dashlineto(struct sctx *s, fz_point b)
return fz_okay;
}
-static fz_error *
+static fz_error
dashbezier(struct sctx *s,
float xa, float ya,
float xb, float yb,
float xc, float yc,
float xd, float yd)
{
- fz_error *error;
+ fz_error error;
float dmax;
float xab, yab;
float xbc, ybc;
@@ -657,10 +657,10 @@ dashbezier(struct sctx *s,
return dashbezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error *
+fz_error
fz_dashpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth)
{
- fz_error *error;
+ fz_error error;
struct sctx s;
fz_point p0, p1, p2, p3, beg;
int i;
diff --git a/fitzdraw/pixmap.c b/fitzdraw/pixmap.c
index 1c06505d..2103f59b 100644
--- a/fitzdraw/pixmap.c
+++ b/fitzdraw/pixmap.c
@@ -2,7 +2,7 @@
#include "fitz_tree.h"
#include "fitz_draw.h"
-fz_error *
+fz_error
fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n)
{
fz_pixmap *pix;
@@ -26,7 +26,7 @@ fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n)
return fz_okay;
}
-fz_error *
+fz_error
fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n)
{
return fz_newpixmap(pixp,
@@ -35,10 +35,10 @@ fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n)
r.y1 - r.y0, n);
}
-fz_error *
+fz_error
fz_newpixmapcopy(fz_pixmap **pixp, fz_pixmap *old)
{
- fz_error *error;
+ fz_error error;
error = fz_newpixmap(pixp, old->x, old->y, old->w, old->h, old->n);
if (error)
return error;
diff --git a/fitzdraw/render.c b/fitzdraw/render.c
index acc2c723..133c5ed0 100644
--- a/fitzdraw/render.c
+++ b/fitzdraw/render.c
@@ -21,12 +21,12 @@
#define FOVER 1
#define FRGB 4
-static fz_error *rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm);
+static fz_error rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm);
-fz_error *
+fz_error
fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem)
{
- fz_error *error;
+ fz_error error;
fz_renderer *gc;
gc = fz_malloc(sizeof(fz_renderer));
@@ -91,10 +91,10 @@ fz_droprenderer(fz_renderer *gc)
* Transform
*/
-static fz_error *
+static fz_error
rendertransform(fz_renderer *gc, fz_transformnode *transform, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
DEBUG("transform [%g %g %g %g %g %g]\n",
transform->m.a, transform->m.b,
transform->m.c, transform->m.d,
@@ -110,10 +110,10 @@ DEBUG("}\n");
* Color
*/
-static fz_error *
+static fz_error
rendersolid(fz_renderer *gc, fz_solidnode *solid, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
float rgb[3];
unsigned char a, r, g, b;
unsigned char *p;
@@ -184,10 +184,10 @@ DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc
* Path
*/
-static fz_error *
+static fz_error
renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
float flatness;
fz_irect gbox;
fz_irect clip;
@@ -307,10 +307,10 @@ static void drawglyph(fz_renderer *gc, fz_pixmap *dst, fz_glyph *src, int xorig,
}
}
-static fz_error *
+static fz_error
rendertext(fz_renderer *gc, fz_textnode *text, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
fz_irect tbox;
fz_irect clip;
fz_matrix tm, trm;
@@ -385,10 +385,10 @@ calcimagescale(fz_matrix ctm, int w, int h, int *odx, int *ody)
*ody = dy;
}
-static fz_error *
+static fz_error
renderimage(fz_renderer *gc, fz_imagenode *node, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
fz_image *image = node->image;
fz_irect bbox;
fz_irect clip;
@@ -565,10 +565,10 @@ cleanup:
* Shade
*/
-static fz_error *
+static fz_error
rendershade(fz_renderer *gc, fz_shadenode *node, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
fz_irect bbox;
assert(!gc->maskonly);
@@ -682,10 +682,10 @@ blendmask(fz_renderer *gc, fz_pixmap *src, fz_pixmap *msk, fz_pixmap *dst, int o
}
}
-static fz_error *
+static fz_error
renderover(fz_renderer *gc, fz_overnode *over, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
fz_node *child;
int cluster = 0;
@@ -727,10 +727,10 @@ DEBUG("}\n");
return fz_okay;
}
-static fz_error *
+static fz_error
rendermask(fz_renderer *gc, fz_masknode *mask, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
int oldmaskonly;
fz_pixmap *oldover;
fz_irect oldclip;
@@ -851,7 +851,7 @@ cleanup:
* Dispatch
*/
-static fz_error *
+static fz_error
rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm)
{
if (!node)
@@ -888,12 +888,12 @@ rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm)
return fz_okay;
}
-fz_error *
+fz_error
fz_rendertree(fz_pixmap **outp,
fz_renderer *gc, fz_tree *tree, fz_matrix ctm,
fz_irect bbox, int white)
{
- fz_error *error;
+ fz_error error;
gc->clip = bbox;
gc->over = nil;
@@ -933,10 +933,10 @@ DEBUG("}\n");
return fz_okay;
}
-fz_error *
+fz_error
fz_rendertreeover(fz_renderer *gc, fz_pixmap *dest, fz_tree *tree, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
assert(!gc->maskonly);
assert(dest->n == 4);
diff --git a/mupdf/cmapdump.c b/mupdf/cmapdump.c
index 1efc3868..596e3e51 100644
--- a/mupdf/cmapdump.c
+++ b/mupdf/cmapdump.c
@@ -38,7 +38,7 @@ int
main(int argc, char **argv)
{
pdf_cmap *cmap;
- fz_error *error;
+ fz_error error;
fz_stream *fi;
FILE *fo;
char name[256];
diff --git a/mupdf/mupdf.h b/mupdf/mupdf.h
index 4184f662..8d815ca6 100644
--- a/mupdf/mupdf.h
+++ b/mupdf/mupdf.h
@@ -31,18 +31,18 @@ typedef enum pdf_token_e
} pdf_token_e;
/* lex.c */
-fz_error *pdf_lex(pdf_token_e *tok, fz_stream *f, char *buf, int n, int *len);
+fz_error pdf_lex(pdf_token_e *tok, fz_stream *f, char *buf, int n, int *len);
/* parse.c */
-fz_error *pdf_parsearray(fz_obj **op, fz_stream *f, char *buf, int cap);
-fz_error *pdf_parsedict(fz_obj **op, fz_stream *f, char *buf, int cap);
-fz_error *pdf_parsestmobj(fz_obj **op, fz_stream *f, char *buf, int cap);
-fz_error *pdf_parseindobj(fz_obj **op, fz_stream *f, char *buf, int cap, int *oid, int *gen, int *stmofs);
+fz_error pdf_parsearray(fz_obj **op, fz_stream *f, char *buf, int cap);
+fz_error pdf_parsedict(fz_obj **op, fz_stream *f, char *buf, int cap);
+fz_error pdf_parsestmobj(fz_obj **op, fz_stream *f, char *buf, int cap);
+fz_error pdf_parseindobj(fz_obj **op, fz_stream *f, char *buf, int cap, int *oid, int *gen, int *stmofs);
fz_rect pdf_torect(fz_obj *array);
fz_matrix pdf_tomatrix(fz_obj *array);
-fz_error *pdf_toutf8(char **dstp, fz_obj *src);
-fz_error *pdf_toucs2(unsigned short **dstp, fz_obj *src);
+fz_error pdf_toutf8(char **dstp, fz_obj *src);
+fz_error pdf_toucs2(unsigned short **dstp, fz_obj *src);
/*
* Encryption
@@ -84,14 +84,14 @@ struct pdf_crypt_s
};
/* crypt.c */
-fz_error *pdf_newdecrypt(pdf_crypt **cp, fz_obj *enc, fz_obj *id);
-fz_error *pdf_newencrypt(pdf_crypt **cp, char *userpw, char *ownerpw, int p, int n, fz_obj *id);
+fz_error pdf_newdecrypt(pdf_crypt **cp, fz_obj *enc, fz_obj *id);
+fz_error pdf_newencrypt(pdf_crypt **cp, char *userpw, char *ownerpw, int p, int n, fz_obj *id);
int pdf_setpassword(pdf_crypt *crypt, char *pw);
int pdf_setuserpassword(pdf_crypt *crypt, char *pw, int pwlen);
int pdf_setownerpassword(pdf_crypt *crypt, char *pw, int pwlen);
-fz_error *pdf_cryptstream(fz_filter **fp, pdf_crypt *crypt, int oid, int gen);
+fz_error pdf_cryptstream(fz_filter **fp, pdf_crypt *crypt, int oid, int gen);
void pdf_cryptbuffer(pdf_crypt *crypt, fz_buffer *buf, int oid, int gen);
void pdf_cryptobj(pdf_crypt *crypt, fz_obj *obj, int oid, int gen);
void pdf_dropcrypt(pdf_crypt *crypt);
@@ -133,33 +133,33 @@ struct pdf_xrefentry_s
int type; /* 0=unset (f)ree i(n)use (o)bjstm */
};
-fz_error *pdf_newxref(pdf_xref **);
-fz_error *pdf_repairxref(pdf_xref *, char *filename);
-fz_error *pdf_loadxref(pdf_xref *, char *filename);
-fz_error *pdf_initxref(pdf_xref *);
+fz_error pdf_newxref(pdf_xref **);
+fz_error pdf_repairxref(pdf_xref *, char *filename);
+fz_error pdf_loadxref(pdf_xref *, char *filename);
+fz_error pdf_initxref(pdf_xref *);
void pdf_debugxref(pdf_xref *);
void pdf_flushxref(pdf_xref *, int force);
void pdf_closexref(pdf_xref *);
-fz_error *pdf_cacheobject(pdf_xref *, int oid, int gen);
-fz_error *pdf_loadobject(fz_obj **objp, pdf_xref *, int oid, int gen);
-fz_error *pdf_loadindirect(fz_obj **objp, pdf_xref *, fz_obj *ref);
-fz_error *pdf_resolve(fz_obj **reforobj, pdf_xref *);
+fz_error pdf_cacheobject(pdf_xref *, int oid, int gen);
+fz_error pdf_loadobject(fz_obj **objp, pdf_xref *, int oid, int gen);
+fz_error pdf_loadindirect(fz_obj **objp, pdf_xref *, fz_obj *ref);
+fz_error pdf_resolve(fz_obj **reforobj, pdf_xref *);
int pdf_isstream(pdf_xref *xref, int oid, int gen);
-fz_error *pdf_buildinlinefilter(fz_filter **filterp, fz_obj *stmobj);
-fz_error *pdf_loadrawstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen);
-fz_error *pdf_loadstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen);
-fz_error *pdf_openrawstream(fz_stream **stmp, pdf_xref *, int oid, int gen);
-fz_error *pdf_openstream(fz_stream **stmp, pdf_xref *, int oid, int gen);
+fz_error pdf_buildinlinefilter(fz_filter **filterp, fz_obj *stmobj);
+fz_error pdf_loadrawstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen);
+fz_error pdf_loadstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen);
+fz_error pdf_openrawstream(fz_stream **stmp, pdf_xref *, int oid, int gen);
+fz_error pdf_openstream(fz_stream **stmp, pdf_xref *, int oid, int gen);
-fz_error *pdf_garbagecollect(pdf_xref *xref);
-fz_error *pdf_transplant(pdf_xref *dst, pdf_xref *src, fz_obj **newp, fz_obj *old);
+fz_error pdf_garbagecollect(pdf_xref *xref);
+fz_error pdf_transplant(pdf_xref *dst, pdf_xref *src, fz_obj **newp, fz_obj *old);
/* private */
-fz_error *pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap);
-fz_error *pdf_decryptxref(pdf_xref *xref);
+fz_error pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap);
+fz_error pdf_decryptxref(pdf_xref *xref);
/*
* Resource store
@@ -179,15 +179,15 @@ typedef enum pdf_itemkind_e
PDF_KFONT
} pdf_itemkind;
-fz_error *pdf_newstore(pdf_store **storep);
+fz_error pdf_newstore(pdf_store **storep);
void pdf_emptystore(pdf_store *store);
void pdf_dropstore(pdf_store *store);
-fz_error *pdf_storeitem(pdf_store *store, pdf_itemkind tag, fz_obj *key, void *val);
+fz_error pdf_storeitem(pdf_store *store, pdf_itemkind tag, fz_obj *key, void *val);
void *pdf_finditem(pdf_store *store, pdf_itemkind tag, fz_obj *key);
-fz_error *pdf_removeitem(pdf_store *store, pdf_itemkind tag, fz_obj *key);
+fz_error pdf_removeitem(pdf_store *store, pdf_itemkind tag, fz_obj *key);
-fz_error *pdf_loadresources(fz_obj **rdb, pdf_xref *xref, fz_obj *orig);
+fz_error pdf_loadresources(fz_obj **rdb, pdf_xref *xref, fz_obj *orig);
/*
* Functions
@@ -195,8 +195,8 @@ fz_error *pdf_loadresources(fz_obj **rdb, pdf_xref *xref, fz_obj *orig);
typedef struct pdf_function_s pdf_function;
-fz_error *pdf_loadfunction(pdf_function **func, pdf_xref *xref, fz_obj *ref);
-fz_error *pdf_evalfunction(pdf_function *func, float *in, int inlen, float *out, int outlen);
+fz_error pdf_loadfunction(pdf_function **func, pdf_xref *xref, fz_obj *ref);
+fz_error pdf_evalfunction(pdf_function *func, float *in, int inlen, float *out, int outlen);
pdf_function *pdf_keepfunction(pdf_function *func);
void pdf_dropfunction(pdf_function *func);
@@ -223,7 +223,7 @@ extern fz_colorspace *pdf_devicepattern;
void pdf_convcolor(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv);
void pdf_convpixmap(fz_colorspace *ss, fz_pixmap *sp, fz_colorspace *ds, fz_pixmap *dp);
-fz_error *pdf_loadcolorspace(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj);
+fz_error pdf_loadcolorspace(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj);
/*
* Pattern
@@ -242,7 +242,7 @@ struct pdf_pattern_s
fz_tree *tree;
};
-fz_error *pdf_loadpattern(pdf_pattern **patp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadpattern(pdf_pattern **patp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
pdf_pattern *pdf_keeppattern(pdf_pattern *pat);
void pdf_droppattern(pdf_pattern *pat);
@@ -251,15 +251,15 @@ void pdf_droppattern(pdf_pattern *pat);
*/
void pdf_setmeshvalue(float *mesh, int i, float x, float y, float t);
-fz_error *pdf_loadshadefunction(fz_shade *shade, pdf_xref *xref, fz_obj *dict, float t0, float t1);
-fz_error *pdf_loadtype1shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype2shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype3shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype4shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype5shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype6shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadtype7shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
-fz_error *pdf_loadshade(fz_shade **shadep, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadshadefunction(fz_shade *shade, pdf_xref *xref, fz_obj *dict, float t0, float t1);
+fz_error pdf_loadtype1shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype2shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype3shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype4shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype5shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype6shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadtype7shade(fz_shade *, pdf_xref *, fz_obj *dict, fz_obj *ref);
+fz_error pdf_loadshade(fz_shade **shadep, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
/*
* XObject
@@ -278,7 +278,7 @@ struct pdf_xobject_s
fz_buffer *contents;
};
-fz_error *pdf_loadxobject(pdf_xobject **xobjp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadxobject(pdf_xobject **xobjp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
pdf_xobject *pdf_keepxobject(pdf_xobject *xobj);
void pdf_dropxobject(pdf_xobject *xobj);
@@ -301,9 +301,9 @@ struct pdf_image_s
fz_buffer *samples;
};
-fz_error *pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *file);
-fz_error *pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
-fz_error *pdf_loadtile(fz_image *image, fz_pixmap *tile);
+fz_error pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *file);
+fz_error pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadtile(fz_image *image, fz_pixmap *tile);
/*
* CMap
@@ -349,7 +349,7 @@ struct pdf_cmap_s
extern pdf_cmap *pdf_cmaptable[]; /* list of builtin system cmaps */
-fz_error *pdf_newcmap(pdf_cmap **cmapp);
+fz_error pdf_newcmap(pdf_cmap **cmapp);
pdf_cmap *pdf_keepcmap(pdf_cmap *cmap);
void pdf_dropcmap(pdf_cmap *cmap);
@@ -359,19 +359,19 @@ pdf_cmap *pdf_getusecmap(pdf_cmap *cmap);
void pdf_setwmode(pdf_cmap *cmap, int wmode);
void pdf_setusecmap(pdf_cmap *cmap, pdf_cmap *usecmap);
-fz_error *pdf_addcodespace(pdf_cmap *cmap, int low, int high, int n);
-fz_error *pdf_maprangetotable(pdf_cmap *cmap, int low, int *map, int len);
-fz_error *pdf_maprangetorange(pdf_cmap *cmap, int srclo, int srchi, int dstlo);
-fz_error *pdf_maponetomany(pdf_cmap *cmap, int one, int *many, int len);
-fz_error *pdf_sortcmap(pdf_cmap *cmap);
+fz_error pdf_addcodespace(pdf_cmap *cmap, int low, int high, int n);
+fz_error pdf_maprangetotable(pdf_cmap *cmap, int low, int *map, int len);
+fz_error pdf_maprangetorange(pdf_cmap *cmap, int srclo, int srchi, int dstlo);
+fz_error pdf_maponetomany(pdf_cmap *cmap, int one, int *many, int len);
+fz_error pdf_sortcmap(pdf_cmap *cmap);
int pdf_lookupcmap(pdf_cmap *cmap, int cpt);
unsigned char *pdf_decodecmap(pdf_cmap *cmap, unsigned char *s, int *cpt);
-fz_error *pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file);
-fz_error *pdf_loadembeddedcmap(pdf_cmap **cmapp, pdf_xref *xref, fz_obj *ref);
-fz_error *pdf_loadsystemcmap(pdf_cmap **cmapp, char *name);
-fz_error *pdf_newidentitycmap(pdf_cmap **cmapp, int wmode, int bytes);
+fz_error pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file);
+fz_error pdf_loadembeddedcmap(pdf_cmap **cmapp, pdf_xref *xref, fz_obj *ref);
+fz_error pdf_loadsystemcmap(pdf_cmap **cmapp, char *name);
+fz_error pdf_newidentitycmap(pdf_cmap **cmapp, int wmode, int bytes);
/*
* Font
@@ -451,29 +451,29 @@ struct pdf_fontdesc_s
void pdf_setfontwmode(pdf_fontdesc *font, int wmode);
void pdf_setdefaulthmtx(pdf_fontdesc *font, int w);
void pdf_setdefaultvmtx(pdf_fontdesc *font, int y, int w);
-fz_error *pdf_addhmtx(pdf_fontdesc *font, int lo, int hi, int w);
-fz_error *pdf_addvmtx(pdf_fontdesc *font, int lo, int hi, int x, int y, int w);
-fz_error *pdf_endhmtx(pdf_fontdesc *font);
-fz_error *pdf_endvmtx(pdf_fontdesc *font);
+fz_error pdf_addhmtx(pdf_fontdesc *font, int lo, int hi, int w);
+fz_error pdf_addvmtx(pdf_fontdesc *font, int lo, int hi, int x, int y, int w);
+fz_error pdf_endhmtx(pdf_fontdesc *font);
+fz_error pdf_endvmtx(pdf_fontdesc *font);
pdf_hmtx pdf_gethmtx(pdf_fontdesc *font, int cid);
pdf_vmtx pdf_getvmtx(pdf_fontdesc *font, int cid);
/* unicode.c */
-fz_error *pdf_loadtounicode(pdf_fontdesc *font, pdf_xref *xref, char **strings, char *collection, fz_obj *cmapstm);
+fz_error pdf_loadtounicode(pdf_fontdesc *font, pdf_xref *xref, char **strings, char *collection, fz_obj *cmapstm);
/* fontfile.c */
-fz_error *pdf_loadbuiltinfont(pdf_fontdesc *font, char *basefont);
-fz_error *pdf_loadembeddedfont(pdf_fontdesc *font, pdf_xref *xref, fz_obj *stmref);
-fz_error *pdf_loadsystemfont(pdf_fontdesc *font, char *basefont, char *collection);
-fz_error *pdf_loadsubstitutefont(pdf_fontdesc *font, int fdflags, char *collection);
+fz_error pdf_loadbuiltinfont(pdf_fontdesc *font, char *basefont);
+fz_error pdf_loadembeddedfont(pdf_fontdesc *font, pdf_xref *xref, fz_obj *stmref);
+fz_error pdf_loadsystemfont(pdf_fontdesc *font, char *basefont, char *collection);
+fz_error pdf_loadsubstitutefont(pdf_fontdesc *font, int fdflags, char *collection);
/* type3.c */
-fz_error *pdf_loadtype3font(pdf_fontdesc **fontp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadtype3font(pdf_fontdesc **fontp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
/* font.c */
int pdf_fontcidtogid(pdf_fontdesc *fontdesc, int cid);
-fz_error *pdf_loadfontdescriptor(pdf_fontdesc *font, pdf_xref *xref, fz_obj *desc, char *collection);
-fz_error *pdf_loadfont(pdf_fontdesc **fontp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
+fz_error pdf_loadfontdescriptor(pdf_fontdesc *font, pdf_xref *xref, fz_obj *desc, char *collection);
+fz_error pdf_loadfont(pdf_fontdesc **fontp, pdf_xref *xref, fz_obj *obj, fz_obj *ref);
pdf_fontdesc * pdf_newfontdesc(void);
pdf_fontdesc * pdf_keepfont(pdf_fontdesc *fontdesc);
void pdf_dropfont(pdf_fontdesc *font);
@@ -527,18 +527,18 @@ struct pdf_outline_s
pdf_outline *next;
};
-fz_error *pdf_loadnametree(fz_obj **dictp, pdf_xref *xref, fz_obj *root);
-fz_error *pdf_loadnametrees(pdf_xref *xref);
+fz_error pdf_loadnametree(fz_obj **dictp, pdf_xref *xref, fz_obj *root);
+fz_error pdf_loadnametrees(pdf_xref *xref);
-fz_error *pdf_newlink(pdf_link**, fz_rect rect, fz_obj *dest);
-fz_error *pdf_loadlink(pdf_link **linkp, pdf_xref *xref, fz_obj *dict);
+fz_error pdf_newlink(pdf_link**, fz_rect rect, fz_obj *dest);
+fz_error pdf_loadlink(pdf_link **linkp, pdf_xref *xref, fz_obj *dict);
void pdf_droplink(pdf_link *link);
-fz_error *pdf_loadoutline(pdf_outline **outlinep, pdf_xref *xref);
+fz_error pdf_loadoutline(pdf_outline **outlinep, pdf_xref *xref);
void pdf_debugoutline(pdf_outline *outline, int level);
void pdf_dropoutline(pdf_outline *outline);
-fz_error *pdf_loadannots(pdf_comment **, pdf_link **, pdf_xref *, fz_obj *annots);
+fz_error pdf_loadannots(pdf_comment **, pdf_link **, pdf_xref *, fz_obj *annots);
/*
* Page tree, pages and related objects
@@ -581,7 +581,7 @@ struct pdf_textline_s
};
/* pagetree.c */
-fz_error *pdf_loadpagetree(pdf_pagetree **pp, pdf_xref *xref);
+fz_error pdf_loadpagetree(pdf_pagetree **pp, pdf_xref *xref);
int pdf_getpagecount(pdf_pagetree *pages);
fz_obj *pdf_getpageobject(pdf_pagetree *pages, int p);
fz_obj *pdf_getpagereference(pdf_pagetree *pages, int p);
@@ -589,13 +589,13 @@ void pdf_debugpagetree(pdf_pagetree *pages);
void pdf_droppagetree(pdf_pagetree *pages);
/* page.c */
-fz_error *pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *ref);
+fz_error pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *ref);
void pdf_droppage(pdf_page *page);
/* unicode.c */
-fz_error *pdf_loadtextfromtree(pdf_textline **linep, fz_tree *tree, fz_matrix ctm);
+fz_error pdf_loadtextfromtree(pdf_textline **linep, fz_tree *tree, fz_matrix ctm);
void pdf_debugtextline(pdf_textline *line);
-fz_error *pdf_newtextline(pdf_textline **linep);
+fz_error pdf_newtextline(pdf_textline **linep);
void pdf_droptextline(pdf_textline *line);
/*
@@ -689,26 +689,26 @@ struct pdf_csi_s
/* build.c */
void pdf_initgstate(pdf_gstate *gs);
-fz_error *pdf_setcolorspace(pdf_csi *csi, int what, fz_colorspace *cs);
-fz_error *pdf_setcolor(pdf_csi *csi, int what, float *v);
-fz_error *pdf_setpattern(pdf_csi *csi, int what, pdf_pattern *pat, float *v);
-fz_error *pdf_setshade(pdf_csi *csi, int what, fz_shade *shade);
-
-fz_error *pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path);
-fz_error *pdf_buildfillpath(pdf_gstate *gs, fz_pathnode *path, int evenodd);
-fz_error *pdf_addfillshape(pdf_gstate *gs, fz_node *shape);
-fz_error *pdf_addstrokeshape(pdf_gstate *gs, fz_node *shape);
-fz_error *pdf_addclipmask(pdf_gstate *gs, fz_node *shape);
-fz_error *pdf_addtransform(pdf_gstate *gs, fz_node *transform);
-fz_error *pdf_addshade(pdf_gstate *gs, fz_shade *shade);
-fz_error *pdf_showpath(pdf_csi*, int close, int fill, int stroke, int evenodd);
-fz_error *pdf_showtext(pdf_csi*, fz_obj *text);
-fz_error *pdf_flushtext(pdf_csi*);
-fz_error *pdf_showimage(pdf_csi*, pdf_image *img);
+fz_error pdf_setcolorspace(pdf_csi *csi, int what, fz_colorspace *cs);
+fz_error pdf_setcolor(pdf_csi *csi, int what, float *v);
+fz_error pdf_setpattern(pdf_csi *csi, int what, pdf_pattern *pat, float *v);
+fz_error pdf_setshade(pdf_csi *csi, int what, fz_shade *shade);
+
+fz_error pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path);
+fz_error pdf_buildfillpath(pdf_gstate *gs, fz_pathnode *path, int evenodd);
+fz_error pdf_addfillshape(pdf_gstate *gs, fz_node *shape);
+fz_error pdf_addstrokeshape(pdf_gstate *gs, fz_node *shape);
+fz_error pdf_addclipmask(pdf_gstate *gs, fz_node *shape);
+fz_error pdf_addtransform(pdf_gstate *gs, fz_node *transform);
+fz_error pdf_addshade(pdf_gstate *gs, fz_shade *shade);
+fz_error pdf_showpath(pdf_csi*, int close, int fill, int stroke, int evenodd);
+fz_error pdf_showtext(pdf_csi*, fz_obj *text);
+fz_error pdf_flushtext(pdf_csi*);
+fz_error pdf_showimage(pdf_csi*, pdf_image *img);
/* interpret.c */
-fz_error *pdf_newcsi(pdf_csi **csip, int maskonly);
-fz_error *pdf_runcsi(pdf_csi *, pdf_xref *xref, fz_obj *rdb, fz_stream *);
+fz_error pdf_newcsi(pdf_csi **csip, int maskonly);
+fz_error pdf_runcsi(pdf_csi *, pdf_xref *xref, fz_obj *rdb, fz_stream *);
void pdf_dropcsi(pdf_csi *csi);
#endif
diff --git a/mupdf/pdf_annot.c b/mupdf/pdf_annot.c
index 084122ef..6e634ba3 100644
--- a/mupdf/pdf_annot.c
+++ b/mupdf/pdf_annot.c
@@ -1,13 +1,13 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
loadcomment(pdf_comment **commentp, pdf_xref *xref, fz_obj *dict)
{
return fz_okay;
}
-fz_error *
+fz_error
pdf_newlink(pdf_link **linkp, fz_rect bbox, fz_obj *dest)
{
pdf_link *link;
@@ -70,10 +70,10 @@ resolvedest(pdf_xref *xref, fz_obj *dest)
return nil;
}
-fz_error *
+fz_error
pdf_loadlink(pdf_link **linkp, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
pdf_link *link;
fz_obj *dest;
fz_obj *action;
@@ -144,10 +144,10 @@ pdf_loadlink(pdf_link **linkp, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadannots(pdf_comment **cp, pdf_link **lp, pdf_xref *xref, fz_obj *annots)
{
- fz_error *error;
+ fz_error error;
pdf_comment *comment;
pdf_link *link;
fz_obj *subtype;
diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c
index f303a2c9..a1553957 100644
--- a/mupdf/pdf_build.c
+++ b/mupdf/pdf_build.c
@@ -42,7 +42,7 @@ pdf_initgstate(pdf_gstate *gs)
gs->head = nil;
}
-fz_error *
+fz_error
pdf_newovernode(fz_node **nodep, pdf_gstate *gs)
{
if (gs->blendmode == FZ_BNORMAL)
@@ -51,11 +51,11 @@ pdf_newovernode(fz_node **nodep, pdf_gstate *gs)
return fz_newblendnode(nodep, gs->blendmode, 0, 0);
}
-fz_error *
+fz_error
pdf_setcolorspace(pdf_csi *csi, int what, fz_colorspace *cs)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
pdf_material *mat;
error = pdf_flushtext(csi);
@@ -87,11 +87,11 @@ pdf_setcolorspace(pdf_csi *csi, int what, fz_colorspace *cs)
return fz_okay;
}
-fz_error *
+fz_error
pdf_setcolor(pdf_csi *csi, int what, float *v)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
pdf_indexed *ind;
pdf_material *mat;
int i, k;
@@ -138,11 +138,11 @@ Lindexed:
return fz_okay;
}
-fz_error *
+fz_error
pdf_setpattern(pdf_csi *csi, int what, pdf_pattern *pat, float *v)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
pdf_material *mat;
error = pdf_flushtext(csi);
@@ -170,11 +170,11 @@ pdf_setpattern(pdf_csi *csi, int what, pdf_pattern *pat, float *v)
return fz_okay;
}
-fz_error *
+fz_error
pdf_setshade(pdf_csi *csi, int what, fz_shade *shade)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
pdf_material *mat;
error = pdf_flushtext(csi);
@@ -192,10 +192,10 @@ pdf_setshade(pdf_csi *csi, int what, fz_shade *shade)
return fz_okay;
}
-fz_error *
+fz_error
pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path)
{
- fz_error *error;
+ fz_error error;
fz_stroke stroke;
fz_dash *dash;
@@ -223,20 +223,20 @@ pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path)
return fz_okay;
}
-fz_error *
+fz_error
pdf_buildfillpath(pdf_gstate *gs, fz_pathnode *path, int eofill)
{
- fz_error *error;
+ fz_error error;
error = fz_endpath(path, eofill ? FZ_EOFILL : FZ_FILL, nil, nil);
if (error)
return fz_rethrow(error, "cannot finish path node");
return fz_okay;
}
-static fz_error *
+static fz_error
addcolorshape(pdf_gstate *gs, fz_node *shape, float alpha, fz_colorspace *cs, float *v)
{
- fz_error *error;
+ fz_error error;
fz_node *mask;
fz_node *solid;
@@ -258,10 +258,10 @@ addcolorshape(pdf_gstate *gs, fz_node *shape, float alpha, fz_colorspace *cs, fl
return fz_okay;
}
-static fz_error *
+static fz_error
addinvisibleshape(pdf_gstate *gs, fz_node *shape)
{
- fz_error *error;
+ fz_error error;
fz_node *mask;
fz_pathnode *path;
@@ -305,11 +305,11 @@ static fz_matrix getmatrix(fz_node *node)
return fz_identity();
}
-static fz_error *
+static fz_error
addpatternshape(pdf_gstate *gs, fz_node *shape,
pdf_pattern *pat, fz_colorspace *cs, float *v)
{
- fz_error *error;
+ fz_error error;
fz_node *xform;
fz_node *over;
fz_node *mask;
@@ -397,10 +397,10 @@ addpatternshape(pdf_gstate *gs, fz_node *shape,
return fz_okay;
}
-fz_error *
+fz_error
pdf_addshade(pdf_gstate *gs, fz_shade *shade)
{
- fz_error *error;
+ fz_error error;
fz_node *node;
error = fz_newshadenode(&node, shade);
@@ -412,10 +412,10 @@ pdf_addshade(pdf_gstate *gs, fz_shade *shade)
return fz_okay;
}
-static fz_error *
+static fz_error
addshadeshape(pdf_gstate *gs, fz_node *shape, fz_shade *shade)
{
- fz_error *error;
+ fz_error error;
fz_node *mask;
fz_node *color;
fz_node *xform;
@@ -485,10 +485,10 @@ addshadeshape(pdf_gstate *gs, fz_node *shape, fz_shade *shade)
return fz_okay;
}
-fz_error *
+fz_error
pdf_addfillshape(pdf_gstate *gs, fz_node *shape)
{
- fz_error *error;
+ fz_error error;
switch (gs->fill.kind)
{
@@ -523,10 +523,10 @@ pdf_addfillshape(pdf_gstate *gs, fz_node *shape)
return fz_okay;
}
-fz_error *
+fz_error
pdf_addstrokeshape(pdf_gstate *gs, fz_node *shape)
{
- fz_error *error;
+ fz_error error;
switch (gs->stroke.kind)
{
@@ -561,10 +561,10 @@ pdf_addstrokeshape(pdf_gstate *gs, fz_node *shape)
return fz_okay;
}
-fz_error *
+fz_error
pdf_addclipmask(pdf_gstate *gs, fz_node *shape)
{
- fz_error *error;
+ fz_error error;
fz_node *mask;
fz_node *over;
@@ -587,10 +587,10 @@ pdf_addclipmask(pdf_gstate *gs, fz_node *shape)
return fz_okay;
}
-fz_error *
+fz_error
pdf_addtransform(pdf_gstate *gs, fz_node *transform)
{
- fz_error *error;
+ fz_error error;
fz_node *over;
error = pdf_newovernode(&over, gs);
@@ -604,10 +604,10 @@ pdf_addtransform(pdf_gstate *gs, fz_node *transform)
return fz_okay;
}
-fz_error *
+fz_error
pdf_showimage(pdf_csi *csi, pdf_image *img)
{
- fz_error *error;
+ fz_error error;
fz_node *mask;
fz_node *color;
fz_node *shape;
@@ -656,12 +656,12 @@ pdf_showimage(pdf_csi *csi, pdf_image *img)
return fz_okay;
}
-fz_error *
+fz_error
pdf_showpath(pdf_csi *csi,
int doclose, int dofill, int dostroke, int evenodd)
{
pdf_gstate *gstate = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
char *reason;
fz_pathnode *spath = nil;
fz_pathnode *fpath = nil;
@@ -785,11 +785,11 @@ cleanupclip:
* Text
*/
-fz_error *
+fz_error
pdf_flushtext(pdf_csi *csi)
{
pdf_gstate *gstate = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
if (csi->text)
{
@@ -847,12 +847,12 @@ pdf_flushtext(pdf_csi *csi)
return fz_okay;
}
-fz_error *
+fz_error
showglyph(pdf_csi *csi, int cid)
{
pdf_gstate *gstate = csi->gstate + csi->gtop;
pdf_fontdesc *fontdesc = gstate->font;
- fz_error *error;
+ fz_error error;
fz_matrix tsm, trm;
float w0, w1, tx, ty;
pdf_hmtx h;
@@ -941,12 +941,12 @@ showspace(pdf_csi *csi, float tadj)
csi->tm = fz_concat(fz_translate(0, tadj), csi->tm);
}
-fz_error *
+fz_error
pdf_showtext(pdf_csi *csi, fz_obj *text)
{
pdf_gstate *gstate = csi->gstate + csi->gtop;
pdf_fontdesc *fontdesc = gstate->font;
- fz_error *error;
+ fz_error error;
unsigned char *buf;
unsigned char *end;
int i, len;
diff --git a/mupdf/pdf_cmap.c b/mupdf/pdf_cmap.c
index 9ffc41a2..ed383af4 100644
--- a/mupdf/pdf_cmap.c
+++ b/mupdf/pdf_cmap.c
@@ -22,7 +22,7 @@
* Allocate, destroy and simple parameters.
*/
-fz_error *
+fz_error
pdf_newcmap(pdf_cmap **cmapp)
{
pdf_cmap *cmap;
@@ -163,7 +163,7 @@ pdf_debugcmap(pdf_cmap *cmap)
* These ranges are used by pdf_decodecmap to decode
* multi-byte encoded strings.
*/
-fz_error *
+fz_error
pdf_addcodespace(pdf_cmap *cmap, int low, int high, int n)
{
if (cmap->ncspace + 1 == nelem(cmap->cspace))
@@ -181,7 +181,7 @@ pdf_addcodespace(pdf_cmap *cmap, int low, int high, int n)
/*
* Add an integer to the table.
*/
-static fz_error *
+static fz_error
addtable(pdf_cmap *cmap, int value)
{
if (cmap->tlen + 1 > cmap->tcap)
@@ -202,7 +202,7 @@ addtable(pdf_cmap *cmap, int value)
/*
* Add a range.
*/
-static fz_error *
+static fz_error
addrange(pdf_cmap *cmap, int low, int high, int flag, int offset)
{
if (cmap->rlen + 1 > cmap->rcap)
@@ -228,10 +228,10 @@ addrange(pdf_cmap *cmap, int low, int high, int flag, int offset)
/*
* Add a range-to-table mapping.
*/
-fz_error *
+fz_error
pdf_maprangetotable(pdf_cmap *cmap, int low, int *table, int len)
{
- fz_error *error;
+ fz_error error;
int offset;
int high;
int i;
@@ -256,10 +256,10 @@ pdf_maprangetotable(pdf_cmap *cmap, int low, int *table, int len)
/*
* Add a range of contiguous one-to-one mappings (ie 1..5 maps to 21..25)
*/
-fz_error *
+fz_error
pdf_maprangetorange(pdf_cmap *cmap, int low, int high, int offset)
{
- fz_error *error;
+ fz_error error;
error = addrange(cmap, low, high, high - low == 0 ? PDF_CMAP_SINGLE : PDF_CMAP_RANGE, offset);
if (error)
return fz_rethrow(error, "cannot add range-to-range mapping");
@@ -269,10 +269,10 @@ pdf_maprangetorange(pdf_cmap *cmap, int low, int high, int offset)
/*
* Add a single one-to-many mapping.
*/
-fz_error *
+fz_error
pdf_maponetomany(pdf_cmap *cmap, int low, int *values, int len)
{
- fz_error *error;
+ fz_error error;
int offset;
int i;
@@ -315,10 +315,10 @@ static int cmprange(const void *va, const void *vb)
return ((const pdf_range*)va)->low - ((const pdf_range*)vb)->low;
}
-fz_error *
+fz_error
pdf_sortcmap(pdf_cmap *cmap)
{
- fz_error *error;
+ fz_error error;
pdf_range *newranges;
unsigned short *newtable;
pdf_range *a; /* last written range on output */
diff --git a/mupdf/pdf_cmap_load.c b/mupdf/pdf_cmap_load.c
index f0eb12ef..c8a0e18c 100644
--- a/mupdf/pdf_cmap_load.c
+++ b/mupdf/pdf_cmap_load.c
@@ -4,10 +4,10 @@
/*
* Load CMap stream in PDF file
*/
-fz_error *
+fz_error
pdf_loadembeddedcmap(pdf_cmap **cmapp, pdf_xref *xref, fz_obj *stmref)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
fz_obj *stmobj = stmref;
fz_stream *file;
pdf_cmap *cmap = nil;
@@ -100,10 +100,10 @@ cleanup:
/*
* Create an Identity-* CMap (for both 1 and 2-byte encodings)
*/
-fz_error *
+fz_error
pdf_newidentitycmap(pdf_cmap **cmapp, int wmode, int bytes)
{
- fz_error *error;
+ fz_error error;
pdf_cmap *cmap;
error = pdf_newcmap(&cmap);
@@ -139,10 +139,10 @@ pdf_newidentitycmap(pdf_cmap **cmapp, int wmode, int bytes)
/*
* Load predefined CMap from system.
*/
-fz_error *
+fz_error
pdf_loadsystemcmap(pdf_cmap **cmapp, char *cmapname)
{
- fz_error *error;
+ fz_error error;
pdf_cmap *usecmap;
pdf_cmap *cmap;
int i;
diff --git a/mupdf/pdf_cmap_parse.c b/mupdf/pdf_cmap_parse.c
index b474469c..cf7dec77 100644
--- a/mupdf/pdf_cmap_parse.c
+++ b/mupdf/pdf_cmap_parse.c
@@ -44,9 +44,9 @@ static int codefromstring(char *buf, int len)
return a;
}
-static fz_error *lexcmap(pdf_token_e *tok, fz_stream *file, char *buf, int n, int *sl)
+static fz_error lexcmap(pdf_token_e *tok, fz_stream *file, char *buf, int n, int *sl)
{
- fz_error *error;
+ fz_error error;
error = pdf_lex(tok, file, buf, n, sl);
if (error)
@@ -58,9 +58,9 @@ static fz_error *lexcmap(pdf_token_e *tok, fz_stream *file, char *buf, int n, in
return fz_okay;
}
-static fz_error *parsecmapname(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsecmapname(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -78,9 +78,9 @@ static fz_error *parsecmapname(pdf_cmap *cmap, fz_stream *file)
return fz_throw("expected name");
}
-static fz_error *parsewmode(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsewmode(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -98,9 +98,9 @@ static fz_error *parsewmode(pdf_cmap *cmap, fz_stream *file)
return fz_throw("expected integer");
}
-static fz_error *parsecodespacerange(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsecodespacerange(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -137,9 +137,9 @@ static fz_error *parsecodespacerange(pdf_cmap *cmap, fz_stream *file)
return fz_throw("expected string or endcodespacerange");
}
-static fz_error *parsecidrange(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsecidrange(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -181,9 +181,9 @@ static fz_error *parsecidrange(pdf_cmap *cmap, fz_stream *file)
}
}
-static fz_error *parsecidchar(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsecidchar(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -217,9 +217,9 @@ static fz_error *parsecidchar(pdf_cmap *cmap, fz_stream *file)
}
}
-static fz_error *parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int hi)
+static fz_error parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int hi)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -253,9 +253,9 @@ static fz_error *parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int
}
}
-static fz_error *parsebfrange(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsebfrange(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -332,9 +332,9 @@ static fz_error *parsebfrange(pdf_cmap *cmap, fz_stream *file)
}
}
-static fz_error *parsebfchar(pdf_cmap *cmap, fz_stream *file)
+static fz_error parsebfchar(pdf_cmap *cmap, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[256];
pdf_token_e tok;
int len;
@@ -375,10 +375,10 @@ static fz_error *parsebfchar(pdf_cmap *cmap, fz_stream *file)
}
}
-fz_error *
+fz_error
pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
pdf_cmap *cmap;
char key[64];
char buf[256];
diff --git a/mupdf/pdf_colorspace1.c b/mupdf/pdf_colorspace1.c
index 10b24615..65fd5c2c 100644
--- a/mupdf/pdf_colorspace1.c
+++ b/mupdf/pdf_colorspace1.c
@@ -224,10 +224,10 @@ fz_colorspace *pdf_devicepattern = &kdevicepattern;
#ifdef USECAL
-static fz_error *
+static fz_error
loadcalgray(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
struct calgray *cs;
fz_obj *tmp;
@@ -279,10 +279,10 @@ loadcalgray(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-static fz_error *
+static fz_error
loadcalrgb(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
struct calrgb *cs;
fz_obj *tmp;
int i;
@@ -354,10 +354,10 @@ loadcalrgb(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-static fz_error *
+static fz_error
loadlab(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
struct cielab *cs;
fz_obj *tmp;
@@ -423,10 +423,10 @@ loadlab(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict)
* ICCBased
*/
-static fz_error *
+static fz_error
loadiccbased(fz_colorspace **csp, pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *dict;
int n;
@@ -464,7 +464,7 @@ struct separation
static void separationtoxyz(fz_colorspace *fzcs, float *sep, float *xyz)
{
struct separation *cs = (struct separation *)fzcs;
- fz_error *error;
+ fz_error error;
float alt[FZ_MAXCOLORS];
error = pdf_evalfunction(cs->tint, sep, fzcs->n, alt, cs->base->n);
@@ -488,10 +488,10 @@ dropseparation(fz_colorspace *fzcs)
pdf_dropfunction(cs->tint);
}
-static fz_error *
+static fz_error
loadseparation(fz_colorspace **csp, pdf_xref *xref, fz_obj *array)
{
- fz_error *error;
+ fz_error error;
struct separation *cs;
fz_obj *nameobj = fz_arrayget(array, 1);
fz_obj *baseobj = fz_arrayget(array, 2);
@@ -574,10 +574,10 @@ dropindexed(fz_colorspace *fzcs)
if (cs->lookup) fz_free(cs->lookup);
}
-static fz_error *
+static fz_error
loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array)
{
- fz_error *error;
+ fz_error error;
pdf_indexed *cs;
fz_obj *baseobj = fz_arrayget(array, 1);
fz_obj *highobj = fz_arrayget(array, 2);
@@ -662,7 +662,7 @@ loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array)
* Parse and create colorspace from PDF object.
*/
-fz_error *
+fz_error
pdf_loadcolorspace(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj)
{
if (fz_isname(obj))
@@ -729,7 +729,7 @@ pdf_loadcolorspace(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj)
/* load base colorspace instead */
else if (!strcmp(fz_toname(name), "Pattern"))
{
- fz_error *error;
+ fz_error error;
obj = fz_arrayget(obj, 1);
if (!obj)
diff --git a/mupdf/pdf_crypt.c b/mupdf/pdf_crypt.c
index 25de59e3..176de260 100644
--- a/mupdf/pdf_crypt.c
+++ b/mupdf/pdf_crypt.c
@@ -45,7 +45,7 @@ static void padpassword(unsigned char *buf, unsigned char *pw, int pwlen)
memcpy(buf + pwlen, padding, 32 - pwlen);
}
-static fz_error *
+static fz_error
pdf_parsecryptfilt(fz_obj *filters, char *filter, char **method, int *length)
{
fz_obj *cryptfilt;
@@ -77,11 +77,11 @@ cleanup:
return fz_throw("corrupt encryption filter dictionary");
}
-static fz_error *
+static fz_error
pdf_parseencdict(pdf_crypt *crypt, fz_obj *enc)
{
fz_obj *obj;
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
obj = fz_dictgets(enc, "Filter");
if (!fz_isname(obj))
@@ -173,11 +173,11 @@ cleanup:
* Create crypt object for decrypting given the
* Encoding dictionary and file ID
*/
-fz_error *
+fz_error
pdf_newdecrypt(pdf_crypt **cp, fz_obj *enc, fz_obj *id)
{
pdf_crypt *crypt;
- fz_error *error;
+ fz_error error;
fz_obj *obj;
crypt = fz_malloc(sizeof(pdf_crypt));
@@ -449,10 +449,10 @@ createuser(pdf_crypt *crypt, unsigned char *userpw, int pwlen)
* Create crypt object for encrypting, given passwords,
* permissions, and file ID
*/
-fz_error *
+fz_error
pdf_newencrypt(pdf_crypt **cp, char *userpw, char *ownerpw, int p, int n, fz_obj *id)
{
- fz_error *error;
+ fz_error error;
pdf_crypt *crypt;
crypt = fz_malloc(sizeof(pdf_crypt));
@@ -647,10 +647,10 @@ pdf_cryptbuffer(pdf_crypt *crypt, fz_buffer *buf, int oid, int gen)
/*
* Create filter suitable for de/encrypting a stream
*/
-fz_error *
+fz_error
pdf_cryptstream(fz_filter **fp, pdf_crypt *crypt, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
unsigned char key[16];
createobjkey(crypt, oid, gen, key);
error = fz_newarc4filter(fp, key, crypt->keylen);
diff --git a/mupdf/pdf_font.c b/mupdf/pdf_font.c
index aeb9de92..c830aed0 100644
--- a/mupdf/pdf_font.c
+++ b/mupdf/pdf_font.c
@@ -209,10 +209,10 @@ pdf_newfontdesc(void)
* Simple fonts (Type1 and TrueType)
*/
-static fz_error *
+static fz_error
loadsimplefont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *descriptor = nil;
fz_obj *encoding = nil;
fz_obj *widths = nil;
@@ -511,10 +511,10 @@ cleanup:
* CID Fonts
*/
-static fz_error *
+static fz_error
loadcidfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref, fz_obj *encoding, fz_obj *tounicode)
{
- fz_error *error;
+ fz_error error;
fz_obj *widths = nil;
fz_obj *descriptor;
pdf_fontdesc *fontdesc;
@@ -826,10 +826,10 @@ cleanup:
return fz_rethrow(error, "cannot load cid font");
}
-static fz_error *
+static fz_error
loadtype0(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *dfonts;
fz_obj *dfont;
fz_obj *subtype;
@@ -873,10 +873,10 @@ loadtype0(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
* FontDescriptor
*/
-fz_error *
+fz_error
pdf_loadfontdescriptor(pdf_fontdesc *fontdesc, pdf_xref *xref, fz_obj *dict, char *collection)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj1, *obj2, *obj3, *obj;
fz_rect bbox;
char *fontname;
@@ -943,10 +943,10 @@ cleanup:
return fz_rethrow(error, "cannot load font descriptor");
}
-fz_error *
+fz_error
pdf_loadfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
char *subtype;
if ((*fontdescp = pdf_finditem(xref->store, PDF_KFONT, ref)))
diff --git a/mupdf/pdf_fontfile.c b/mupdf/pdf_fontfile.c
index ef1e5d67..cd525be3 100644
--- a/mupdf/pdf_fontfile.c
+++ b/mupdf/pdf_fontfile.c
@@ -107,10 +107,10 @@ static const struct
{ 0, 0, 0 }
};
-fz_error *
+fz_error
pdf_loadbuiltinfont(pdf_fontdesc *font, char *fontname)
{
- fz_error *error;
+ fz_error error;
unsigned char *data;
unsigned int len;
int i;
@@ -134,11 +134,11 @@ found:
return fz_okay;
}
-static fz_error *
+static fz_error
loadsystemcidfont(pdf_fontdesc *font, int csi, int kind)
{
#ifndef NOCJK
- fz_error *error;
+ fz_error error;
/* We only have one builtin fallback font, we'd really like
* to have one for each combination of CSI and Kind.
*/
@@ -155,10 +155,10 @@ loadsystemcidfont(pdf_fontdesc *font, int csi, int kind)
#endif
}
-fz_error *
+fz_error
pdf_loadsystemfont(pdf_fontdesc *font, char *fontname, char *collection)
{
- fz_error *error;
+ fz_error error;
char *name;
int isbold = 0;
@@ -260,10 +260,10 @@ pdf_loadsystemfont(pdf_fontdesc *font, char *fontname, char *collection)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadembeddedfont(pdf_fontdesc *font, pdf_xref *xref, fz_obj *stmref)
{
- fz_error *error;
+ fz_error error;
fz_buffer *buf;
pdf_logfont("load embedded font\n");
diff --git a/mupdf/pdf_fontmtx.c b/mupdf/pdf_fontmtx.c
index cf1560f8..9b56a4e1 100644
--- a/mupdf/pdf_fontmtx.c
+++ b/mupdf/pdf_fontmtx.c
@@ -20,7 +20,7 @@ pdf_setdefaultvmtx(pdf_fontdesc *font, int y, int w)
font->dvmtx.w = w;
}
-fz_error *
+fz_error
pdf_addhmtx(pdf_fontdesc *font, int lo, int hi, int w)
{
int newcap;
@@ -44,7 +44,7 @@ pdf_addhmtx(pdf_fontdesc *font, int lo, int hi, int w)
return fz_okay;
}
-fz_error *
+fz_error
pdf_addvmtx(pdf_fontdesc *font, int lo, int hi, int x, int y, int w)
{
int newcap;
@@ -84,7 +84,7 @@ static int cmpv(const void *a0, const void *b0)
return a->lo - b->lo;
}
-fz_error *
+fz_error
pdf_endhmtx(pdf_fontdesc *font)
{
pdf_hmtx *newmtx;
@@ -103,7 +103,7 @@ pdf_endhmtx(pdf_fontdesc *font)
return fz_okay;
}
-fz_error *
+fz_error
pdf_endvmtx(pdf_fontdesc *font)
{
pdf_vmtx *newmtx;
diff --git a/mupdf/pdf_function.c b/mupdf/pdf_function.c
index 7866497e..dafd5b2d 100644
--- a/mupdf/pdf_function.c
+++ b/mupdf/pdf_function.c
@@ -144,7 +144,7 @@ pschecktype(psstack *st, unsigned short type)
return st->stack[st->sp].type == type;
}
-static fz_error *
+static fz_error
pspushbool(psstack *st, int booln)
{
if (!pscheckoverflow(st, 1))
@@ -154,7 +154,7 @@ pspushbool(psstack *st, int booln)
return fz_okay;
}
-static fz_error *
+static fz_error
pspushint(psstack *st, int intg)
{
if (!pscheckoverflow(st, 1))
@@ -164,7 +164,7 @@ pspushint(psstack *st, int intg)
return fz_okay;
}
-static fz_error *
+static fz_error
pspushreal(psstack *st, float real)
{
if (!pscheckoverflow(st, 1))
@@ -174,7 +174,7 @@ pspushreal(psstack *st, float real)
return fz_okay;
}
-static fz_error *
+static fz_error
pspopbool(psstack *st, int *booln)
{
if (!pscheckunderflow(st))
@@ -185,7 +185,7 @@ pspopbool(psstack *st, int *booln)
return fz_okay;
}
-static fz_error *
+static fz_error
pspopint(psstack *st, int *intg)
{
if (!pscheckunderflow(st))
@@ -196,7 +196,7 @@ pspopint(psstack *st, int *intg)
return fz_okay;
}
-static fz_error *
+static fz_error
pspopnum(psstack *st, float *real)
{
if (!pscheckunderflow(st))
@@ -237,7 +237,7 @@ pstoptwoarenums(psstack *st)
(st->stack[st->sp + 1].type == PSINT || st->stack[st->sp + 1].type == PSREAL);
}
-static fz_error *
+static fz_error
pscopy(psstack *st, int n)
{
int i;
@@ -288,7 +288,7 @@ psroll(psstack *st, int n, int j)
}
}
-static fz_error *
+static fz_error
psindex(psstack *st, int i)
{
if (!pscheckoverflow(st, 1))
@@ -298,7 +298,7 @@ psindex(psstack *st, int i)
return fz_okay;
}
-static fz_error *
+static fz_error
pspop(psstack *st)
{
if (!pscheckoverflow(st, 1))
@@ -307,7 +307,7 @@ pspop(psstack *st)
return fz_okay;
}
-static fz_error *
+static fz_error
resizecode(pdf_function *func, int newsize)
{
if (newsize >= func->u.p.cap)
@@ -323,10 +323,10 @@ resizecode(pdf_function *func, int newsize)
return fz_okay;
}
-static fz_error *
+static fz_error
parsecode(pdf_function *func, fz_stream *stream, int *codeptr)
{
- fz_error *error;
+ fz_error error;
char buf[64];
int len;
pdf_token_e tok;
@@ -471,10 +471,10 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr)
}
}
-static fz_error *
+static fz_error
loadpostscriptfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_stream *stream;
int codeptr;
@@ -516,10 +516,10 @@ loadpostscriptfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict, int oid, in
#define SAFE_INDEX(st, i) { error = psindex(st, i); SAFE_RETHROW; }
#define SAFE_COPY(st, n) { error = pscopy(st, n); SAFE_RETHROW; }
-static fz_error *
+static fz_error
evalpostscriptfunc(pdf_function *func, psstack *st, int codeptr)
{
- fz_error *error;
+ fz_error error;
int i1, i2;
float r1, r2;
int b1, b2;
@@ -931,10 +931,10 @@ evalpostscriptfunc(pdf_function *func, psstack *st, int codeptr)
static int bps_supported[] = { 1, 2, 4, 8, 12, 16, 24, 32 };
-static fz_error *
+static fz_error
loadsamplefunc(pdf_function *func, pdf_xref *xref, fz_obj *dict, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_stream *stream;
fz_obj *obj;
int samplecount;
@@ -1073,7 +1073,7 @@ loadsamplefunc(pdf_function *func, pdf_xref *xref, fz_obj *dict, int oid, int ge
return fz_okay;
}
-static fz_error *
+static fz_error
evalsamplefunc(pdf_function *func, float *in, float *out)
{
float x;
@@ -1143,7 +1143,7 @@ evalsamplefunc(pdf_function *func, float *in, float *out)
* Exponential function
*/
-static fz_error *
+static fz_error
loadexponentialfunc(pdf_function *func, fz_obj *dict)
{
fz_obj *obj;
@@ -1195,7 +1195,7 @@ loadexponentialfunc(pdf_function *func, fz_obj *dict)
return fz_okay;
}
-static fz_error *
+static fz_error
evalexponentialfunc(pdf_function *func, float in, float *out)
{
float x = in;
@@ -1225,11 +1225,11 @@ evalexponentialfunc(pdf_function *func, float in, float *out)
* Stitching function
*/
-static fz_error *
+static fz_error
loadstitchingfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict)
{
pdf_function **funcs = func->u.st.funcs;
- fz_error *error;
+ fz_error error;
fz_obj *obj;
fz_obj *sub;
fz_obj *num;
@@ -1351,10 +1351,10 @@ loadstitchingfunc(pdf_function *func, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-static fz_error*
+static fz_error
evalstitchingfunc(pdf_function *func, float in, float *out)
{
- fz_error *error;
+ fz_error error;
float low, high;
int k = func->u.st.k;
float *bounds = func->u.st.bounds;
@@ -1434,10 +1434,10 @@ pdf_dropfunction(pdf_function *func)
}
}
-fz_error *
+fz_error
pdf_loadfunction(pdf_function **funcp, pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_function *func;
fz_obj *dict;
fz_obj *obj;
@@ -1571,10 +1571,10 @@ pdf_loadfunction(pdf_function **funcp, pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-fz_error *
+fz_error
pdf_evalfunction(pdf_function *func, float *in, int inlen, float *out, int outlen)
{
- fz_error *error;
+ fz_error error;
float r;
int i;
diff --git a/mupdf/pdf_image.c b/mupdf/pdf_image.c
index d81cf14c..ad43167c 100644
--- a/mupdf/pdf_image.c
+++ b/mupdf/pdf_image.c
@@ -13,11 +13,11 @@ void pdf_dropimage(fz_image *fzimg)
fz_dropimage(img->mask);
}
-fz_error *
+fz_error
pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref,
fz_obj *rdb, fz_obj *dict, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
pdf_image *img;
fz_filter *filter;
fz_obj *f;
@@ -202,10 +202,10 @@ loadcolorkey(int *colorkey, int bpc, int indexed, fz_obj *obj)
}
/* TODO error cleanup */
-fz_error *
+fz_error
pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_image *img;
pdf_image *mask;
int ismask;
@@ -512,12 +512,12 @@ maskcolorkeyindexed(fz_pixmap *ind, fz_pixmap *pix, int *colorkey)
}
}
-fz_error *
+fz_error
pdf_loadtile(fz_image *img, fz_pixmap *tile)
{
pdf_image *src = (pdf_image*)img;
void (*tilefunc)(unsigned char*,int,unsigned char*, int, int, int, int);
- fz_error *error;
+ fz_error error;
assert(tile->x == 0); /* can't handle general tile yet, only y-banding */
diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c
index e3bdead2..eb573a1f 100644
--- a/mupdf/pdf_interpret.c
+++ b/mupdf/pdf_interpret.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-fz_error *
+fz_error
pdf_newcsi(pdf_csi **csip, int maskonly)
{
- fz_error *error;
+ fz_error error;
pdf_csi *csi;
fz_node *node;
@@ -94,7 +94,7 @@ pdf_dropmaterial(pdf_material *mat)
return mat;
}
-static fz_error *
+static fz_error
gsave(pdf_csi *csi)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
@@ -112,7 +112,7 @@ gsave(pdf_csi *csi)
return fz_okay;
}
-static fz_error *
+static fz_error
grestore(pdf_csi *csi)
{
pdf_gstate *gs = csi->gstate + csi->gtop;
@@ -154,10 +154,10 @@ pdf_dropcsi(pdf_csi *csi)
* Push gstate, set transform, clip, run, pop gstate.
*/
-static fz_error *
+static fz_error
runxobject(pdf_csi *csi, pdf_xref *xref, pdf_xobject *xobj, int istransparency)
{
- fz_error *error;
+ fz_error error;
fz_node *transform;
fz_node *blend;
fz_stream *file;
@@ -225,10 +225,10 @@ runxobject(pdf_csi *csi, pdf_xref *xref, pdf_xobject *xobj, int istransparency)
* Decode inline image and insert into page.
*/
-static fz_error *
+static fz_error
runinlineimage(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
pdf_image *img;
char buf[256];
pdf_token_e tok;
@@ -266,7 +266,7 @@ runinlineimage(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file, fz_ob
* Set gstate params from an ExtGState dictionary.
*/
-static fz_error *
+static fz_error
runextgstate(pdf_gstate *gstate, pdf_xref *xref, fz_obj *extgstate)
{
int i, k;
@@ -320,7 +320,7 @@ runextgstate(pdf_gstate *gstate, pdf_xref *xref, fz_obj *extgstate)
else if (!strcmp(s, "BM"))
{
- fz_error *error;
+ fz_error error;
fz_node *blend;
static const struct { const char *name; fz_blendkind mode; } bm[] = {
{ "Normal", FZ_BNORMAL },
@@ -362,7 +362,7 @@ runextgstate(pdf_gstate *gstate, pdf_xref *xref, fz_obj *extgstate)
else if (!strcmp(s, "SMask"))
{
- fz_error *error = pdf_resolve(&val, xref);
+ fz_error error = pdf_resolve(&val, xref);
if (error)
return error;
if (fz_isdict(val))
@@ -386,11 +386,11 @@ runextgstate(pdf_gstate *gstate, pdf_xref *xref, fz_obj *extgstate)
* The meat of the interpreter...
*/
-static fz_error *
+static fz_error
runkeyword(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, char *buf)
{
pdf_gstate *gstate = csi->gstate + csi->gtop;
- fz_error *error;
+ fz_error error;
float a, b, c, d, e, f;
float x, y, w, h;
fz_matrix m;
@@ -1245,10 +1245,10 @@ syntaxerror:
return fz_throw("syntaxerror near '%s'", buf);
}
-fz_error *
+fz_error
pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file)
{
- fz_error *error;
+ fz_error error;
char buf[65536];
pdf_token_e tok;
int len;
diff --git a/mupdf/pdf_lex.c b/mupdf/pdf_lex.c
index 927f464f..530de913 100644
--- a/mupdf/pdf_lex.c
+++ b/mupdf/pdf_lex.c
@@ -252,10 +252,10 @@ pdf_tokenfromkeyword(char *key)
return PDF_TKEYWORD;
}
-fz_error *
+fz_error
pdf_lex(pdf_token_e *tok, fz_stream *f, char *buf, int n, int *sl)
{
- fz_error *error;
+ fz_error error;
int c;
while (1)
diff --git a/mupdf/pdf_nametree.c b/mupdf/pdf_nametree.c
index 9ebb87b4..b90421de 100644
--- a/mupdf/pdf_nametree.c
+++ b/mupdf/pdf_nametree.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
loadnametreenode(fz_obj *tree, pdf_xref *xref, fz_obj *node)
{
- fz_error *error;
+ fz_error error;
fz_obj *names;
fz_obj *kids;
fz_obj *key;
@@ -72,10 +72,10 @@ loadnametreenode(fz_obj *tree, pdf_xref *xref, fz_obj *node)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadnametree(fz_obj **dictp, pdf_xref *xref, fz_obj *root)
{
- fz_error *error;
+ fz_error error;
fz_obj *tree;
error = fz_newdict(&tree, 128);
@@ -95,10 +95,10 @@ pdf_loadnametree(fz_obj **dictp, pdf_xref *xref, fz_obj *root)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadnametrees(pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
fz_obj *names;
fz_obj *dests;
diff --git a/mupdf/pdf_open.c b/mupdf/pdf_open.c
index d6948c32..9623f6cc 100644
--- a/mupdf/pdf_open.c
+++ b/mupdf/pdf_open.c
@@ -12,10 +12,10 @@ static inline int iswhite(int ch)
* magic version tag and startxref
*/
-static fz_error *
+static fz_error
loadversion(pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
char buf[20];
error = fz_seek(xref->file, 0, 0);
@@ -35,10 +35,10 @@ loadversion(pdf_xref *xref)
return fz_okay;
}
-static fz_error *
+static fz_error
readstartxref(pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
unsigned char buf[1024];
int t, n;
int i;
@@ -75,10 +75,10 @@ readstartxref(pdf_xref *xref)
* trailer dictionary
*/
-static fz_error *
+static fz_error
readoldtrailer(pdf_xref *xref, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
int ofs, len;
char *s;
int n;
@@ -147,10 +147,10 @@ readoldtrailer(pdf_xref *xref, char *buf, int cap)
return fz_okay;
}
-static fz_error *
+static fz_error
readnewtrailer(pdf_xref *xref, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
pdf_logxref("load new xref format trailer\n");
@@ -160,10 +160,10 @@ readnewtrailer(pdf_xref *xref, char *buf, int cap)
return fz_okay;
}
-static fz_error *
+static fz_error
readtrailer(pdf_xref *xref, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
int c;
error = fz_seek(xref->file, xref->startxref, 0);
@@ -199,10 +199,10 @@ readtrailer(pdf_xref *xref, char *buf, int cap)
* xref tables
*/
-static fz_error *
+static fz_error
readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
int ofs, len;
char *s;
int n;
@@ -298,10 +298,10 @@ readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap)
return fz_okay;
}
-static fz_error *
+static fz_error
readnewxrefsection(pdf_xref *xref, fz_stream *stm, int i0, int i1, int w0, int w1, int w2)
{
- fz_error *error;
+ fz_error error;
int i, n;
if (i0 < 0 || i0 + i1 > xref->len)
@@ -344,10 +344,10 @@ readnewxrefsection(pdf_xref *xref, fz_stream *stm, int i0, int i1, int w0, int w
return fz_okay;
}
-static fz_error *
+static fz_error
readnewxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
fz_obj *trailer;
fz_obj *index;
@@ -441,10 +441,10 @@ readnewxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap)
return fz_okay;
}
-static fz_error *
+static fz_error
readxref(fz_obj **trailerp, pdf_xref *xref, int ofs, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
int c;
error = fz_seek(xref->file, ofs, 0);
@@ -476,10 +476,10 @@ readxref(fz_obj **trailerp, pdf_xref *xref, int ofs, char *buf, int cap)
return fz_okay;
}
-static fz_error *
+static fz_error
readxrefsections(pdf_xref *xref, int ofs, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
fz_obj *trailer;
fz_obj *prev;
fz_obj *xrefstm;
@@ -521,10 +521,10 @@ readxrefsections(pdf_xref *xref, int ofs, char *buf, int cap)
* compressed object streams
*/
-fz_error *
+fz_error
pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
fz_obj *objstm;
int *oidbuf;
@@ -637,10 +637,10 @@ cleanupobj:
* open and load xref tables from pdf
*/
-fz_error *
+fz_error
pdf_loadxref(pdf_xref *xref, char *filename)
{
- fz_error *error;
+ fz_error error;
fz_obj *size;
int i;
diff --git a/mupdf/pdf_outline.c b/mupdf/pdf_outline.c
index f5a9af27..bcd98038 100644
--- a/mupdf/pdf_outline.c
+++ b/mupdf/pdf_outline.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
loadoutline(pdf_outline **nodep, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
pdf_outline *node;
fz_obj *obj;
@@ -65,10 +65,10 @@ loadoutline(pdf_outline **nodep, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadoutline(pdf_outline **nodep, pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
pdf_outline *node;
fz_obj *obj;
fz_obj *first;
diff --git a/mupdf/pdf_page.c b/mupdf/pdf_page.c
index 995ca690..b308a76d 100644
--- a/mupdf/pdf_page.c
+++ b/mupdf/pdf_page.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
runone(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_obj *stmref)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
pdf_logpage("simple content stream\n");
@@ -26,10 +26,10 @@ runone(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_obj *stmref)
/* we need to combine all sub-streams into one for pdf_runcsi
* to deal with split dictionaries etc.
*/
-static fz_error *
+static fz_error
runmany(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_obj *list)
{
- fz_error *error;
+ fz_error error;
fz_stream *file;
fz_buffer *big;
fz_buffer *one;
@@ -92,10 +92,10 @@ runmany(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_obj *list)
return fz_okay;
}
-static fz_error *
+static fz_error
loadpagecontents(fz_tree **treep, pdf_xref *xref, fz_obj *rdb, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
pdf_csi *csi;
@@ -150,10 +150,10 @@ loadpagecontents(fz_tree **treep, pdf_xref *xref, fz_obj *rdb, fz_obj *ref)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadpage(pdf_page **pagep, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
pdf_page *page;
fz_obj *rdb;
diff --git a/mupdf/pdf_pagetree.c b/mupdf/pdf_pagetree.c
index dc241476..4f75b77f 100644
--- a/mupdf/pdf_pagetree.c
+++ b/mupdf/pdf_pagetree.c
@@ -9,11 +9,11 @@ struct stuff
fz_obj *rotate;
};
-static fz_error *
+static fz_error
loadpagetree(pdf_xref *xref, pdf_pagetree *pages,
struct stuff inherit, fz_obj *obj, fz_obj *ref, int *pagenum)
{
- fz_error *error;
+ fz_error error;
fz_obj *type;
fz_obj *kids;
fz_obj *kref, *kobj;
@@ -144,10 +144,10 @@ pdf_debugpagetree(pdf_pagetree *pages)
printf(" ]\n>>\n");
}
-fz_error *
+fz_error
pdf_loadpagetree(pdf_pagetree **pp, pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
struct stuff inherit;
pdf_pagetree *p = nil;
fz_obj *catalog = nil;
diff --git a/mupdf/pdf_parse.c b/mupdf/pdf_parse.c
index 533e5b90..c6589be4 100644
--- a/mupdf/pdf_parse.c
+++ b/mupdf/pdf_parse.c
@@ -27,7 +27,7 @@ fz_matrix pdf_tomatrix(fz_obj *array)
return m;
}
-fz_error *
+fz_error
pdf_toutf8(char **dstp, fz_obj *src)
{
unsigned char *srcptr = (unsigned char *) fz_tostrbuf(src);
@@ -76,7 +76,7 @@ pdf_toutf8(char **dstp, fz_obj *src)
return fz_okay;
}
-fz_error *
+fz_error
pdf_toucs2(unsigned short **dstp, fz_obj *src)
{
unsigned char *srcptr = (unsigned char *) fz_tostrbuf(src);
@@ -106,10 +106,10 @@ pdf_toucs2(unsigned short **dstp, fz_obj *src)
return fz_okay;
}
-fz_error *
+fz_error
pdf_parsearray(fz_obj **op, fz_stream *file, char *buf, int cap)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
fz_obj *ary = nil;
fz_obj *obj = nil;
int a = 0, b = 0, n = 0;
@@ -217,10 +217,10 @@ cleanup:
return fz_rethrow(error, "cannot parse array");
}
-fz_error *
+fz_error
pdf_parsedict(fz_obj **op, fz_stream *file, char *buf, int cap)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
fz_obj *dict = nil;
fz_obj *key = nil;
fz_obj *val = nil;
@@ -325,10 +325,10 @@ cleanup:
return fz_rethrow(error, "cannot parse dict");
}
-fz_error *
+fz_error
pdf_parsestmobj(fz_obj **op, fz_stream *file, char *buf, int cap)
{
- fz_error *error;
+ fz_error error;
pdf_token_e tok;
int len;
@@ -355,11 +355,11 @@ pdf_parsestmobj(fz_obj **op, fz_stream *file, char *buf, int cap)
return fz_okay;
}
-fz_error *
+fz_error
pdf_parseindobj(fz_obj **op, fz_stream *file, char *buf, int cap,
int *ooid, int *ogid, int *ostmofs)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
fz_obj *obj = nil;
int oid = 0, gid = 0, stmofs;
pdf_token_e tok;
diff --git a/mupdf/pdf_pattern.c b/mupdf/pdf_pattern.c
index 3dd52e05..5eea4140 100644
--- a/mupdf/pdf_pattern.c
+++ b/mupdf/pdf_pattern.c
@@ -19,10 +19,10 @@ pdf_droppattern(pdf_pattern *pat)
}
}
-fz_error *
+fz_error
pdf_loadpattern(pdf_pattern **patp, pdf_xref *xref, fz_obj *dict, fz_obj *stmref)
{
- fz_error *error;
+ fz_error error;
pdf_pattern *pat;
fz_stream *stm;
fz_obj *resources;
diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c
index 7735a838..04620a5f 100644
--- a/mupdf/pdf_repair.c
+++ b/mupdf/pdf_repair.c
@@ -14,11 +14,11 @@ struct entry
int stmlen;
};
-static fz_error *
+static fz_error
parseobj(fz_stream *file, char *buf, int cap, int *stmofs, int *stmlen,
int *isroot, int *isinfo)
{
- fz_error *error;
+ fz_error error;
fz_obj *dict = nil;
fz_obj *length;
fz_obj *filter;
@@ -134,10 +134,10 @@ atobjend:
return fz_okay;
}
-fz_error *
+fz_error
pdf_repairxref(pdf_xref *xref, char *filename)
{
- fz_error *error;
+ fz_error error;
fz_stream *file;
struct entry *list = nil;
diff --git a/mupdf/pdf_resources.c b/mupdf/pdf_resources.c
index 52bd624e..1a1d5d92 100644
--- a/mupdf/pdf_resources.c
+++ b/mupdf/pdf_resources.c
@@ -45,10 +45,10 @@ while in the middle of parsing a content stream.
*/
-static fz_error *
+static fz_error
preloadcolorspace(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_colorspace *colorspace;
fz_obj *obj = ref;
@@ -73,10 +73,10 @@ preloadcolorspace(pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-static fz_error *
+static fz_error
preloadpattern(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_pattern *pattern;
fz_shade *shade;
fz_obj *type;
@@ -115,10 +115,10 @@ preloadpattern(pdf_xref *xref, fz_obj *ref)
}
}
-static fz_error *
+static fz_error
preloadshading(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_shade *shade;
fz_obj *obj = ref;
@@ -134,10 +134,10 @@ preloadshading(pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-static fz_error *
+static fz_error
preloadxobject(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_xobject *xobject;
pdf_image *image;
fz_obj *obj = ref;
@@ -176,10 +176,10 @@ preloadxobject(pdf_xref *xref, fz_obj *ref)
}
}
-static fz_error *
+static fz_error
preloadfont(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_fontdesc *font;
fz_obj *obj = ref;
error = pdf_resolve(&obj, xref);
@@ -192,10 +192,10 @@ preloadfont(pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-static fz_error *
+static fz_error
preloadmask(pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj = ref;
fz_obj *grp;
error = pdf_resolve(&obj, xref);
@@ -216,10 +216,10 @@ preloadmask(pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-static fz_error *
+static fz_error
scanfontsandmasks(pdf_xref *xref, fz_obj *rdb)
{
- fz_error *error;
+ fz_error error;
fz_obj *dict;
fz_obj *obj;
int i;
@@ -266,10 +266,10 @@ scanfontsandmasks(pdf_xref *xref, fz_obj *rdb)
return fz_okay;
}
-static fz_error *
+static fz_error
copyresolved(fz_obj **outp, pdf_xref *xref, fz_obj *dict)
{
- fz_error *error;
+ fz_error error;
fz_obj *key, *val, *obj;
fz_obj *copy;
int i;
@@ -314,10 +314,10 @@ copyresolved(fz_obj **outp, pdf_xref *xref, fz_obj *dict)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadresources(fz_obj **rdbp, pdf_xref *xref, fz_obj *orig)
{
- fz_error *error;
+ fz_error error;
fz_obj *copy;
fz_obj *old;
fz_obj *new;
diff --git a/mupdf/pdf_shade.c b/mupdf/pdf_shade.c
index a4c1b664..0ea648df 100644
--- a/mupdf/pdf_shade.c
+++ b/mupdf/pdf_shade.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
pdf_loadcompositeshadefunc(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *funcref, float t0, float t1)
{
- fz_error *error;
+ fz_error error;
pdf_function *func;
int i;
@@ -26,10 +26,10 @@ pdf_loadcompositeshadefunc(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_
return fz_okay;
}
-static fz_error *
+static fz_error
pdf_loadcomponentshadefunc(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *funcs, float t0, float t1)
{
- fz_error *error;
+ fz_error error;
pdf_function **func = nil;
int i;
@@ -100,10 +100,10 @@ cleanup:
return error;
}
-fz_error *
+fz_error
pdf_loadshadefunction(fz_shade *shade, pdf_xref *xref, fz_obj *shading, float t0, float t1)
{
- fz_error *error;
+ fz_error error;
fz_obj *ref;
fz_obj *obj;
@@ -144,10 +144,10 @@ pdf_setmeshvalue(float *mesh, int i, float x, float y, float t)
mesh[i*3+2] = t;
}
-static fz_error *
+static fz_error
loadshadedict(fz_shade **shadep, pdf_xref *xref, fz_obj *dict, fz_obj *ref, fz_matrix matrix)
{
- fz_error *error;
+ fz_error error;
fz_shade *shade;
fz_obj *obj;
int type;
@@ -256,10 +256,10 @@ cleanup:
return fz_rethrow(error, "could not load shading");
}
-fz_error *
+fz_error
pdf_loadshade(fz_shade **shadep, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_matrix mat;
fz_obj *obj;
fz_obj *shd;
diff --git a/mupdf/pdf_shade1.c b/mupdf/pdf_shade1.c
index 563dfaf9..ffa1768a 100644
--- a/mupdf/pdf_shade1.c
+++ b/mupdf/pdf_shade1.c
@@ -8,10 +8,10 @@
#define NSEGS 32
#define MAX_RAD_SEGS 36
-fz_error *
+fz_error
pdf_loadtype1shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
fz_matrix matrix;
pdf_function *func;
@@ -109,7 +109,7 @@ pdf_loadtype1shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadtype2shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
fz_point p1, p2, p3, p4;
@@ -121,7 +121,7 @@ pdf_loadtype2shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
float theta;
float dist;
int n;
- fz_error *error;
+ fz_error error;
pdf_logshade("load type2 shade {\n");
@@ -306,7 +306,7 @@ buildannulusmesh(float* mesh, int pos,
return pos;
}
-fz_error *
+fz_error
pdf_loadtype3shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref)
{
fz_obj *obj;
@@ -317,7 +317,7 @@ pdf_loadtype3shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref
float ex1, ey1, er1;
float rs;
int i;
- fz_error *error;
+ fz_error error;
pdf_logshade("load type3 shade {\n");
diff --git a/mupdf/pdf_shade4.c b/mupdf/pdf_shade4.c
index 1dbde462..4f02f50a 100644
--- a/mupdf/pdf_shade4.c
+++ b/mupdf/pdf_shade4.c
@@ -9,7 +9,7 @@ struct pdf_tensorpatch_s {
float color[4][FZ_MAXCOLORS];
};
-static fz_error *
+static fz_error
growshademesh(fz_shade *shade, int amount)
{
float *newmesh;
@@ -26,10 +26,10 @@ growshademesh(fz_shade *shade, int amount)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadtype4shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_obj *obj;
int bpcoord;
int bpcomp;
@@ -205,10 +205,10 @@ getdata(fz_stream *stream, int bps)
return s;
}
-fz_error *
+fz_error
pdf_loadtype5shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_stream *stream;
fz_obj *obj;
@@ -509,7 +509,7 @@ static inline int setvertex(float *mesh, fz_point pt, float *color, int ptr, int
static int
triangulatepatch(pdf_tensorpatch p, fz_shade *shade, int ptr, int ncomp)
{
- fz_error* error;
+ fz_error error;
ptr = setvertex(shade->mesh, p.pole[0][0], p.color[0], ptr, ncomp);
ptr = setvertex(shade->mesh, p.pole[3][0], p.color[1], ptr, ncomp);
@@ -573,10 +573,10 @@ drawpatch(pdf_tensorpatch patch, fz_shade *shade, int ptr, int ncomp, int depth)
return ptr;
}
-fz_error *
+fz_error
pdf_loadtype6shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_stream *stream;
fz_obj *obj;
@@ -694,10 +694,10 @@ cleanup:
return error;
}
-fz_error *
+fz_error
pdf_loadtype7shade(fz_shade *shade, pdf_xref *xref, fz_obj *shading, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
fz_stream *stream;
fz_obj *obj;
diff --git a/mupdf/pdf_store.c b/mupdf/pdf_store.c
index 349cc749..16311f31 100644
--- a/mupdf/pdf_store.c
+++ b/mupdf/pdf_store.c
@@ -24,10 +24,10 @@ struct pdf_store_s
pdf_item *root; /* linked list for everything else */
};
-fz_error *
+fz_error
pdf_newstore(pdf_store **storep)
{
- fz_error *error;
+ fz_error error;
pdf_store *store;
store = fz_malloc(sizeof(pdf_store));
@@ -100,10 +100,10 @@ pdf_dropstore(pdf_store *store)
fz_free(store);
}
-fz_error *
+fz_error
pdf_storeitem(pdf_store *store, pdf_itemkind kind, fz_obj *key, void *val)
{
- fz_error *error;
+ fz_error error;
if (fz_isindirect(key))
{
@@ -180,10 +180,10 @@ pdf_finditem(pdf_store *store, pdf_itemkind kind, fz_obj *key)
return nil;
}
-fz_error *
+fz_error
pdf_removeitem(pdf_store *store, pdf_itemkind kind, fz_obj *key)
{
- fz_error *error;
+ fz_error error;
pdf_item *item, *prev;
struct refkey refkey;
void *val;
diff --git a/mupdf/pdf_stream.c b/mupdf/pdf_stream.c
index 5be2348a..4690492d 100644
--- a/mupdf/pdf_stream.c
+++ b/mupdf/pdf_stream.c
@@ -7,7 +7,7 @@
int
pdf_isstream(pdf_xref *xref, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
if (oid < 0 || oid >= xref->len)
return 0;
@@ -25,12 +25,12 @@ pdf_isstream(pdf_xref *xref, int oid, int gen)
/*
* Create a filter given a name and param dictionary.
*/
-static fz_error *
+static fz_error
buildonefilter(fz_filter **fp, fz_obj *f, fz_obj *p)
{
fz_filter *decompress;
fz_filter *predict;
- fz_error *error;
+ fz_error error;
char *s;
s = fz_toname(f);
@@ -136,10 +136,10 @@ buildonefilter(fz_filter **fp, fz_obj *f, fz_obj *p)
* If head is given, start filter chain with it.
* Assume ownership of head.
*/
-static fz_error *
+static fz_error
buildfilterchain(fz_filter **filterp, fz_filter *head, fz_obj *fs, fz_obj *ps)
{
- fz_error *error;
+ fz_error error;
fz_filter *newhead;
fz_filter *tail;
fz_obj *f;
@@ -183,10 +183,10 @@ buildfilterchain(fz_filter **filterp, fz_filter *head, fz_obj *fs, fz_obj *ps)
* This is a null filter to constrain reading to the
* stream length, followed by a decryption filter.
*/
-static fz_error *
+static fz_error
buildrawfilter(fz_filter **filterp, pdf_xref *xref, fz_obj *stmobj, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_filter *base;
fz_obj *stmlen;
int len;
@@ -234,10 +234,10 @@ buildrawfilter(fz_filter **filterp, pdf_xref *xref, fz_obj *stmobj, int oid, int
* Construct a filter to decode a stream, without
* constraining to stream length, and without decryption.
*/
-fz_error *
+fz_error
pdf_buildinlinefilter(fz_filter **filterp, fz_obj *stmobj)
{
- fz_error *error;
+ fz_error error;
fz_obj *filters;
fz_obj *params;
@@ -263,10 +263,10 @@ pdf_buildinlinefilter(fz_filter **filterp, fz_obj *stmobj)
* Construct a filter to decode a stream, constraining
* to stream length and decrypting.
*/
-static fz_error *
+static fz_error
pdf_buildfilter(fz_filter **filterp, pdf_xref *xref, fz_obj *stmobj, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_filter *base, *pipe, *tmp;
fz_obj *filters;
fz_obj *params;
@@ -353,11 +353,11 @@ cleanup0:
* Open a stream for reading the raw (compressed but decrypted) data.
* Using xref->file while this is open is a bad idea.
*/
-fz_error *
+fz_error
pdf_openrawstream(fz_stream **stmp, pdf_xref *xref, int oid, int gen)
{
pdf_xrefentry *x;
- fz_error *error;
+ fz_error error;
fz_filter *filter;
if (oid < 0 || oid >= xref->len)
@@ -400,11 +400,11 @@ pdf_openrawstream(fz_stream **stmp, pdf_xref *xref, int oid, int gen)
* Put the opened file in xref->stream.
* Using xref->file while a stream is open is a Bad idea.
*/
-fz_error *
+fz_error
pdf_openstream(fz_stream **stmp, pdf_xref *xref, int oid, int gen)
{
pdf_xrefentry *x;
- fz_error *error;
+ fz_error error;
fz_filter *filter;
if (oid < 0 || oid >= xref->len)
@@ -443,10 +443,10 @@ pdf_openstream(fz_stream **stmp, pdf_xref *xref, int oid, int gen)
/*
* Load raw (compressed but decrypted) contents of a stream into buf.
*/
-fz_error *
+fz_error
pdf_loadrawstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
error = pdf_openrawstream(&stm, xref, oid, gen);
@@ -463,10 +463,10 @@ pdf_loadrawstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen)
/*
* Load uncompressed contents of a stream into buf.
*/
-fz_error *
+fz_error
pdf_loadstream(fz_buffer **bufp, pdf_xref *xref, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
fz_stream *stm;
error = pdf_openstream(&stm, xref, oid, gen);
diff --git a/mupdf/pdf_type3.c b/mupdf/pdf_type3.c
index e372e0d2..60cd2460 100644
--- a/mupdf/pdf_type3.c
+++ b/mupdf/pdf_type3.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-static fz_error *
+static fz_error
loadcharproc(fz_tree **treep, pdf_xref *xref, fz_obj *rdb, fz_obj *stmref)
{
- fz_error *error;
+ fz_error error;
pdf_csi *csi;
fz_stream *stm;
@@ -35,10 +35,10 @@ loadcharproc(fz_tree **treep, pdf_xref *xref, fz_obj *rdb, fz_obj *stmref)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadtype3font(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
char buf[256];
char *estrings[256];
pdf_fontdesc *fontdesc;
diff --git a/mupdf/pdf_unicode.c b/mupdf/pdf_unicode.c
index e4da50a4..418e318c 100644
--- a/mupdf/pdf_unicode.c
+++ b/mupdf/pdf_unicode.c
@@ -5,11 +5,11 @@
* ToUnicode map for fonts
*/
-fz_error *
+fz_error
pdf_loadtounicode(pdf_fontdesc *font, pdf_xref *xref,
char **strings, char *collection, fz_obj *cmapstm)
{
- fz_error *error = fz_okay;
+ fz_error error = fz_okay;
pdf_cmap *cmap;
int cid;
int ucs;
@@ -130,7 +130,7 @@ pdf_loadtounicode(pdf_fontdesc *font, pdf_xref *xref,
#if 0
-fz_error *
+fz_error
pdf_newtextline(pdf_textline **linep)
{
pdf_textline *line;
@@ -153,7 +153,7 @@ pdf_droptextline(pdf_textline *line)
fz_free(line);
}
-static fz_error *
+static fz_error
addtextchar(pdf_textline *line, fz_irect bbox, int c)
{
pdf_textchar *newtext;
@@ -179,10 +179,10 @@ addtextchar(pdf_textline *line, fz_irect bbox, int c)
/* XXX global! not reentrant! */
static fz_point oldpt = { 0, 0 };
-static fz_error *
+static fz_error
extracttext(pdf_textline **line, fz_node *node, fz_matrix ctm)
{
- fz_error *error;
+ fz_error error;
if (fz_istextnode(node))
{
@@ -290,12 +290,12 @@ extracttext(pdf_textline **line, fz_node *node, fz_matrix ctm)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadtextfromtree(pdf_textline **outp, fz_tree *tree, fz_matrix ctm)
{
pdf_textline *root;
pdf_textline *line;
- fz_error *error;
+ fz_error error;
oldpt.x = -1;
oldpt.y = -1;
diff --git a/mupdf/pdf_xobject.c b/mupdf/pdf_xobject.c
index 767b6bf3..696aae01 100644
--- a/mupdf/pdf_xobject.c
+++ b/mupdf/pdf_xobject.c
@@ -1,10 +1,10 @@
#include "fitz.h"
#include "mupdf.h"
-fz_error *
+fz_error
pdf_loadxobject(pdf_xobject **formp, pdf_xref *xref, fz_obj *dict, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
pdf_xobject *form;
fz_obj *obj;
diff --git a/mupdf/pdf_xref.c b/mupdf/pdf_xref.c
index cba476e9..30288de0 100644
--- a/mupdf/pdf_xref.c
+++ b/mupdf/pdf_xref.c
@@ -6,7 +6,7 @@
* needs to be initialized by initxref, openxref or repairxref.
*/
-fz_error *
+fz_error
pdf_newxref(pdf_xref **xrefp)
{
pdf_xref *xref;
@@ -72,7 +72,7 @@ pdf_closexref(pdf_xref *xref)
fz_free(xref);
}
-fz_error *
+fz_error
pdf_initxref(pdf_xref *xref)
{
xref->table = fz_malloc(sizeof(pdf_xrefentry) * 128);
@@ -138,10 +138,10 @@ pdf_debugxref(pdf_xref *xref)
}
/* ICKY! */
-fz_error *
+fz_error
pdf_decryptxref(pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
fz_obj *encrypt;
fz_obj *id;
@@ -181,12 +181,12 @@ pdf_decryptxref(pdf_xref *xref)
* object loading
*/
-fz_error *
+fz_error
pdf_cacheobject(pdf_xref *xref, int oid, int gen)
{
char buf[65536]; /* yeowch! */
- fz_error *error;
+ fz_error error;
pdf_xrefentry *x;
int roid, rgen;
@@ -236,10 +236,10 @@ pdf_cacheobject(pdf_xref *xref, int oid, int gen)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadobject(fz_obj **objp, pdf_xref *xref, int oid, int gen)
{
- fz_error *error;
+ fz_error error;
error = pdf_cacheobject(xref, oid, gen);
if (error)
@@ -250,10 +250,10 @@ pdf_loadobject(fz_obj **objp, pdf_xref *xref, int oid, int gen)
return fz_okay;
}
-fz_error *
+fz_error
pdf_loadindirect(fz_obj **objp, pdf_xref *xref, fz_obj *ref)
{
- fz_error *error;
+ fz_error error;
if (ref == nil)
return fz_throw("assert: dereference null indirect reference");
@@ -265,10 +265,10 @@ pdf_loadindirect(fz_obj **objp, pdf_xref *xref, fz_obj *ref)
return fz_okay;
}
-fz_error *
+fz_error
pdf_resolve(fz_obj **objp, pdf_xref *xref)
{
- fz_error *error;
+ fz_error error;
if (fz_isindirect(*objp))
{