diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-05-13 14:19:57 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-05-13 14:44:18 +0200 |
commit | 4a1d6f9886c141e165c281f127c0cb387c6407d6 (patch) | |
tree | d031c88c4485731e1f06e52235fe24d7b48e8f4b /source/pdf/pdf-cmap.c | |
parent | 11366353e1e88805f25053825cfd99be035cd245 (diff) | |
download | mupdf-4a1d6f9886c141e165c281f127c0cb387c6407d6.tar.xz |
Fix signedness in cmap interface.
Diffstat (limited to 'source/pdf/pdf-cmap.c')
-rw-r--r-- | source/pdf/pdf-cmap.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/pdf/pdf-cmap.c b/source/pdf/pdf-cmap.c index db628f23..e9eb25b2 100644 --- a/source/pdf/pdf-cmap.c +++ b/source/pdf/pdf-cmap.c @@ -73,7 +73,7 @@ pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode) * multi-byte encoded strings. */ void -pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, int low, int high, int n) +pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n) { if (cmap->codespace_len + 1 == nelem(cmap->codespace)) { @@ -153,7 +153,7 @@ add_mrange(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *out, int len) * Add a range-to-table mapping. */ void -pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, int low, int *table, int len) +pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *table, int len) { int i; for (i = 0; i < len; i++) @@ -164,7 +164,7 @@ pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, int low, int *table, int * Add a range of contiguous one-to-one mappings (ie 1..5 maps to 21..25) */ void -pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, int low, int high, int out) +pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int out) { add_range(ctx, cmap, low, high, out); } @@ -173,7 +173,7 @@ pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, int low, int high, int o * Add a single one-to-many mapping. */ void -pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, int low, int *values, int len) +pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len) { if (len == 1) { @@ -315,7 +315,8 @@ pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out) pdf_range *ranges = cmap->ranges; pdf_xrange *xranges = cmap->xranges; pdf_mrange *mranges = cmap->mranges; - int l, r, m, i; + unsigned int i; + int l, r, m; l = 0; r = cmap->rlen - 1; @@ -377,9 +378,10 @@ pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out) * multi-byte encoded string. */ int -pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, int *cpt) +pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, unsigned int *cpt) { - int k, n, c; + unsigned int c; + int k, n; int len = end - buf; if (len > 4) |