diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-10-11 14:06:22 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-10-12 15:18:06 +0200 |
commit | 992c7c6cf15813760f4582682f5a48daba5d4239 (patch) | |
tree | faffce19eb79fd8ed7dbc16b74abd798e8bd196f /source | |
parent | a94e86a03d3059b2bd7f48b9bbc436253bd2d94e (diff) | |
download | mupdf-992c7c6cf15813760f4582682f5a48daba5d4239.tar.xz |
Some more consts.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/xml.c | 4 | ||||
-rw-r--r-- | source/pdf/pdf-parse.c | 8 | ||||
-rw-r--r-- | source/pdf/pdf-write.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/source/fitz/xml.c b/source/fitz/xml.c index 989d65b6..bcd3179c 100644 --- a/source/fitz/xml.c +++ b/source/fitz/xml.c @@ -588,9 +588,9 @@ parse_attribute_value: return "end of data in attribute value"; } -static char *convert_to_utf8(fz_context *doc, unsigned char *s, size_t n, int *dofree) +static char *convert_to_utf8(fz_context *doc, const unsigned char *s, size_t n, int *dofree) { - unsigned char *e = s + n; + const unsigned char *e = s + n; char *dst, *d; int c; diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c index 92d0b423..7772bff2 100644 --- a/source/pdf/pdf-parse.c +++ b/source/pdf/pdf-parse.c @@ -40,7 +40,7 @@ pdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *m) } static int -rune_from_utf16be(int *out, unsigned char *s, unsigned char *end) +rune_from_utf16be(int *out, const unsigned char *s, const unsigned char *end) { if (s + 2 <= end) { @@ -59,7 +59,7 @@ rune_from_utf16be(int *out, unsigned char *s, unsigned char *end) } static size_t -skip_language_code_utf16be(unsigned char *s, size_t n, size_t i) +skip_language_code_utf16be(const unsigned char *s, size_t n, size_t i) { /* skip language escape codes */ if (i + 6 <= n && s[i+0] == 0 && s[i+1] == 27 && s[i+4] == 0 && s[i+5] == 27) @@ -70,7 +70,7 @@ skip_language_code_utf16be(unsigned char *s, size_t n, size_t i) } static size_t -skip_language_code_utf8(unsigned char *s, size_t n, size_t i) +skip_language_code_utf8(const unsigned char *s, size_t n, size_t i) { /* skip language escape codes */ if (i + 3 <= n && s[i] == 27 && s[i+3]) @@ -81,7 +81,7 @@ skip_language_code_utf8(unsigned char *s, size_t n, size_t i) } char * -pdf_to_utf8_imp(fz_context *ctx, unsigned char *srcptr, size_t srclen) +pdf_to_utf8_imp(fz_context *ctx, const unsigned char *srcptr, size_t srclen) { char *dstptr, *dst; size_t dstlen = 0; diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index de3b4d7d..164df6b4 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -1527,7 +1527,7 @@ static int isbinarystream(fz_context *ctx, fz_buffer *buf) return 0; } -static fz_buffer *hexbuf(fz_context *ctx, unsigned char *p, size_t n) +static fz_buffer *hexbuf(fz_context *ctx, const unsigned char *p, size_t n) { static const char hex[17] = "0123456789abcdef"; int x = 0; @@ -1602,7 +1602,7 @@ static void addhexfilter(fz_context *ctx, pdf_document *doc, pdf_obj *dict) fz_rethrow(ctx); } -static fz_buffer *deflatebuf(fz_context *ctx, unsigned char *p, size_t n) +static fz_buffer *deflatebuf(fz_context *ctx, const unsigned char *p, size_t n) { fz_buffer *buf; uLongf csize; |