summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-10-11 14:03:39 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-10-12 15:18:06 +0200
commita94e86a03d3059b2bd7f48b9bbc436253bd2d94e (patch)
tree8b720eca2e0ca5c6bd0d7c9a0e7a849606da4007
parent0e03d243af21da13af66af6c688300ff7d72ade6 (diff)
downloadmupdf-a94e86a03d3059b2bd7f48b9bbc436253bd2d94e.tar.xz
Make fz_open_memory take a const buffer.
-rw-r--r--include/mupdf/fitz/stream.h2
-rw-r--r--source/fitz/stream-open.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h
index f9cf755c..be59a7a0 100644
--- a/include/mupdf/fitz/stream.h
+++ b/include/mupdf/fitz/stream.h
@@ -68,7 +68,7 @@ fz_stream *fz_open_file_ptr(fz_context *ctx, FILE *file);
Returns pointer to newly created stream. May throw exceptions on
failure to allocate.
*/
-fz_stream *fz_open_memory(fz_context *ctx, unsigned char *data, size_t len);
+fz_stream *fz_open_memory(fz_context *ctx, const unsigned char *data, size_t len);
/*
fz_open_buffer: Open a buffer as a stream.
diff --git a/source/fitz/stream-open.c b/source/fitz/stream-open.c
index 83990d52..d7cff535 100644
--- a/source/fitz/stream-open.c
+++ b/source/fitz/stream-open.c
@@ -208,15 +208,15 @@ fz_open_buffer(fz_context *ctx, fz_buffer *buf)
}
fz_stream *
-fz_open_memory(fz_context *ctx, unsigned char *data, size_t len)
+fz_open_memory(fz_context *ctx, const unsigned char *data, size_t len)
{
fz_stream *stm;
stm = fz_new_stream(ctx, NULL, next_buffer, close_buffer);
stm->seek = seek_buffer;
- stm->rp = data;
- stm->wp = data + len;
+ stm->rp = (unsigned char *)data;
+ stm->wp = (unsigned char *)data + len;
stm->pos = (fz_off_t)len;