diff options
-rw-r--r-- | draw/blendmodes.c | 14 | ||||
-rw-r--r-- | fitz/base_geometry.c | 8 | ||||
-rw-r--r-- | fitz/base_hash.c | 15 | ||||
-rw-r--r-- | fitz/filt_basic.c | 28 | ||||
-rw-r--r-- | fitz/res_colorspace.c | 12 | ||||
-rw-r--r-- | fitz/stm_read.c | 9 | ||||
-rw-r--r-- | mupdf/cmapdump.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_build.c | 4 | ||||
-rw-r--r-- | mupdf/pdf_colorspace.c | 20 | ||||
-rw-r--r-- | mupdf/pdf_fontenc.c | 5 | ||||
-rw-r--r-- | mupdf/pdf_interpret.c | 17 | ||||
-rw-r--r-- | mupdf/pdf_lex.c | 5 | ||||
-rw-r--r-- | mupdf/pdf_repair.c | 4 | ||||
-rw-r--r-- | mupdf/pdf_shade.c | 25 | ||||
-rw-r--r-- | mupdf/pdf_unicode.c | 4 |
15 files changed, 41 insertions, 131 deletions
diff --git a/draw/blendmodes.c b/draw/blendmodes.c index 713b6cf2..455ff7b4 100644 --- a/draw/blendmodes.c +++ b/draw/blendmodes.c @@ -1,5 +1,7 @@ #include "fitz.h" +/* PDF 1.4 blend modes. These are slow. */ + typedef unsigned char byte; const char *fz_blendnames[] = @@ -23,13 +25,7 @@ const char *fz_blendnames[] = nil }; -/* -PDF 1.4 blend modes. -Only the actual blend routines are here, not the rendering logic. -These are slow. -*/ - -/* These functions apply to a single component, 0-255 range */ +/* Separable blend modes */ static inline int fz_screen_byte(int b, int s) @@ -232,9 +228,7 @@ fz_hue_rgb(int *rr, int *rg, int *rb, int br, int bg, int bb, int sr, int sg, in fz_saturation_rgb(rr, rg, rb, tr, tg, tb, br, bg, bb); } -/* - * - */ +/* Blending functions */ static void fz_blendseparable(byte * restrict sp, byte * restrict bp, int n, int w, fz_blendmode blendmode) diff --git a/fitz/base_geometry.c b/fitz/base_geometry.c index 61ff88d9..924ae4a7 100644 --- a/fitz/base_geometry.c +++ b/fitz/base_geometry.c @@ -3,9 +3,7 @@ #define MAX4(a,b,c,d) MAX(MAX(a,b), MAX(c,d)) #define MIN4(a,b,c,d) MIN(MIN(a,b), MIN(c,d)) -/* - * Matrices, points and affine transformations - */ +/* Matrices, points and affine transformations */ const fz_matrix fz_identity = { 1, 0, 0, 1, 0, 0 }; @@ -131,9 +129,7 @@ fz_transformvector(fz_matrix m, fz_point p) return t; } -/* - * Rectangles and bounding boxes - */ +/* Rectangles and bounding boxes */ const fz_rect fz_infiniterect = { 1, 1, -1, -1 }; const fz_rect fz_emptyrect = { 0, 0, 0, 0 }; diff --git a/fitz/base_hash.c b/fitz/base_hash.c index b0dd12fc..d4a5133f 100644 --- a/fitz/base_hash.c +++ b/fitz/base_hash.c @@ -1,12 +1,13 @@ -/* Simple hashtable with open adressing linear probe. - * Unlike text book examples, removing entries works - * correctly in this implementation so it wont start - * exhibiting bad behaviour if entries are inserted - * and removed frequently. - */ - #include "fitz.h" +/* +Simple hashtable with open adressing linear probe. +Unlike text book examples, removing entries works +correctly in this implementation, so it wont start +exhibiting bad behaviour if entries are inserted +and removed frequently. +*/ + enum { MAXKEYLEN = 48 }; typedef struct fz_hashentry_s fz_hashentry; diff --git a/fitz/filt_basic.c b/fitz/filt_basic.c index 6ab80c32..b9ec347e 100644 --- a/fitz/filt_basic.c +++ b/fitz/filt_basic.c @@ -1,8 +1,6 @@ #include "fitz.h" -/* - * Identity filter. - */ +/* Identity filter */ fz_filter * fz_newcopyfilter(void) @@ -43,9 +41,7 @@ fz_processcopyfilter(fz_filter *filter, fz_buffer *in, fz_buffer *out) } } -/* - * Null filter copies data until a specified length. - */ +/* Null filter copies data until a specified length */ typedef struct fz_nullfilter_s fz_nullfilter; @@ -98,9 +94,7 @@ fz_processnullfilter(fz_filter *filter, fz_buffer *in, fz_buffer *out) return fz_throw("braindead programmer trapped in nullfilter"); } -/* - * ASCII Hex Decode - */ +/* ASCII Hex Decode */ typedef struct fz_ahxd_s fz_ahxd; @@ -193,9 +187,7 @@ fz_processahxd(fz_filter *filter, fz_buffer *in, fz_buffer *out) } } -/* - * ASCII 85 Decode - */ +/* ASCII 85 Decode */ typedef struct fz_a85d_s fz_a85d; @@ -312,9 +304,7 @@ fz_processa85d(fz_filter *filter, fz_buffer *in, fz_buffer *out) } } -/* - * Run Length Decode - */ +/* Run Length Decode */ fz_filter * fz_newrld(fz_obj *params) @@ -386,9 +376,7 @@ fz_processrld(fz_filter *filter, fz_buffer *in, fz_buffer *out) } } -/* - * RC4 Filter - */ +/* RC4 Filter */ typedef struct fz_arc4c_s fz_arc4c; @@ -434,9 +422,7 @@ fz_processarc4filter(fz_filter *filter, fz_buffer *in, fz_buffer *out) } } -/* - * AES Filter - */ +/* AES Filter */ typedef struct fz_aesd_s fz_aesd; diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c index 3d94fdce..9c98e5ff 100644 --- a/fitz/res_colorspace.c +++ b/fitz/res_colorspace.c @@ -36,9 +36,7 @@ fz_dropcolorspace(fz_colorspace *cs) } } -/* - * Fast Device color spaces - */ +/* Device colorspace definitions */ static void graytoxyz(fz_colorspace *cs, float *gray, float *xyz) { @@ -113,9 +111,7 @@ fz_colorspace *fz_devicergb = &kdevicergb; fz_colorspace *fz_devicebgr = &kdevicebgr; fz_colorspace *fz_devicecmyk = &kdevicecmyk; -/* - * Pixmap color conversions - */ +/* Fast pixmap color conversions */ static void fastgraytorgb(fz_pixmap *src, fz_pixmap *dst) { @@ -362,9 +358,7 @@ fz_convertpixmap(fz_pixmap *sp, fz_pixmap *dp) else fz_stdconvpixmap(sp, dp); } -/* - * Convert a single color - */ +/* Convert a single color */ static void fz_stdconvcolor(fz_colorspace *srcs, float *srcv, fz_colorspace *dsts, float *dstv) diff --git a/fitz/stm_read.c b/fitz/stm_read.c index 3b09bf41..d4d27f66 100644 --- a/fitz/stm_read.c +++ b/fitz/stm_read.c @@ -271,9 +271,7 @@ fz_peekbytex(fz_stream *stm) return buf->rp < buf->wp ? *buf->rp : EOF ; } -/* - * Read a line terminated by LF or CR or CRLF. - */ +/* Read a line terminated by LF or CR or CRLF. */ fz_error fz_readline(fz_stream *stm, char *mem, int n) @@ -334,10 +332,7 @@ fz_fillbuf(fz_stream *stm, fz_buffer *buf) return 0; } -/* - * Utility function to consume all the contents of an input stream into - * a freshly allocated buffer. - */ +/* Read the contents of an input stream into a new buffer. */ fz_buffer * fz_readall(fz_stream *stm, int sizehint) diff --git a/mupdf/cmapdump.c b/mupdf/cmapdump.c index ed0b5531..3f82c022 100644 --- a/mupdf/cmapdump.c +++ b/mupdf/cmapdump.c @@ -106,7 +106,7 @@ main(int argc, char **argv) return 1; } - fprintf(fo, "/*\n * %s\n */\n\n", cmap->cmapname); + fprintf(fo, "/* %s */\n\n", cmap->cmapname); fprintf(fo, "static const pdf_range pdf_cmap_%s_ranges[] =\n{\n", name); if (cmap->rlen == 0) diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c index 4ed8f19c..13c16372 100644 --- a/mupdf/pdf_build.c +++ b/mupdf/pdf_build.c @@ -397,10 +397,6 @@ pdf_showpath(pdf_csi *csi, int doclose, int dofill, int dostroke, int evenodd) fz_freepath(path); } -/* - * Text - */ - void pdf_flushtext(pdf_csi *csi) { diff --git a/mupdf/pdf_colorspace.c b/mupdf/pdf_colorspace.c index 08405de4..d7b5d3bf 100644 --- a/mupdf/pdf_colorspace.c +++ b/mupdf/pdf_colorspace.c @@ -1,9 +1,7 @@ #include "fitz.h" #include "mupdf.h" -/* - * ICCBased - */ +/* ICCBased */ static fz_error loadiccbased(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict) @@ -24,9 +22,7 @@ loadiccbased(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict) return fz_throw("syntaxerror: ICCBased must have 1, 3 or 4 components"); } -/* - * Lab - */ +/* Lab */ static inline float fung(float x) { @@ -80,9 +76,7 @@ xyztolab(fz_colorspace *cs, float *xyz, float *lab) static fz_colorspace kdevicelab = { -1, "Lab", 3, labtoxyz, xyztolab }; static fz_colorspace *fz_devicelab = &kdevicelab; -/* - * Separation and DeviceN - */ +/* Separation and DeviceN */ struct separation { @@ -170,9 +164,7 @@ loadseparation(fz_colorspace **csp, pdf_xref *xref, fz_obj *array) return fz_okay; } -/* - * Indexed - */ +/* Indexed */ struct indexed { @@ -313,9 +305,7 @@ loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array) return fz_okay; } -/* - * Parse and create colorspace from PDF object. - */ +/* Parse and create colorspace from PDF object */ static fz_error pdf_loadcolorspaceimp(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj) diff --git a/mupdf/pdf_fontenc.c b/mupdf/pdf_fontenc.c index 76586263..769406ea 100644 --- a/mupdf/pdf_fontenc.c +++ b/mupdf/pdf_fontenc.c @@ -1,7 +1,3 @@ -/* - * Built-in font tables - */ - #include "fitz.h" #include "mupdf.h" @@ -374,4 +370,3 @@ const char * const pdf_zapfdingbats[256] = { _notdef, _notdef, "a186", "a195", "a187", "a188", "a189", "a190", "a191", _notdef }; #endif - diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c index bc4fd66b..aefdc23b 100644 --- a/mupdf/pdf_interpret.c +++ b/mupdf/pdf_interpret.c @@ -139,11 +139,6 @@ pdf_freecsi(pdf_csi *csi) fz_free(csi); } -/* - * Do some magic to call the xobject subroutine. - * Push gstate, set transform, clip, run, pop gstate. - */ - fz_error pdf_runxobject(pdf_csi *csi, fz_obj *resources, pdf_xobject *xobj) { @@ -233,10 +228,6 @@ pdf_runxobject(pdf_csi *csi, fz_obj *resources, pdf_xobject *xobj) return fz_okay; } -/* - * Decode inline image and insert into page. - */ - static fz_error pdf_runinlineimage(pdf_csi *csi, fz_obj *rdb, fz_stream *file, fz_obj *dict) { @@ -269,10 +260,6 @@ pdf_runinlineimage(pdf_csi *csi, fz_obj *rdb, fz_stream *file, fz_obj *dict) return fz_okay; } -/* - * Set gstate params from an ExtGState dictionary. - */ - static fz_error pdf_runextgstate(pdf_csi *csi, pdf_gstate *gstate, fz_obj *rdb, fz_obj *extgstate) { @@ -390,9 +377,7 @@ pdf_runextgstate(pdf_csi *csi, pdf_gstate *gstate, fz_obj *rdb, fz_obj *extgstat return fz_okay; } -/* - * The meat of the interpreter... - */ +/* TODO: split pdf_runkeyword into more manageable pieces */ static fz_error pdf_runkeyword(pdf_csi *csi, fz_obj *rdb, char *buf) diff --git a/mupdf/pdf_lex.c b/mupdf/pdf_lex.c index 30e8df2c..83a3adbf 100644 --- a/mupdf/pdf_lex.c +++ b/mupdf/pdf_lex.c @@ -23,11 +23,6 @@ #define RANGE_A_F \ 'A':case'B':case'C':case'D':case'E':case'F' -/* - * pdf_lex will use fz_peekbyte and fz_readbyte. - * have to check for file errors with fz_readerror() after lexing. - */ - static inline int iswhite(int ch) { diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c index ab130260..9404b1f2 100644 --- a/mupdf/pdf_repair.c +++ b/mupdf/pdf_repair.c @@ -1,9 +1,7 @@ #include "fitz.h" #include "mupdf.h" -/* - * open pdf and scan objects to reconstruct xref table - */ +/* Scan file for objects and reconstruct xref table */ struct entry { diff --git a/mupdf/pdf_shade.c b/mupdf/pdf_shade.c index 74a1cd5a..51a73ca4 100644 --- a/mupdf/pdf_shade.c +++ b/mupdf/pdf_shade.c @@ -61,9 +61,7 @@ pdf_addquad(fz_shade *shade, pdf_addtriangle(shade, v1, v3, v2); } -/* - * Subdivide and tesselate tensor-patches - */ +/* Subdivide and tesselate tensor-patches */ typedef struct pdf_tensorpatch_s pdf_tensorpatch; @@ -322,9 +320,7 @@ pdf_maketensorpatch(pdf_tensorpatch *p, int type, fz_point *pt) } } -/* - * Sample various functions into lookup tables - */ +/* Sample various functions into lookup tables */ static fz_error pdf_samplecompositeshadefunction(fz_shade *shade, @@ -385,9 +381,7 @@ pdf_sampleshadefunction(fz_shade *shade, int funcs, pdf_function **func, float t return fz_okay; } -/* - * Type 1-3 -- Function-based, axial and radial shadings - */ +/* Type 1-3 -- Function-based, axial and radial shadings */ static fz_error pdf_loadfunctionbasedshading(fz_shade *shade, pdf_xref *xref, fz_obj *dict, pdf_function *func) @@ -668,9 +662,7 @@ pdf_loadradialshading(fz_shade *shade, pdf_xref *xref, fz_obj *dict, int funcs, return fz_okay; } -/* - * Type 4-7 -- Triangle and patch mesh shadings - */ +/* Type 4-7 -- Triangle and patch mesh shadings */ static inline unsigned int readbits(fz_stream *stream, int bits) @@ -884,9 +876,7 @@ pdf_loadtype5shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, return fz_okay; } -/* - * Type 6 & 7 -- Patch mesh shadings - */ +/* Type 6 & 7 -- Patch mesh shadings */ static fz_error pdf_loadtype6shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, @@ -1138,9 +1128,7 @@ pdf_loadtype7shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, return fz_okay; } -/* - * Load all of the shading dictionary parameters, then switch on the shading type. - */ +/* Load all of the shading dictionary parameters, then switch on the shading type. */ static fz_error pdf_loadshadingdict(fz_shade **shadep, pdf_xref *xref, fz_obj *dict, fz_matrix transform) @@ -1356,4 +1344,3 @@ pdf_loadshading(fz_shade **shadep, pdf_xref *xref, fz_obj *dict) return fz_okay; } - diff --git a/mupdf/pdf_unicode.c b/mupdf/pdf_unicode.c index ed6e8ec6..608a69ba 100644 --- a/mupdf/pdf_unicode.c +++ b/mupdf/pdf_unicode.c @@ -1,9 +1,7 @@ #include "fitz.h" #include "mupdf.h" -/* - * ToUnicode map for fonts - */ +/* Load or synthesize ToUnicode map for fonts */ fz_error pdf_loadtounicode(pdf_fontdesc *font, pdf_xref *xref, |