diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2008-03-08 18:21:14 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2008-03-08 18:21:14 +0100 |
commit | 5653ed4d9e7d413192a8923d29eb05c752d0b1ac (patch) | |
tree | 54d88cfcf3852f404ff532c3084de6d1d4f858f9 | |
parent | e921e12bcfa3a343eac5e4b7ba3f2566f5eff49f (diff) | |
download | mupdf-5653ed4d9e7d413192a8923d29eb05c752d0b1ac.tar.xz |
Fixed almost all compiler warnings.
-rw-r--r-- | apps/unix/ximage.c | 2 | ||||
-rw-r--r-- | include/fitz/stm_stream.h | 2 | ||||
-rw-r--r-- | mupdf/pdf_build.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_cmap.c | 38 | ||||
-rw-r--r-- | mupdf/pdf_colorspace1.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_crypt.c | 10 | ||||
-rw-r--r-- | mupdf/pdf_doctor.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_function.c | 12 | ||||
-rw-r--r-- | mupdf/pdf_interpret.c | 26 | ||||
-rw-r--r-- | mupdf/pdf_lex.c | 10 | ||||
-rw-r--r-- | mupdf/pdf_open.c | 16 | ||||
-rw-r--r-- | mupdf/pdf_parse.c | 30 | ||||
-rw-r--r-- | mupdf/pdf_repair.c | 12 | ||||
-rw-r--r-- | mupdf/pdf_shade1.c | 1 | ||||
-rw-r--r-- | raster/glyphcache.c | 14 | ||||
-rw-r--r-- | raster/imagescale.c | 8 | ||||
-rw-r--r-- | raster/render.c | 2 | ||||
-rw-r--r-- | stream/stm_open.c | 2 | ||||
-rw-r--r-- | stream/stm_write.c | 10 |
19 files changed, 104 insertions, 97 deletions
diff --git a/apps/unix/ximage.c b/apps/unix/ximage.c index b37cf544..05ca9eb0 100644 --- a/apps/unix/ximage.c +++ b/apps/unix/ximage.c @@ -389,7 +389,7 @@ ximage_blit(Drawable d, GC gc, (ax + srcx) * 4; info.convert_func(srcptr, srcstride, - image->data, + (unsigned char *) image->data, image->bytes_per_line, w, h); if (info.useshm) diff --git a/include/fitz/stm_stream.h b/include/fitz/stm_stream.h index 66e9d320..d2ac7c94 100644 --- a/include/fitz/stm_stream.h +++ b/include/fitz/stm_stream.h @@ -31,7 +31,7 @@ fz_error *fz_openwfile(fz_stream **stmp, char *filename); fz_error *fz_openafile(fz_stream **stmp, char *filename); /* write to memory buffers! */ -fz_error *fz_openrmemory(fz_stream **stmp, char *buf, int len); +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_openwbuffer(fz_stream **stmp, fz_buffer *buf); diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c index 4fc2b48c..9d47d2db 100644 --- a/mupdf/pdf_build.c +++ b/mupdf/pdf_build.c @@ -766,7 +766,7 @@ pdf_showtext(pdf_csi *csi, fz_obj *text) return nil; } - buf = fz_tostrbuf(text); + buf = (unsigned char *) fz_tostrbuf(text); len = fz_tostrlen(text); end = buf + len; diff --git a/mupdf/pdf_cmap.c b/mupdf/pdf_cmap.c index 4729322f..6ee6c45c 100644 --- a/mupdf/pdf_cmap.c +++ b/mupdf/pdf_cmap.c @@ -580,23 +580,23 @@ static int codefromstring(unsigned char *buf, int len) return a; } -static int mylex(fz_stream *file, char *buf, int n, int *sl) +static int mylex(fz_stream *file, unsigned char *buf, int n, int *sl) { - int token = pdf_lex(file, buf, n, sl); + int token = pdf_lex(file, (unsigned char *) buf, n, sl); if (token == PDF_TKEYWORD) - token = tokenfromkeyword(buf); + token = tokenfromkeyword((char *) buf); return token; } static fz_error *parsecmapname(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; token = mylex(file, buf, sizeof buf, &len); if (token == PDF_TNAME) { - strlcpy(cmap->cmapname, buf, sizeof(cmap->cmapname)); + strlcpy(cmap->cmapname, (char *) buf, sizeof(cmap->cmapname)); return nil; } @@ -605,13 +605,13 @@ static fz_error *parsecmapname(pdf_cmap *cmap, fz_stream *file) static fz_error *parsewmode(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; token = mylex(file, buf, sizeof buf, &len); if (token == PDF_TINT) { - pdf_setwmode(cmap, atoi(buf)); + pdf_setwmode(cmap, atoi((char *) buf)); return nil; } @@ -620,7 +620,7 @@ static fz_error *parsewmode(pdf_cmap *cmap, fz_stream *file) static fz_error *parsecodespacerange(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -655,7 +655,7 @@ static fz_error *parsecodespacerange(pdf_cmap *cmap, fz_stream *file) static fz_error *parsecidrange(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -683,7 +683,7 @@ static fz_error *parsecidrange(pdf_cmap *cmap, fz_stream *file) if (token != PDF_TINT) goto cleanup; - dst = atoi(buf); + dst = atoi((char *) buf); error = pdf_maprangetorange(cmap, lo, hi, dst); if (error) @@ -696,7 +696,7 @@ cleanup: static fz_error *parsecidchar(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -718,7 +718,7 @@ static fz_error *parsecidchar(pdf_cmap *cmap, fz_stream *file) if (token != PDF_TINT) goto cleanup; - dst = atoi(buf); + dst = atoi((char *) buf); error = pdf_maprangetorange(cmap, src, src, dst); if (error) @@ -731,7 +731,7 @@ cleanup: static fz_error *parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int hi) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -765,7 +765,7 @@ static fz_error *parsebfrangearray(pdf_cmap *cmap, fz_stream *file, int lo, int static fz_error *parsebfrange(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -841,7 +841,7 @@ cleanup: static fz_error *parsebfchar(pdf_cmap *cmap, fz_stream *file) { - char buf[256]; + unsigned char buf[256]; int token; int len; fz_error *error; @@ -887,7 +887,7 @@ pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file) fz_error *error; pdf_cmap *cmap; char key[64]; - char buf[256]; + unsigned char buf[256]; int token; int len; @@ -912,20 +912,20 @@ pdf_parsecmap(pdf_cmap **cmapp, fz_stream *file) else if (token == PDF_TNAME) { - if (!strcmp(buf, "CMapName")) + if (!strcmp((char *) buf, "CMapName")) { error = parsecmapname(cmap, file); if (error) goto cleanup; } - else if (!strcmp(buf, "WMode")) + else if (!strcmp((char *) buf, "WMode")) { error = parsewmode(cmap, file); if (error) goto cleanup; } else - strlcpy(key, buf, sizeof key); + strlcpy(key, (char *) buf, sizeof key); } else if (token == TUSECMAP) diff --git a/mupdf/pdf_colorspace1.c b/mupdf/pdf_colorspace1.c index e98beaa1..3cb5c95c 100644 --- a/mupdf/pdf_colorspace1.c +++ b/mupdf/pdf_colorspace1.c @@ -624,7 +624,7 @@ loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array) pdf_logrsrc("string lookup\n"); - buf = fz_tostrbuf(lookup); + buf = (unsigned char *) fz_tostrbuf(lookup); for (i = 0; i < n; i++) cs->lookup[i] = buf[i]; } diff --git a/mupdf/pdf_crypt.c b/mupdf/pdf_crypt.c index 4af8e9fe..8bef10a7 100644 --- a/mupdf/pdf_crypt.c +++ b/mupdf/pdf_crypt.c @@ -180,7 +180,8 @@ createkey(pdf_crypt *crypt, char *userpw, int pwlen) fz_md5update(&md5, buf, 4); /* Step 5 */ - fz_md5update(&md5, fz_tostrbuf(crypt->id), fz_tostrlen(crypt->id)); + fz_md5update(&md5, (unsigned char *) fz_tostrbuf(crypt->id), + fz_tostrlen(crypt->id)); fz_md5final(&md5, crypt->key); /* Step 6 (rev 3 only) */ @@ -258,7 +259,8 @@ createuser(pdf_crypt *crypt, char *userpw, int pwlen) fz_md5update(&md5, (unsigned char *)padding, 32); /* Step 3 */ - fz_md5update(&md5, fz_tostrbuf(crypt->id), fz_tostrlen(crypt->id)); + fz_md5update(&md5, (unsigned char *) fz_tostrbuf(crypt->id), + fz_tostrlen(crypt->id)); fz_md5final(&md5, key); /* Step 4 */ @@ -396,7 +398,7 @@ pdf_setownerpassword(pdf_crypt *crypt, char *ownerpw, int pwlen) } } - return pdf_setuserpassword(crypt, buf, 32); + return pdf_setuserpassword(crypt, (char *) buf, 32); } /* @@ -412,7 +414,7 @@ pdf_cryptobj(pdf_crypt *crypt, fz_obj *obj, int oid, int gid) if (fz_isstring(obj)) { - s = fz_tostrbuf(obj); + s = (unsigned char *) fz_tostrbuf(obj); n = fz_tostrlen(obj); createobjkey(crypt, oid, gid, key); fz_arc4init(&arc4, key, crypt->keylen); diff --git a/mupdf/pdf_doctor.c b/mupdf/pdf_doctor.c index 5cce6b5d..99d9ff85 100644 --- a/mupdf/pdf_doctor.c +++ b/mupdf/pdf_doctor.c @@ -229,7 +229,7 @@ pdf_transplant(pdf_xref *dst, pdf_xref *src, fz_obj **newp, fz_obj *root) } } - error == remaprefs(newp, root, map, n); + error = remaprefs(newp, root, map, n); if (error) goto cleanup; diff --git a/mupdf/pdf_function.c b/mupdf/pdf_function.c index 2e06d5d3..c6cfd9a6 100644 --- a/mupdf/pdf_function.c +++ b/mupdf/pdf_function.c @@ -361,7 +361,7 @@ static fz_error * parsecode(pdf_function *func, fz_stream *stream, int *codeptr) { fz_error *error = nil; - char buf[64]; + unsigned char buf[64]; int buflen = sizeof(buf) / sizeof(buf[0]); int len; int token; @@ -382,14 +382,14 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr) case PDF_TINT: resizecode(func, *codeptr); func->u.p.code[*codeptr].type = PSINT; - func->u.p.code[*codeptr].u.i = atoi(buf); + func->u.p.code[*codeptr].u.i = atoi((char *) buf); ++*codeptr; break; case PDF_TREAL: resizecode(func, *codeptr); func->u.p.code[*codeptr].type = PSREAL; - func->u.p.code[*codeptr].u.f = atof(buf); + func->u.p.code[*codeptr].u.f = atof((char *) buf); ++*codeptr; break; @@ -417,7 +417,7 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr) elseptr = -1; if (token == PDF_TKEYWORD) { - if (!strcmp(buf, "if")) { + if (!strcmp((char *) buf, "if")) { if (elseptr >= 0) goto cleanup; func->u.p.code[opptr].type = PSOPERATOR; @@ -425,7 +425,7 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr) func->u.p.code[opptr+2].type = PSBLOCK; func->u.p.code[opptr+2].u.block = *codeptr; } - else if (!strcmp(buf, "ifelse")) { + else if (!strcmp((char *) buf, "ifelse")) { if (elseptr < 0) goto cleanup; func->u.p.code[opptr].type = PSOPERATOR; @@ -455,7 +455,7 @@ parsecode(pdf_function *func, fz_stream *stream, int *codeptr) /* invariant: psopnames[a] < op < psopnames[b] */ while (b - a > 1) { mid = (a + b) / 2; - cmp = strcmp(buf, psopnames[mid]); + cmp = strcmp((char *) buf, psopnames[mid]); if (cmp > 0) { a = mid; } else if (cmp < 0) { diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c index 028a3d85..033095fb 100644 --- a/mupdf/pdf_interpret.c +++ b/mupdf/pdf_interpret.c @@ -210,7 +210,7 @@ runinlineimage(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file, fz_ob { fz_error *error; pdf_image *img; - char buf[256]; + unsigned char buf[256]; int token; int len; @@ -219,7 +219,7 @@ runinlineimage(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file, fz_ob return error; token = pdf_lex(file, buf, sizeof buf, &len); - if (token != PDF_TKEYWORD || strcmp("EI", buf)) + if (token != PDF_TKEYWORD || memcmp("EI", buf, 2)) fz_warn("syntaxerror: corrupt inline image"); error = pdf_showimage(csi, img); @@ -1101,7 +1101,7 @@ fz_error * pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) { fz_error *error; - char buf[65536]; + unsigned char buf[65536]; int token, len; fz_obj *obj; @@ -1122,7 +1122,7 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) } else if (token == PDF_TINT || token == PDF_TREAL) { - error = fz_newreal(&obj, atof(buf)); + error = fz_newreal(&obj, atof((char *) buf)); if (error) return error; error = fz_arraypush(csi->array, obj); fz_dropobj(obj); @@ -1130,7 +1130,7 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) } else if (token == PDF_TSTRING) { - error = fz_newstring(&obj, buf, len); + error = fz_newstring(&obj, (char *) buf, len); if (error) return error; error = fz_arraypush(csi->array, obj); fz_dropobj(obj); @@ -1159,31 +1159,31 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) break; case PDF_TODICT: - error = pdf_parsedict(&csi->stack[csi->top], file, buf, sizeof buf); + error = pdf_parsedict(&csi->stack[csi->top], file, (char *) buf, sizeof buf); if (error) return error; csi->top ++; break; case PDF_TNAME: - error = fz_newname(&csi->stack[csi->top], buf); + error = fz_newname(&csi->stack[csi->top], (char *) buf); if (error) return error; csi->top ++; break; case PDF_TINT: - error = fz_newint(&csi->stack[csi->top], atoi(buf)); + error = fz_newint(&csi->stack[csi->top], atoi((char *) buf)); if (error) return error; csi->top ++; break; case PDF_TREAL: - error = fz_newreal(&csi->stack[csi->top], atof(buf)); + error = fz_newreal(&csi->stack[csi->top], atof((char *) buf)); if (error) return error; csi->top ++; break; case PDF_TSTRING: - error = fz_newstring(&csi->stack[csi->top], buf, len); + error = fz_newstring(&csi->stack[csi->top], (char *) buf, len); if (error) return error; csi->top ++; break; @@ -1207,11 +1207,11 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) break; case PDF_TKEYWORD: - if (!strcmp(buf, "BI")) + if (!strcmp((char *) buf, "BI")) { fz_obj *obj; - error = pdf_parsedict(&obj, file, buf, sizeof buf); + error = pdf_parsedict(&obj, file, (char *) buf, sizeof buf); if (error) return error; @@ -1225,7 +1225,7 @@ pdf_runcsi(pdf_csi *csi, pdf_xref *xref, fz_obj *rdb, fz_stream *file) } else { - error = runkeyword(csi, xref, rdb, buf); + error = runkeyword(csi, xref, rdb, (char *) buf); if (error) return error; clearstack(csi); } diff --git a/mupdf/pdf_lex.c b/mupdf/pdf_lex.c index 115cd0f8..70fafd98 100644 --- a/mupdf/pdf_lex.c +++ b/mupdf/pdf_lex.c @@ -267,7 +267,7 @@ pdf_lex(fz_stream *f, unsigned char *buf, int n, int *sl) { fz_readbyte(f); lexname(f, buf, n); - *sl = strlen(buf); + *sl = strlen((char *) buf); return PDF_TNAME; } @@ -330,8 +330,8 @@ pdf_lex(fz_stream *f, unsigned char *buf, int n, int *sl) else if (isnumber(c)) { lexnumber(f, buf, n); - *sl = strlen(buf); - if (strchr(buf, '.')) + *sl = strlen((char *) buf); + if (strchr((char *) buf, '.')) return PDF_TREAL; return PDF_TINT; } @@ -339,8 +339,8 @@ pdf_lex(fz_stream *f, unsigned char *buf, int n, int *sl) else if (isregular(c)) { lexname(f, buf, n); - *sl = strlen(buf); - return tokenfromkeyword(buf); + *sl = strlen((char *) buf); + return tokenfromkeyword((char *) buf); } else diff --git a/mupdf/pdf_open.c b/mupdf/pdf_open.c index ea8804bd..d67fd82c 100644 --- a/mupdf/pdf_open.c +++ b/mupdf/pdf_open.c @@ -47,7 +47,7 @@ readstartxref(pdf_xref *xref) if (t == -1) return fz_ioerror(xref->file); - n = fz_read(xref->file, buf, sizeof buf); + n = fz_read(xref->file, (unsigned char *) buf, sizeof buf); if (n == -1) return fz_ioerror(xref->file); @@ -112,11 +112,11 @@ readoldtrailer(pdf_xref *xref, char *buf, int cap) return fz_ioerror(xref->file); } - t = pdf_lex(xref->file, buf, cap, &n); + t = pdf_lex(xref->file, (unsigned char *) buf, cap, &n); if (t != PDF_TTRAILER) return fz_throw("syntaxerror: expected trailer"); - t = pdf_lex(xref->file, buf, cap, &n); + t = pdf_lex(xref->file, (unsigned char *) buf, cap, &n); if (t != PDF_TODICT) return fz_throw("syntaxerror: expected trailer dictionary"); @@ -192,7 +192,7 @@ readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap) for (i = 0; i < len; i++) { - n = fz_read(xref->file, buf, 20); + n = fz_read(xref->file, (unsigned char *) buf, 20); if (n < 0) return fz_ioerror(xref->file); if (n != 20) @@ -207,10 +207,10 @@ readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap) } } - t = pdf_lex(xref->file, buf, cap, &n); + t = pdf_lex(xref->file, (unsigned char *) buf, cap, &n); if (t != PDF_TTRAILER) return fz_throw("syntaxerror: expected trailer"); - t = pdf_lex(xref->file, buf, cap, &n); + t = pdf_lex(xref->file, (unsigned char *) buf, cap, &n); if (t != PDF_TODICT) return fz_throw("syntaxerror: expected trailer dictionary"); @@ -418,7 +418,7 @@ pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap) for (i = 0; i < count; i++) { - t = pdf_lex(stm, buf, cap, &n); + t = pdf_lex(stm, (unsigned char *) buf, cap, &n); if (t != PDF_TINT) { error = fz_throw("syntaxerror: corrupt object stream"); @@ -426,7 +426,7 @@ pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap) } oidbuf[i] = atoi(buf); - t = pdf_lex(stm, buf, cap, &n); + t = pdf_lex(stm, (unsigned char *) buf, cap, &n); if (t != PDF_TINT) { error = fz_throw("syntaxerror: corrupt object stream"); diff --git a/mupdf/pdf_parse.c b/mupdf/pdf_parse.c index bc6fd2d6..91a5892d 100644 --- a/mupdf/pdf_parse.c +++ b/mupdf/pdf_parse.c @@ -30,7 +30,7 @@ fz_matrix pdf_tomatrix(fz_obj *array) fz_error * pdf_toutf8(char **dstp, fz_obj *src) { - unsigned char *srcptr = fz_tostrbuf(src); + unsigned char *srcptr = (unsigned char *) fz_tostrbuf(src); char *dstptr; int srclen = fz_tostrlen(src); int dstlen = 0; @@ -79,7 +79,7 @@ pdf_toutf8(char **dstp, fz_obj *src) fz_error * pdf_toucs2(unsigned short **dstp, fz_obj *src) { - unsigned char *srcptr = fz_tostrbuf(src); + unsigned char *srcptr = (unsigned char *) fz_tostrbuf(src); unsigned short *dstptr; int srclen = fz_tostrlen(src); int i; @@ -121,7 +121,7 @@ pdf_parsearray(fz_obj **op, fz_stream *file, char *buf, int cap) while (1) { - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok != PDF_TINT && tok != PDF_TR) { @@ -221,7 +221,7 @@ pdf_parsedict(fz_obj **op, fz_stream *file, char *buf, int cap) while (1) { - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); skip: if (tok == PDF_TCDICT) @@ -237,7 +237,7 @@ skip: error = fz_newname(&key, buf); if (error) goto cleanup; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); switch (tok) { @@ -251,7 +251,7 @@ skip: case PDF_TNULL: error = fz_newnull(&val); break; case PDF_TINT: a = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TCDICT || tok == PDF_TNAME || (tok == PDF_TKEYWORD && !strcmp(buf, "ID"))) { @@ -267,7 +267,7 @@ skip: if (tok == PDF_TINT) { b = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TR) { error = fz_newindirect(&val, a, b); @@ -302,7 +302,7 @@ pdf_parsestmobj(fz_obj **op, fz_stream *file, char *buf, int cap) { int tok, len; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); switch (tok) { @@ -330,21 +330,21 @@ pdf_parseindobj(fz_obj **op, fz_stream *file, char *buf, int cap, int tok, len; int a, b; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok != PDF_TINT) goto cleanup; oid = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok != PDF_TINT) goto cleanup; gid = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok != PDF_TOBJ) goto cleanup; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); switch (tok) { case PDF_TOARRAY: error = pdf_parsearray(&obj, file, buf, cap); break; @@ -357,7 +357,7 @@ pdf_parseindobj(fz_obj **op, fz_stream *file, char *buf, int cap, case PDF_TNULL: error = fz_newnull(&obj); break; case PDF_TINT: a = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TSTREAM || tok == PDF_TENDOBJ) { error = fz_newint(&obj, a); @@ -367,7 +367,7 @@ pdf_parseindobj(fz_obj **op, fz_stream *file, char *buf, int cap, if (tok == PDF_TINT) { b = atoi(buf); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TR) { error = fz_newindirect(&obj, a, b); @@ -380,7 +380,7 @@ pdf_parseindobj(fz_obj **op, fz_stream *file, char *buf, int cap, } if (error) goto cleanup; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); skip: if (tok == PDF_TSTREAM) diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c index 6fcbde63..e350cd31 100644 --- a/mupdf/pdf_repair.c +++ b/mupdf/pdf_repair.c @@ -29,7 +29,7 @@ parseobj(fz_stream *file, char *buf, int cap, int *stmofs, int *stmlen, *isroot = 0; *isinfo = 0; - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TODICT) { error = pdf_parsedict(&dict, file, buf, cap); @@ -57,7 +57,7 @@ parseobj(fz_stream *file, char *buf, int cap, int *stmofs, int *stmlen, tok != PDF_TENDOBJ && tok != PDF_TERROR && tok != PDF_TEOF ) - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TSTREAM) { @@ -74,13 +74,13 @@ parseobj(fz_stream *file, char *buf, int cap, int *stmofs, int *stmlen, if (fz_isint(length)) { fz_seek(file, *stmofs + fz_toint(length), 0); - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TENDSTREAM) goto atobjend; fz_seek(file, *stmofs, 0); } - fz_read(file, buf, 9); + fz_read(file, (unsigned char *) buf, 9); while (memcmp(buf, "endstream", 9) != 0) { c = fz_readbyte(file); @@ -93,7 +93,7 @@ parseobj(fz_stream *file, char *buf, int cap, int *stmofs, int *stmlen, *stmlen = fz_tell(file) - *stmofs - 9; atobjend: - tok = pdf_lex(file, buf, cap, &len); + tok = pdf_lex(file, (unsigned char *) buf, cap, &len); if (tok == PDF_TENDOBJ) ; } @@ -147,7 +147,7 @@ pdf_repairxref(pdf_xref *xref, char *filename) { tmpofs = fz_tell(file); - tok = pdf_lex(file, buf, sizeof buf, &len); + tok = pdf_lex(file, (unsigned char *) buf, sizeof buf, &len); if (tok == PDF_TINT) { oidofs = genofs; diff --git a/mupdf/pdf_shade1.c b/mupdf/pdf_shade1.c index 217284ca..837a499e 100644 --- a/mupdf/pdf_shade1.c +++ b/mupdf/pdf_shade1.c @@ -20,7 +20,6 @@ pdf_loadtype1shade(fz_shade *shade, pdf_xref *xref, fz_obj *dict, fz_obj *ref) float x, y; float xn, yn; float x0, y0, x1, y1; - float t; int n; pdf_logshade("load type1 shade {\n"); diff --git a/raster/glyphcache.c b/raster/glyphcache.c index 41259878..b3f79173 100644 --- a/raster/glyphcache.c +++ b/raster/glyphcache.c @@ -164,6 +164,7 @@ didcoll ++; } } +/* static void hashremove(fz_glyphcache *arena, fz_key *key) { @@ -176,7 +177,7 @@ hashremove(fz_glyphcache *arena, fz_key *key) while (1) { if (!tab[pos].val) - return; /* boo hoo! tried to remove non-existant key */ + return; // boo hoo! tried to remove non-existant key if (memcmp(key, &tab[pos].key, sizeof (fz_key)) == 0) { @@ -213,6 +214,7 @@ hashremove(fz_glyphcache *arena, fz_key *key) pos = 0; } } +*/ void fz_debugglyphcache(fz_glyphcache *arena) @@ -267,6 +269,7 @@ bubble(fz_glyphcache *arena, int i) arena->lru[i].ent->val = &arena->lru[i]; } +/* static void evictlast(fz_glyphcache *arena) { @@ -282,22 +285,23 @@ evictlast(fz_glyphcache *arena) s = lru[k].samples; e = s + lru[k].w * lru[k].h; - /* pack buffer to fill hole */ + // pack buffer to fill hole memmove(s, e, arena->buffer + arena->used - e); memset(arena->buffer + arena->used - (e - s), 0, e - s); arena->used -= e - s; - /* update lru pointers */ - for (i = 0; i < k; i++) /* XXX this is DOG slow! XXX */ + // update lru pointers + for (i = 0; i < k; i++) // XXX this is DOG slow! XXX if (lru[i].samples >= e) lru[i].samples -= e - s; - /* remove hash entry */ + // remove hash entry key = lru[k].ent->key; hashremove(arena, &key); arena->load --; } +*/ static void evictall(fz_glyphcache *arena) diff --git a/raster/imagescale.c b/raster/imagescale.c index 96486033..3022189e 100644 --- a/raster/imagescale.c +++ b/raster/imagescale.c @@ -4,9 +4,9 @@ typedef unsigned char byte; -static inline void srown(byte * restrict src, byte * restrict dst, unsigned w, unsigned denom, unsigned n) +static inline void srown(byte * restrict src, byte * restrict dst, int w, int denom, int n) { - unsigned x, left, k; + int x, left, k; unsigned sum[FZ_MAXCOLORS]; left = 0; @@ -35,9 +35,9 @@ static inline void srown(byte * restrict src, byte * restrict dst, unsigned w, u dst[k] = sum[k] / left; } -static inline void srownp2(byte * restrict src, byte * restrict dst, unsigned w, unsigned log2denom, unsigned n) +static inline void srownp2(byte * restrict src, byte * restrict dst, int w, int log2denom, int n) { - unsigned x, left, k; + int x, left, k; unsigned sum[FZ_MAXCOLORS]; left = 0; diff --git a/raster/render.c b/raster/render.c index 690ba227..badfec8b 100644 --- a/raster/render.c +++ b/raster/render.c @@ -792,6 +792,8 @@ rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm) return rendernode(gc, ((fz_linknode*)node)->tree->root, ctm); case FZ_NMETA: return rendernode(gc, node->first, ctm); + case FZ_NBLEND: + return nil; } return nil; diff --git a/stream/stm_open.c b/stream/stm_open.c index 6481288a..43d2a60b 100644 --- a/stream/stm_open.c +++ b/stream/stm_open.c @@ -205,7 +205,7 @@ fz_error * fz_openwbuffer(fz_stream **stmp, fz_buffer *buf) return openbuffer(stmp, buf, FZ_SWRITE); } -fz_error * fz_openrmemory(fz_stream **stmp, char *mem, int len) +fz_error * fz_openrmemory(fz_stream **stmp, unsigned char *mem, int len) { fz_error *error; fz_buffer *buf; diff --git a/stream/stm_write.c b/stream/stm_write.c index d4eb99af..f619da9c 100644 --- a/stream/stm_write.c +++ b/stream/stm_write.c @@ -222,7 +222,7 @@ int fz_write(fz_stream *stm, unsigned char *mem, int n) int fz_printstr(fz_stream *stm, char *s) { - return fz_write(stm, s, strlen(s)); + return fz_write(stm, (unsigned char *) s, strlen(s)); } int fz_printobj(fz_stream *file, fz_obj *obj, int tight) @@ -235,7 +235,7 @@ int fz_printobj(fz_stream *file, fz_obj *obj, int tight) if (n < sizeof buf) { fz_sprintobj(buf, sizeof buf, obj, tight); - return fz_write(file, buf, n); + return fz_write(file, (unsigned char *) buf, n); } else { @@ -243,7 +243,7 @@ int fz_printobj(fz_stream *file, fz_obj *obj, int tight) if (!ptr) return -1; fz_sprintobj(ptr, n, obj, tight); - n = fz_write(file, ptr, n); + n = fz_write(file, (unsigned char *) ptr, n); fz_free(ptr); return n; } @@ -261,7 +261,7 @@ int fz_print(fz_stream *stm, char *fmt, ...) va_end(ap); if (n < sizeof buf) - return fz_write(stm, buf, n); + return fz_write(stm, (unsigned char *) buf, n); p = fz_malloc(n); if (!p) @@ -271,7 +271,7 @@ int fz_print(fz_stream *stm, char *fmt, ...) vsnprintf(p, n, fmt, ap); va_end(ap); - n = fz_write(stm, p, n); + n = fz_write(stm, (unsigned char *) p, n); fz_free(p); |