summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-01-25 16:04:47 +0100
committerRobin Watts <robin.watts@artifex.com>2013-01-25 18:16:38 +0000
commitd7cfddd0d5648f9fe2f2a3cab918368c4ec1c5dc (patch)
tree9ba23f86990c11f7aa587d449c0c82368b4aa169
parentfaed577217a67dd9d640b02dfea7be48f3261435 (diff)
downloadmupdf-d7cfddd0d5648f9fe2f2a3cab918368c4ec1c5dc.tar.xz
Make strdup take a const char * to silence some warnings.
-rw-r--r--fitz/base_memory.c4
-rw-r--r--fitz/fitz.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/fitz/base_memory.c b/fitz/base_memory.c
index 3fdaff58..cfab858d 100644
--- a/fitz/base_memory.c
+++ b/fitz/base_memory.c
@@ -183,7 +183,7 @@ fz_free(fz_context *ctx, void *p)
}
char *
-fz_strdup(fz_context *ctx, char *s)
+fz_strdup(fz_context *ctx, const char *s)
{
int len = strlen(s) + 1;
char *ns = fz_malloc(ctx, len);
@@ -192,7 +192,7 @@ fz_strdup(fz_context *ctx, char *s)
}
char *
-fz_strdup_no_throw(fz_context *ctx, char *s)
+fz_strdup_no_throw(fz_context *ctx, const char *s)
{
int len = strlen(s) + 1;
char *ns = fz_malloc_no_throw(ctx, len);
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 898d2e01..bb4d3831 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -503,7 +503,7 @@ void *fz_resize_array(fz_context *ctx, void *p, unsigned int count, unsigned int
Returns a pointer to a duplicated string. Throws exception on failure
to allocate.
*/
-char *fz_strdup(fz_context *ctx, char *s);
+char *fz_strdup(fz_context *ctx, const char *s);
/*
fz_free: Frees an allocation.
@@ -571,7 +571,7 @@ void *fz_resize_array_no_throw(fz_context *ctx, void *p, unsigned int count, uns
Returns a pointer to a duplicated string. Returns NULL on failure
to allocate.
*/
-char *fz_strdup_no_throw(fz_context *ctx, char *s);
+char *fz_strdup_no_throw(fz_context *ctx, const char *s);
/*
Safe string functions