diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-04-15 14:10:33 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-04-26 15:13:08 +0100 |
commit | 26f4d19a9a575eb44a6fac44c3a991beee8b589d (patch) | |
tree | b9c9a8c42e794db77a3208dd99fce732beead280 /source/html | |
parent | a2fc54fe202624b7f82662eb9ca04c718d886718 (diff) | |
download | mupdf-26f4d19a9a575eb44a6fac44c3a991beee8b589d.tar.xz |
Improve fz_new_document
Use a macro to make fz_new_document nicer (akin to
fz_malloc_struct).
Diffstat (limited to 'source/html')
-rw-r--r-- | source/html/epub-doc.c | 2 | ||||
-rw-r--r-- | source/html/html-doc.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c index e080e7f9..5f67e0d4 100644 --- a/source/html/epub-doc.c +++ b/source/html/epub-doc.c @@ -415,7 +415,7 @@ epub_init(fz_context *ctx, fz_archive *zip) { epub_document *doc; - doc = fz_new_document(ctx, sizeof *doc); + doc = fz_new_document(ctx, epub_document); doc->zip = zip; doc->set = fz_new_html_font_set(ctx); diff --git a/source/html/html-doc.c b/source/html/html-doc.c index e5c3d91e..a7f48111 100644 --- a/source/html/html-doc.c +++ b/source/html/html-doc.c @@ -117,7 +117,7 @@ htdoc_open_document_with_stream(fz_context *ctx, fz_stream *file) html_document *doc; fz_buffer *buf; - doc = fz_new_document(ctx, sizeof *doc); + doc = fz_new_document(ctx, html_document); doc->super.close = htdoc_close_document; doc->super.layout = htdoc_layout; @@ -144,7 +144,7 @@ htdoc_open_document(fz_context *ctx, const char *filename) fz_dirname(dirname, filename, sizeof dirname); - doc = fz_new_document(ctx, sizeof *doc); + doc = fz_new_document(ctx, html_document); doc->super.close = htdoc_close_document; doc->super.layout = htdoc_layout; doc->super.count_pages = htdoc_count_pages; |