From 4a1d6f9886c141e165c281f127c0cb387c6407d6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 May 2014 14:19:57 +0200 Subject: Fix signedness in cmap interface. --- source/pdf/pdf-cmap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/pdf/pdf-cmap.c') 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) -- cgit v1.2.3