diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-01-11 16:00:27 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-01-11 16:50:48 +0000 |
commit | d91e333e2fe42f83301ecb7311cfe6e25868fb78 (patch) | |
tree | c6c82681d6607b0ef1a561b66307911a11becb00 | |
parent | c195b10d6e188e825fdd58372168f1caaf72ab23 (diff) | |
download | mupdf-d91e333e2fe42f83301ecb7311cfe6e25868fb78.tar.xz |
Bug 693519: Replace char * with const char * in open document.
Simple patch to replace const char * with char *. I made the patch
myself, but I suspect it's extremely close to the one submitted
by Evgeniy A Dushistov, who reported the bug - many thanks!
-rw-r--r-- | cbz/mucbz.c | 2 | ||||
-rw-r--r-- | cbz/mucbz.h | 2 | ||||
-rw-r--r-- | fitz/doc_document.c | 12 | ||||
-rw-r--r-- | fitz/fitz.h | 4 | ||||
-rw-r--r-- | xps/muxps.h | 2 | ||||
-rw-r--r-- | xps/xps_zip.c | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/cbz/mucbz.c b/cbz/mucbz.c index 1fc2fbe6..101a3d8d 100644 --- a/cbz/mucbz.c +++ b/cbz/mucbz.c @@ -312,7 +312,7 @@ cbz_open_document_with_stream(fz_context *ctx, fz_stream *file) } cbz_document * -cbz_open_document(fz_context *ctx, char *filename) +cbz_open_document(fz_context *ctx, const char *filename) { fz_stream *file; cbz_document *doc; diff --git a/cbz/mucbz.h b/cbz/mucbz.h index 05288eb3..24a40315 100644 --- a/cbz/mucbz.h +++ b/cbz/mucbz.h @@ -19,7 +19,7 @@ typedef struct cbz_page_s cbz_page; filename: a path to a file as it would be given to open(2). */ -cbz_document *cbz_open_document(fz_context *ctx, char *filename); +cbz_document *cbz_open_document(fz_context *ctx, const char *filename); /* cbz_open_document_with_stream: Opens a document. diff --git a/fitz/doc_document.c b/fitz/doc_document.c index 47157156..15605109 100644 --- a/fitz/doc_document.c +++ b/fitz/doc_document.c @@ -1,9 +1,9 @@ #include "fitz-internal.h" /* Yuck! Promiscuous we are. */ -extern struct pdf_document *pdf_open_document(fz_context *ctx, char *filename); -extern struct xps_document *xps_open_document(fz_context *ctx, char *filename); -extern struct cbz_document *cbz_open_document(fz_context *ctx, char *filename); +extern struct pdf_document *pdf_open_document(fz_context *ctx, const char *filename); +extern struct xps_document *xps_open_document(fz_context *ctx, const char *filename); +extern struct cbz_document *cbz_open_document(fz_context *ctx, const char *filename); extern struct pdf_document *pdf_open_document_with_stream(fz_context *ctx, fz_stream *file); extern struct xps_document *xps_open_document_with_stream(fz_context *ctx, fz_stream *file); @@ -18,7 +18,7 @@ static inline int fz_tolower(int c) return c; } -static inline int fz_strcasecmp(char *a, char *b) +static inline int fz_strcasecmp(const char *a, const char *b) { while (fz_tolower(*a) == fz_tolower(*b)) { @@ -30,7 +30,7 @@ static inline int fz_strcasecmp(char *a, char *b) } fz_document * -fz_open_document_with_stream(fz_context *ctx, char *magic, fz_stream *stream) +fz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stream) { char *ext = strrchr(magic, '.'); @@ -56,7 +56,7 @@ fz_open_document_with_stream(fz_context *ctx, char *magic, fz_stream *stream) } fz_document * -fz_open_document(fz_context *ctx, char *filename) +fz_open_document(fz_context *ctx, const char *filename) { char *ext = strrchr(filename, '.'); diff --git a/fitz/fitz.h b/fitz/fitz.h index 6ece9251..898d2e01 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -2300,7 +2300,7 @@ typedef struct fz_page_s fz_page; filename: a path to a file as it would be given to open(2). */ -fz_document *fz_open_document(fz_context *ctx, char *filename); +fz_document *fz_open_document(fz_context *ctx, const char *filename); /* fz_open_document_with_stream: Open a PDF, XPS or CBZ document. @@ -2310,7 +2310,7 @@ fz_document *fz_open_document(fz_context *ctx, char *filename); magic: a string used to detect document type; either a file name or mime-type. */ -fz_document *fz_open_document_with_stream(fz_context *ctx, char *magic, fz_stream *stream); +fz_document *fz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stream); /* fz_close_document: Close and free an open document. diff --git a/xps/muxps.h b/xps/muxps.h index 007f4452..86e50cfb 100644 --- a/xps/muxps.h +++ b/xps/muxps.h @@ -19,7 +19,7 @@ typedef struct xps_page_s xps_page; filename: a path to a file as it would be given to open(2). */ -xps_document *xps_open_document(fz_context *ctx, char *filename); +xps_document *xps_open_document(fz_context *ctx, const char *filename); /* xps_open_document_with_stream: Opens a document. diff --git a/xps/xps_zip.c b/xps/xps_zip.c index fa52dec1..f5ca0eb7 100644 --- a/xps/xps_zip.c +++ b/xps/xps_zip.c @@ -553,7 +553,7 @@ xps_has_part(xps_document *doc, char *partname) } static xps_document * -xps_open_document_with_directory(fz_context *ctx, char *directory) +xps_open_document_with_directory(fz_context *ctx, const char *directory) { xps_document *doc; @@ -600,7 +600,7 @@ xps_open_document_with_stream(fz_context *ctx, fz_stream *file) } xps_document * -xps_open_document(fz_context *ctx, char *filename) +xps_open_document(fz_context *ctx, const char *filename) { char buf[2048]; fz_stream *file; |