diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-11-02 20:02:40 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-11-03 18:10:50 +0000 |
commit | 6e2a71d0b743c105c71f88a7ed1de0851cdd90ca (patch) | |
tree | 8bd6d452d6b4686f509e6478edf13f267621d6f3 /source/pdf | |
parent | 0289421f68b810cee600a5a047507091ff4731df (diff) | |
download | mupdf-6e2a71d0b743c105c71f88a7ed1de0851cdd90ca.tar.xz |
Fix signed/unsigned and size_t/int/fz_off_t warnings.
All seen in MSVC, mostly in 64bit builds.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-form.c | 7 | ||||
-rw-r--r-- | source/pdf/pdf-repair.c | 2 | ||||
-rw-r--r-- | source/pdf/pdf-xref.c | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c index 4fbccfa2..f4c5278c 100644 --- a/source/pdf/pdf-form.c +++ b/source/pdf/pdf-form.c @@ -1083,6 +1083,7 @@ void pdf_field_set_text_color(fz_context *ctx, pdf_document *doc, pdf_obj *field fz_buffer *fzbuf = NULL; char *da = pdf_to_str_buf(ctx, pdf_get_inheritable(ctx, doc, field, PDF_NAME_DA)); unsigned char *buf; + int ilen; size_t len; pdf_obj *daobj = NULL; @@ -1093,13 +1094,13 @@ void pdf_field_set_text_color(fz_context *ctx, pdf_document *doc, pdf_obj *field fz_var(daobj); fz_try(ctx) { - size_t i; + int i; pdf_parse_da(ctx, da, &di); di.col_size = pdf_array_len(ctx, col); - len = fz_mini(di.col_size, (int)nelem(di.col)); - for (i = 0; i < len; i++) + ilen = fz_mini(di.col_size, (int)nelem(di.col)); + for (i = 0; i < ilen; i++) di.col[i] = pdf_to_real(ctx, pdf_array_get(ctx, col, i)); fzbuf = fz_new_buffer(ctx, 0); diff --git a/source/pdf/pdf-repair.c b/source/pdf/pdf-repair.c index 167f6097..04c968b3 100644 --- a/source/pdf/pdf-repair.c +++ b/source/pdf/pdf-repair.c @@ -346,7 +346,7 @@ pdf_repair_xref(fz_context *ctx, pdf_document *doc) { if (memcmp(&buf->scratch[j], "%PDF", 4) == 0) { - fz_seek(ctx, doc->file, j + 8, 0); /* skip "%PDF-X.Y" */ + fz_seek(ctx, doc->file, (fz_off_t)(j + 8), 0); /* skip "%PDF-X.Y" */ break; } } diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 2c964e90..41dd9984 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -635,7 +635,7 @@ pdf_xref_size_from_old_trailer(fz_context *ctx, pdf_document *doc, pdf_lexbuf *b int size; fz_off_t ofs; pdf_obj *trailer = NULL; - int n; + size_t n; fz_var(trailer); @@ -683,10 +683,10 @@ pdf_xref_size_from_old_trailer(fz_context *ctx, pdf_document *doc, pdf_lexbuf *b else n = 20; - if (len > (FZ_OFF_MAX - t) / n) + if (len > (fz_off_t)((FZ_OFF_MAX - t) / n)) fz_throw(ctx, FZ_ERROR_GENERIC, "xref has too many entries"); - fz_seek(ctx, doc->file, t + n * len, SEEK_SET); + fz_seek(ctx, doc->file, (fz_off_t)(t + n * len), SEEK_SET); } fz_try(ctx) |