From 8a102a687f02c9c4014368877bffb3622c482c65 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 11 Oct 2016 21:01:09 +0800 Subject: Internal drop functions don't need to check for NULL. --- source/cbz/mucbz.c | 2 -- source/cbz/mutiff.c | 2 -- source/fitz/glyph.c | 3 --- source/fitz/list-device.c | 2 -- source/gprf/gprf-doc.c | 2 -- source/pdf/pdf-page.c | 3 --- source/pdf/pdf-xref.c | 3 --- source/xps/xps-doc.c | 2 -- source/xps/xps-zip.c | 3 --- 9 files changed, 22 deletions(-) diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c index 9fa522c8..2caee490 100644 --- a/source/cbz/mucbz.c +++ b/source/cbz/mucbz.c @@ -144,8 +144,6 @@ cbz_run_page(fz_context *ctx, cbz_page *page, fz_device *dev, const fz_matrix *c static void cbz_drop_page(fz_context *ctx, cbz_page *page) { - if (!page) - return; fz_drop_image(ctx, page->image); } diff --git a/source/cbz/mutiff.c b/source/cbz/mutiff.c index 7817eb16..44f55c7c 100644 --- a/source/cbz/mutiff.c +++ b/source/cbz/mutiff.c @@ -49,8 +49,6 @@ tiff_run_page(fz_context *ctx, tiff_page *page, fz_device *dev, const fz_matrix static void tiff_drop_page(fz_context *ctx, tiff_page *page) { - if (!page) - return; fz_drop_image(ctx, page->image); } diff --git a/source/fitz/glyph.c b/source/fitz/glyph.c index b76d2f76..efe5bed1 100644 --- a/source/fitz/glyph.c +++ b/source/fitz/glyph.c @@ -18,9 +18,6 @@ static void fz_drop_glyph_imp(fz_context *ctx, fz_storable *glyph_) { fz_glyph *glyph = (fz_glyph *)glyph_; - - if (glyph == NULL) - return; fz_drop_pixmap(ctx, glyph->pixmap); fz_free(ctx, glyph); } diff --git a/source/fitz/list-device.c b/source/fitz/list-device.c index bcc11230..c8b2ced5 100644 --- a/source/fitz/list-device.c +++ b/source/fitz/list-device.c @@ -1263,8 +1263,6 @@ fz_drop_display_list_imp(fz_context *ctx, fz_storable *list_) int cs_n = 1; fz_colorspace *cs; - if (list == NULL) - return; while (node != node_end) { fz_display_node n = *node; diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c index a1017678..5d8503df 100644 --- a/source/gprf/gprf-doc.c +++ b/source/gprf/gprf-doc.c @@ -895,8 +895,6 @@ gprf_close_document(fz_context *ctx, fz_document *doc_) { gprf_document *doc = (gprf_document*)doc_; - if (doc == NULL) - return; fz_free(ctx, doc->page_dims); fz_free(ctx, doc->pdf_filename); fz_free(ctx, doc->gprf_filename); diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index f0e45402..0cfb5dae 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -504,9 +504,6 @@ pdf_drop_page_imp(fz_context *ctx, pdf_page *page) { pdf_document *doc = page->doc; - if (page == NULL) - return; - fz_drop_link(ctx, page->links); pdf_drop_annots(ctx, page->annots); diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 814637b9..c46d9f52 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1593,9 +1593,6 @@ pdf_drop_document_imp(fz_context *ctx, pdf_document *doc) { int i; - if (!doc) - return; - fz_try(ctx) { fz_defer_reap_start(ctx); diff --git a/source/xps/xps-doc.c b/source/xps/xps-doc.c index b796b922..457b2d6b 100644 --- a/source/xps/xps-doc.c +++ b/source/xps/xps-doc.c @@ -417,8 +417,6 @@ xps_bound_page(fz_context *ctx, xps_page *page, fz_rect *bounds) static void xps_drop_page_imp(fz_context *ctx, xps_page *page) { - if (page == NULL) - return; fz_drop_document(ctx, &page->doc->super); fz_drop_xml(ctx, page->root); } diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c index 6874a3b4..aea42216 100644 --- a/source/xps/xps-zip.c +++ b/source/xps/xps-zip.c @@ -198,9 +198,6 @@ xps_drop_document(fz_context *ctx, xps_document *doc) { xps_font_cache *font, *next; - if (!doc) - return; - if (doc->zip) fz_drop_archive(ctx, doc->zip); -- cgit v1.2.3