summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-12-14 16:15:11 +0000
committerRobin Watts <robin.watts@artifex.com>2015-12-14 16:22:34 +0000
commit1180b61fce77e2c06a0be764605f7fde4aad7ae3 (patch)
tree042e3288fe70021438e495231f2986f537152b61
parent143ace7d86324a2f7bf6e3f42b503b3274c8784a (diff)
downloadmupdf-1180b61fce77e2c06a0be764605f7fde4aad7ae3.tar.xz
Add 'const' to the context lock and alloc structure pointers.
This highlights the fact that we never alter the internals, and allows callers to pass in static const pointers.
-rw-r--r--include/mupdf/fitz/context.h6
-rw-r--r--source/fitz/context.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index 0dce749c..32ee450d 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -102,8 +102,8 @@ void fz_flush_warnings(fz_context *ctx);
struct fz_context_s
{
void *user;
- fz_alloc_context *alloc;
- fz_locks_context *locks;
+ const fz_alloc_context *alloc;
+ const fz_locks_context *locks;
fz_id_context *id;
fz_error_context *error;
fz_warn_context *warn;
@@ -158,7 +158,7 @@ enum {
Does not throw exceptions, but may return NULL.
*/
-fz_context *fz_new_context_imp(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store, const char *version);
+fz_context *fz_new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, unsigned int max_store, const char *version);
#define fz_new_context(alloc, locks, max_store) fz_new_context_imp(alloc, locks, max_store, FZ_VERSION)
diff --git a/source/fitz/context.c b/source/fitz/context.c
index 53f820a1..5d3373c2 100644
--- a/source/fitz/context.c
+++ b/source/fitz/context.c
@@ -112,7 +112,7 @@ fz_drop_context(fz_context *ctx)
* that aren't shared between contexts.
*/
static fz_context *
-new_context_phase1(fz_alloc_context *alloc, fz_locks_context *locks)
+new_context_phase1(const fz_alloc_context *alloc, const fz_locks_context *locks)
{
fz_context *ctx;
@@ -159,7 +159,7 @@ cleanup:
}
fz_context *
-fz_new_context_imp(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store, const char *version)
+fz_new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, unsigned int max_store, const char *version)
{
fz_context *ctx;