summaryrefslogtreecommitdiff
path: root/source/cbz
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-01-19 02:08:49 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-03-28 15:53:56 +0200
commit4918560f7dd434fa5489d4efc442d70835668650 (patch)
treeea14522f16916eac0d83f837ba8bfffbcf6f0bbc /source/cbz
parent161a77db42e306216b5493cf8f8e739053eb86d2 (diff)
downloadmupdf-4918560f7dd434fa5489d4efc442d70835668650.tar.xz
Return fz_document from all document handlers.
To make it possible to avoid casting in most cases.
Diffstat (limited to 'source/cbz')
-rw-r--r--source/cbz/mucbz.c10
-rw-r--r--source/cbz/muimg.c10
-rw-r--r--source/cbz/mutiff.c10
3 files changed, 15 insertions, 15 deletions
diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
index 53ad5938..a557a9c7 100644
--- a/source/cbz/mucbz.c
+++ b/source/cbz/mucbz.c
@@ -192,7 +192,7 @@ cbz_lookup_metadata(fz_context *ctx, cbz_document *doc, const char *key, char *b
return -1;
}
-static cbz_document *
+static fz_document *
cbz_open_document_with_stream(fz_context *ctx, fz_stream *file)
{
cbz_document *doc;
@@ -214,7 +214,7 @@ cbz_open_document_with_stream(fz_context *ctx, fz_stream *file)
fz_drop_document(ctx, &doc->super);
fz_rethrow(ctx);
}
- return doc;
+ return &doc->super;
}
static int
@@ -238,7 +238,7 @@ cbz_recognize(fz_context *ctx, const char *magic)
fz_document_handler cbz_document_handler =
{
- (fz_document_recognize_fn *)&cbz_recognize,
- (fz_document_open_fn *)NULL,
- (fz_document_open_with_stream_fn *)&cbz_open_document_with_stream
+ cbz_recognize,
+ NULL,
+ cbz_open_document_with_stream
};
diff --git a/source/cbz/muimg.c b/source/cbz/muimg.c
index 5c9b84bf..4c590f52 100644
--- a/source/cbz/muimg.c
+++ b/source/cbz/muimg.c
@@ -103,7 +103,7 @@ img_new_document(fz_context *ctx, fz_image *image)
return doc;
}
-static img_document *
+static fz_document *
img_open_document_with_stream(fz_context *ctx, fz_stream *stm)
{
fz_buffer *buffer = NULL;
@@ -127,7 +127,7 @@ img_open_document_with_stream(fz_context *ctx, fz_stream *stm)
fz_catch(ctx)
fz_rethrow(ctx);
- return doc;
+ return &doc->super;
}
static int
@@ -172,7 +172,7 @@ img_recognize(fz_context *doc, const char *magic)
fz_document_handler img_document_handler =
{
- (fz_document_recognize_fn *)&img_recognize,
- (fz_document_open_fn *)NULL,
- (fz_document_open_with_stream_fn *)&img_open_document_with_stream
+ img_recognize,
+ NULL,
+ img_open_document_with_stream
};
diff --git a/source/cbz/mutiff.c b/source/cbz/mutiff.c
index 6b7b989c..637f4e3a 100644
--- a/source/cbz/mutiff.c
+++ b/source/cbz/mutiff.c
@@ -114,7 +114,7 @@ tiff_drop_document(fz_context *ctx, tiff_document *doc)
fz_drop_buffer(ctx, doc->buffer);
}
-static tiff_document *
+static fz_document *
tiff_open_document_with_stream(fz_context *ctx, fz_stream *file)
{
tiff_document *doc;
@@ -140,7 +140,7 @@ tiff_open_document_with_stream(fz_context *ctx, fz_stream *file)
fz_rethrow(ctx);
}
- return doc;
+ return &doc->super;
}
static int
@@ -162,7 +162,7 @@ tiff_recognize(fz_context *doc, const char *magic)
fz_document_handler tiff_document_handler =
{
- (fz_document_recognize_fn *)&tiff_recognize,
- (fz_document_open_fn *)NULL,
- (fz_document_open_with_stream_fn *)&tiff_open_document_with_stream
+ tiff_recognize,
+ NULL,
+ tiff_open_document_with_stream
};