M include/mupdf/fitz/system.h => include/mupdf/fitz/system.h +1 -1
@@ 154,7 154,7 @@ void fz_free_argv(int argc, char **argv);
#endif
/* Cope with systems (such as Windows) with no S_ISDIR */
-#ifndef S_ISDIR
+#if 0
#define S_ISDIR(mode) ((mode) & S_IFDIR)
#endif
M include/mupdf/pdf/name-table.h => include/mupdf/pdf/name-table.h +1 -1
@@ 1,5 1,5 @@
/* Alphabetically sorted list of all PDF names to be available as constants */
-PDF_MAKE_NAME("1.2", 1_2)
+PDF_MAKE_NAME("1.2", V1_2)
PDF_MAKE_NAME("3D", 3D)
PDF_MAKE_NAME("A", A)
PDF_MAKE_NAME("A85", A85)
A mkfile => mkfile +210 -0
@@ 0,0 1,210 @@
+</$objtype/mkfile
+
+CC=pcc
+CFLAGS=\
+ -D _POSIX_SOURCE\
+ -D '_XOPEN_SOURCE=700'\
+ -D 'FZ_ENABLE_JS=0'\
+ -D 'FZ_ENABLE_HTML=0'\
+ -D 'FZ_ENABLE_EPUB=0'\
+ -D 'FZ_ENABLE_ICC=0'\
+ -D 'FZ_ENABLE_JPX=0'\
+ -D NO_CJK\
+ -D NO_ICC\
+ -I include\
+ -I ../freetype/include\
+ -I ../jbig2dec\
+ -I ../jpeg-9d
+
+LIB=libmupdf.a
+LIBOBJ=\
+ source/cbz/mucbz.$O\
+ source/cbz/muimg.$O\
+ source/fitz/archive.$O\
+ source/fitz/bbox-device.$O\
+ source/fitz/bidi-std.$O\
+ source/fitz/bidi.$O\
+ source/fitz/bitmap.$O\
+ source/fitz/buffer.$O\
+ source/fitz/color-fast.$O\
+ source/fitz/color-icc-create.$O\
+ source/fitz/color-lcms.$O\
+ source/fitz/colorspace.$O\
+ source/fitz/compress.$O\
+ source/fitz/compressed-buffer.$O\
+ source/fitz/context.$O\
+ source/fitz/crypt-aes.$O\
+ source/fitz/crypt-arc4.$O\
+ source/fitz/crypt-md5.$O\
+ source/fitz/crypt-sha2.$O\
+ source/fitz/device.$O\
+ source/fitz/directory.$O\
+ source/fitz/document-all.$O\
+ source/fitz/document.$O\
+ source/fitz/draw-affine.$O\
+ source/fitz/draw-blend.$O\
+ source/fitz/draw-device.$O\
+ source/fitz/draw-edge.$O\
+ source/fitz/draw-edgebuffer.$O\
+ source/fitz/draw-glyph.$O\
+ source/fitz/draw-mesh.$O\
+ source/fitz/draw-paint.$O\
+ source/fitz/draw-path.$O\
+ source/fitz/draw-rasterize.$O\
+ source/fitz/draw-scale-simple.$O\
+ source/fitz/draw-unpack.$O\
+ source/fitz/encode-basic.$O\
+ source/fitz/encode-fax.$O\
+ source/fitz/encodings.$O\
+ source/fitz/error.$O\
+ source/fitz/filter-basic.$O\
+ source/fitz/filter-dct.$O\
+ source/fitz/filter-fax.$O\
+ source/fitz/filter-flate.$O\
+ source/fitz/filter-jbig2.$O\
+ source/fitz/filter-leech.$O\
+ source/fitz/filter-lzw.$O\
+ source/fitz/filter-predict.$O\
+ source/fitz/filter-sgi.$O\
+ source/fitz/filter-thunder.$O\
+ source/fitz/font.$O\
+ source/fitz/ftoa.$O\
+ source/fitz/geometry.$O\
+ source/fitz/getopt.$O\
+ source/fitz/glyph.$O\
+ source/fitz/halftone.$O\
+ source/fitz/hash.$O\
+ source/fitz/image.$O\
+ source/fitz/jmemcust.$O\
+ source/fitz/link.$O\
+ source/fitz/list-device.$O\
+ source/fitz/load-bmp.$O\
+ source/fitz/load-gif.$O\
+ source/fitz/load-jbig2.$O\
+ source/fitz/load-jpeg.$O\
+ source/fitz/load-jpx.$O\
+ source/fitz/load-jxr.$O\
+ source/fitz/load-png.$O\
+ source/fitz/load-pnm.$O\
+ source/fitz/load-tiff.$O\
+ source/fitz/log.$O\
+ source/fitz/memento.$O\
+ source/fitz/memory.$O\
+ source/fitz/noto.$O\
+ source/fitz/ocr-device.$O\
+ source/fitz/outline.$O\
+ source/fitz/output-cbz.$O\
+ source/fitz/output-docx.$O\
+ source/fitz/output-pcl.$O\
+ source/fitz/output-pclm.$O\
+ source/fitz/output-pdfocr.$O\
+ source/fitz/output-png.$O\
+ source/fitz/output-pnm.$O\
+ source/fitz/output-ps.$O\
+ source/fitz/output-psd.$O\
+ source/fitz/output-pwg.$O\
+ source/fitz/output-svg.$O\
+ source/fitz/output.$O\
+ source/fitz/path.$O\
+ source/fitz/pixmap.$O\
+ source/fitz/pool.$O\
+ source/fitz/printf.$O\
+ source/fitz/random.$O\
+ source/fitz/separation.$O\
+ source/fitz/shade.$O\
+ source/fitz/stext-device.$O\
+ source/fitz/stext-output.$O\
+ source/fitz/stext-search.$O\
+ source/fitz/store.$O\
+ source/fitz/stream-open.$O\
+ source/fitz/stream-read.$O\
+ source/fitz/string.$O\
+ source/fitz/strtof.$O\
+ source/fitz/svg-device.$O\
+ source/fitz/test-device.$O\
+ source/fitz/text.$O\
+ source/fitz/time.$O\
+ source/fitz/trace-device.$O\
+ source/fitz/track-usage.$O\
+ source/fitz/transition.$O\
+ source/fitz/tree.$O\
+ source/fitz/ucdn.$O\
+ source/fitz/untar.$O\
+ source/fitz/unzip.$O\
+ source/fitz/util.$O\
+ source/fitz/warp.$O\
+ source/fitz/writer.$O\
+ source/fitz/xml.$O\
+ source/fitz/xmltext-device.$O\
+ source/fitz/zip.$O\
+ source/pdf/pdf-annot.$O\
+ source/pdf/pdf-appearance.$O\
+ source/pdf/pdf-clean-file.$O\
+ source/pdf/pdf-clean.$O\
+ source/pdf/pdf-cmap-load.$O\
+ source/pdf/pdf-cmap-parse.$O\
+ source/pdf/pdf-cmap.$O\
+ source/pdf/pdf-colorspace.$O\
+ source/pdf/pdf-crypt.$O\
+ source/pdf/pdf-device.$O\
+ source/pdf/pdf-event.$O\
+ source/pdf/pdf-font-add.$O\
+ source/pdf/pdf-font.$O\
+ source/pdf/pdf-form.$O\
+ source/pdf/pdf-function.$O\
+ source/pdf/pdf-graft.$O\
+ source/pdf/pdf-image.$O\
+ source/pdf/pdf-interpret.$O\
+ source/pdf/pdf-js.$O\
+ source/pdf/pdf-layer.$O\
+ source/pdf/pdf-lex.$O\
+ source/pdf/pdf-link.$O\
+ source/pdf/pdf-metrics.$O\
+ source/pdf/pdf-nametree.$O\
+ source/pdf/pdf-object.$O\
+ source/pdf/pdf-op-buffer.$O\
+ source/pdf/pdf-op-filter.$O\
+ source/pdf/pdf-op-run.$O\
+ source/pdf/pdf-outline.$O\
+ source/pdf/pdf-page.$O\
+ source/pdf/pdf-parse.$O\
+ source/pdf/pdf-pattern.$O\
+ source/pdf/pdf-repair.$O\
+ source/pdf/pdf-resources.$O\
+ source/pdf/pdf-run.$O\
+ source/pdf/pdf-shade.$O\
+ source/pdf/pdf-signature.$O\
+ source/pdf/pdf-store.$O\
+ source/pdf/pdf-stream.$O\
+ source/pdf/pdf-type3.$O\
+ source/pdf/pdf-unicode.$O\
+ source/pdf/pdf-util.$O\
+ source/pdf/pdf-write.$O\
+ source/pdf/pdf-xobject.$O\
+ source/pdf/pdf-xref.$O\
+ source/svg/svg-color.$O\
+ source/svg/svg-doc.$O\
+ source/svg/svg-parse.$O\
+ source/svg/svg-run.$O\
+ source/xps/xps-common.$O\
+ source/xps/xps-doc.$O\
+ source/xps/xps-glyphs.$O\
+ source/xps/xps-gradient.$O\
+ source/xps/xps-image.$O\
+ source/xps/xps-link.$O\
+ source/xps/xps-outline.$O\
+ source/xps/xps-path.$O\
+ source/xps/xps-resource.$O\
+ source/xps/xps-tile.$O\
+ source/xps/xps-util.$O\
+ source/xps/xps-zip.$O
+
+default:V: $LIB
+
+$LIB: $LIBOBJ
+ ar vu $LIB $newmember
+
+%.$O: %.c
+ $CC $CFLAGS -o $target -c $stem.c
+
+$LIB(%.$O):N: %.$O
M source/fitz/color-fast.c => source/fitz/color-fast.c +1 -0
@@ 200,6 200,7 @@ fz_lookup_fast_color_converter(fz_context *ctx, fz_colorspace *ss, fz_colorspace
}
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find color converter");
+ return NULL; /* unreachable */
}
/* Fast pixmap color conversions */
M source/fitz/compress.c => source/fitz/compress.c +1 -1
@@ 23,7 23,7 @@ void fz_deflate(fz_context *ctx, unsigned char *dest, size_t *destLen, const uns
stream.next_out = dest;
stream.avail_out = 0;
- stream.next_in = (z_const Bytef *)source;
+ stream.next_in = (const Bytef *)source;
stream.avail_in = 0;
do {
M source/fitz/document.c => source/fitz/document.c +1 -0
@@ 405,6 405,7 @@ fz_load_page(fz_context *ctx, fz_document *doc, int number)
start += m;
}
fz_throw(ctx, FZ_ERROR_GENERIC, "Page not found: %d", number+1);
+ return NULL; /* unreachable */
}
fz_location fz_last_page(fz_context *ctx, fz_document *doc)
M source/fitz/font.c => source/fitz/font.c +2 -2
@@ 7,8 7,6 @@
#include "pixmap-imp.h"
#include <ft2build.h>
-#include "hb.h"
-#include "hb-ft.h"
#include <assert.h>
@@ 800,6 798,7 @@ fz_new_base14_font(fz_context *ctx, const char *name)
}
}
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin font with name '%s'", name);
+ return NULL; /* unreachable */
}
fz_font *
@@ 824,6 823,7 @@ fz_new_cjk_font(fz_context *ctx, int ordering)
}
}
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin CJK font");
+ return NULL; /* unreachable */
}
fz_font *
M source/fitz/list-device.c => source/fitz/list-device.c +2 -1
@@ 201,7 201,7 @@ fz_append_display_node(
const void *private_data,
size_t private_data_len)
{
- fz_display_node node = { 0 };
+ fz_display_node node;
fz_display_node *node_ptr;
fz_list_device *writer = (fz_list_device *)dev;
fz_display_list *list = writer->list;
@@ 220,6 220,7 @@ fz_append_display_node(
fz_rect local_rect;
size_t path_size = 0;
+ memset(&node, 0, sizeof(node));
switch (cmd)
{
case FZ_CMD_CLIP_PATH:
M source/fitz/load-jpx.c => source/fitz/load-jpx.c +1 -0
@@ 615,6 615,7 @@ fz_pixmap *
fz_load_jpx(fz_context *ctx, const unsigned char *data, size_t size, fz_colorspace *defcs)
{
fz_throw(ctx, FZ_ERROR_GENERIC, "JPX support disabled");
+ return NULL; /* unreachable */
}
void
M source/fitz/load-jxr.c => source/fitz/load-jxr.c +1 -0
@@ 448,6 448,7 @@ fz_pixmap *
fz_load_jxr(fz_context *ctx, const unsigned char *data, size_t size)
{
fz_throw(ctx, FZ_ERROR_GENERIC, "JPEG-XR codec is not available");
+ return NULL; /* unreachable */
}
void
M source/fitz/load-pnm.c => source/fitz/load-pnm.c +2 -0
@@ 186,6 186,7 @@ pnm_read_tupletype(fz_context *ctx, const unsigned char *p, const unsigned char
}
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown tuple type in pnm image");
+ return NULL; /* unreachable */
}
static const unsigned char *
@@ 219,6 220,7 @@ pnm_read_token(fz_context *ctx, const unsigned char *p, const unsigned char *e,
}
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown header token in pnm image");
+ return NULL; /* unreachable */
}
static int
M source/fitz/noto.c => source/fitz/noto.c +5 -0
@@ 391,6 391,7 @@ fz_lookup_noto_math_font(fz_context *ctx, int *size)
{
#ifndef TOFU_SYMBOL
RETURN(noto,NotoSansMath_Regular_otf);
+ return NULL; /* unreachable */
#else
return *size = 0, NULL;
#endif
@@ 401,6 402,7 @@ fz_lookup_noto_music_font(fz_context *ctx, int *size)
{
#ifndef TOFU_SYMBOL
RETURN(noto,NotoMusic_Regular_otf);
+ return NULL; /* unreachable */
#else
return *size = 0, NULL;
#endif
@@ 411,6 413,7 @@ fz_lookup_noto_symbol1_font(fz_context *ctx, int *size)
{
#ifndef TOFU_SYMBOL
RETURN(noto,NotoSansSymbols_Regular_otf);
+ return NULL; /* unreachable */
#else
return *size = 0, NULL;
#endif
@@ 421,6 424,7 @@ fz_lookup_noto_symbol2_font(fz_context *ctx, int *size)
{
#ifndef TOFU_SYMBOL
RETURN(noto,NotoSansSymbols2_Regular_otf);
+ return NULL; /* unreachable */
#else
return *size = 0, NULL;
#endif
@@ 431,6 435,7 @@ fz_lookup_noto_emoji_font(fz_context *ctx, int *size)
{
#ifndef TOFU_EMOJI
RETURN(noto,NotoEmoji_Regular_ttf);
+ return NULL; /* unreachable */
#else
return *size = 0, NULL;
#endif
M source/fitz/ocr-device.c => source/fitz/ocr-device.c +1 -0
@@ 1106,6 1106,7 @@ fz_new_ocr_device(fz_context *ctx,
{
#ifdef OCR_DISABLED
fz_throw(ctx, FZ_ERROR_GENERIC, "OCR Disabled in this build");
+ return NULL; /* unreachable */
#else
fz_ocr_device *dev;
M source/fitz/output-docx.c => source/fitz/output-docx.c +2 -0
@@ 376,11 376,13 @@ fz_document_writer *fz_new_docx_writer(fz_context *ctx, const char *format, cons
fz_document_writer *fz_new_docx_writer(fz_context *ctx, const char *format, const char *path, const char *options)
{
fz_throw(ctx, FZ_ERROR_GENERIC, "docx output not available in this build.");
+ return NULL; /* unreachable */
}
fz_document_writer *fz_new_docx_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
{
fz_throw(ctx, FZ_ERROR_GENERIC, "docx output not available in this build.");
+ return NULL; /* unreachable */
}
#endif
M source/fitz/output-pdfocr.c => source/fitz/output-pdfocr.c +4 -0
@@ 136,6 136,7 @@ fz_parse_pdfocr_options(fz_context *ctx, fz_pdfocr_options *opts, const char *ar
{
#ifdef OCR_DISABLED
fz_throw(ctx, FZ_ERROR_GENERIC, "No OCR support in this build");
+ return NULL; /* unreachable */
#else
const char *val;
@@ 857,6 858,7 @@ fz_band_writer *fz_new_pdfocr_band_writer(fz_context *ctx, fz_output *out, const
{
#ifdef OCR_DISABLED
fz_throw(ctx, FZ_ERROR_GENERIC, "No OCR support in this build");
+ return NULL; /* unreachable */
#else
pdfocr_band_writer *writer = fz_new_band_writer(ctx, pdfocr_band_writer, out);
@@ 1002,6 1004,7 @@ fz_new_pdfocr_writer_with_output(fz_context *ctx, fz_output *out, const char *op
{
#ifdef OCR_DISABLED
fz_throw(ctx, FZ_ERROR_GENERIC, "No OCR support in this build");
+ return NULL; /* unreachable */
#else
fz_pdfocr_writer *wri = fz_new_derived_document_writer(ctx, fz_pdfocr_writer, pdfocr_begin_page, pdfocr_end_page, pdfocr_close_writer, pdfocr_drop_writer);
@@ 1027,6 1030,7 @@ fz_new_pdfocr_writer(fz_context *ctx, const char *path, const char *options)
{
#ifdef OCR_DISABLED
fz_throw(ctx, FZ_ERROR_GENERIC, "No OCR support in this build");
+ return NULL; /* unreachable */
#else
fz_output *out = fz_new_output_with_path(ctx, path ? path : "out.pdfocr", 0);
fz_document_writer *wri = NULL;
M source/fitz/shade.c => source/fitz/shade.c +2 -2
@@ 1071,8 1071,8 @@ fz_bound_mesh(fz_context *ctx, fz_shade *shade)
shade->type == FZ_MESH_TYPE6 ||
shade->type == FZ_MESH_TYPE7)
return fz_bound_mesh_type4567(ctx, shade);
- else
- fz_throw(ctx, FZ_ERROR_GENERIC, "Unexpected mesh type %d\n", shade->type);
+ fz_throw(ctx, FZ_ERROR_GENERIC, "Unexpected mesh type %d\n", shade->type);
+ return (fz_rect){0, 0, 0, 0}; /* unreachable */
}
fz_shade *
M source/fitz/strtof.c => source/fitz/strtof.c +5 -2
@@ 4,11 4,14 @@
#include <errno.h>
#include <float.h>
+extern double __NaN(void);
+extern double __Inf(void);
+
#ifndef INFINITY
-#define INFINITY (DBL_MAX+DBL_MAX)
+#define INFINITY __Inf()
#endif
#ifndef NAN
-#define NAN (INFINITY-INFINITY)
+#define NAN __NaN()
#endif
/*
M source/fitz/unzip.c => source/fitz/unzip.c +2 -0
@@ 288,6 288,7 @@ static fz_stream *open_zip_entry(fz_context *ctx, fz_archive *arch, const char *
if (method == 8)
return fz_open_flated(ctx, file, -15);
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown zip method: %d", method);
+ return NULL; /* unreachable */
}
static fz_buffer *read_zip_entry(fz_context *ctx, fz_archive *arch, const char *name)
@@ 378,6 379,7 @@ static fz_buffer *read_zip_entry(fz_context *ctx, fz_archive *arch, const char *
fz_drop_buffer(ctx, ubuf);
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown zip method: %d", method);
+ return NULL; /* unreachable */
}
static int has_zip_entry(fz_context *ctx, fz_archive *arch, const char *name)
M source/fitz/writer.c => source/fitz/writer.c +2 -0
@@ 209,6 209,7 @@ fz_new_document_writer(fz_context *ctx, const char *path, const char *explicit_f
format = NULL;
}
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot detect document format");
+ return NULL; /* unreachable */
}
fz_document_writer *
@@ 244,6 245,7 @@ fz_new_document_writer_with_output(fz_context *ctx, fz_output *out, const char *
return fz_new_text_writer_with_output(ctx, "stext.json", out, options);
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown output document format: %s", format);
+ return NULL; /* unreachable */
}
void
M source/fitz/xml.c => source/fitz/xml.c +4 -0
@@ 4,7 4,9 @@
#include <stdlib.h>
#include <stdio.h>
+#if FZ_ENABLE_HTML
#include <gumbo.h>
+#endif
/* #define FZ_XML_SEQ */
@@ 845,6 847,7 @@ fz_parse_xml(fz_context *ctx, fz_buffer *buf, int preserve_white)
return xml;
}
+#if FZ_ENABLE_HTML
/*
Parse the contents of buffer into a tree of XML nodes, using the HTML5 syntax.
@@ 999,3 1002,4 @@ fz_parse_xml_from_html5(fz_context *ctx, fz_buffer *buf)
return xml;
}
+#endif
M source/pdf/pdf-colorspace.c => source/pdf/pdf-colorspace.c +1 -0
@@ 443,6 443,7 @@ pdf_load_colorspace_imp(fz_context *ctx, pdf_obj *obj)
}
fz_throw(ctx, FZ_ERROR_SYNTAX, "could not parse color space (%d 0 R)", pdf_to_num(ctx, obj));
+ return NULL; /* unreachable */
}
fz_colorspace *
M source/pdf/pdf-font.c => source/pdf/pdf-font.c +1 -0
@@ 1246,6 1246,7 @@ pdf_load_type0_font(fz_context *ctx, pdf_document *doc, pdf_obj *dict)
if (pdf_is_name(ctx, subtype) && pdf_name_eq(ctx, subtype, PDF_NAME(CIDFontType2)))
return load_cid_font(ctx, doc, dfont, encoding, to_unicode);
fz_throw(ctx, FZ_ERROR_SYNTAX, "unknown cid font type");
+ return NULL; /* unreachable */
}
/*
M source/pdf/pdf-form.c => source/pdf/pdf-form.c +1 -1
@@ 1785,7 1785,7 @@ void pdf_signature_set_value(fz_context *ctx, pdf_document *doc, pdf_obj *field,
}
pdf_dict_put(ctx, t, PDF_NAME(Type), PDF_NAME(TransformParams));
- pdf_dict_put(ctx, t, PDF_NAME(V), PDF_NAME(1_2));
+ pdf_dict_put(ctx, t, PDF_NAME(V), PDF_NAME(V1_2));
/* Record details within the document structure so that contents
* and byte_range can be updated with their correct values at
M source/pdf/pdf-object.c => source/pdf/pdf-object.c +1 -1
@@ 1381,7 1381,7 @@ pdf_obj *pdf_new_date(fz_context *ctx, pdf_document *doc, int64_t time)
{
char s[40];
time_t secs = time;
-#ifdef _POSIX_SOURCE
+#if 0
struct tm tmbuf, *tm = gmtime_r(&secs, &tmbuf);
#else
struct tm *tm = gmtime(&secs);
M source/pdf/pdf-page.c => source/pdf/pdf-page.c +1 -0
@@ 235,6 235,7 @@ pdf_count_pages_before_kid(fz_context *ctx, pdf_document *doc, pdf_obj *parent,
total++;
}
fz_throw(ctx, FZ_ERROR_GENERIC, "kid not found in parent's kids array");
+ return 0; /* unreachable */
}
static int
M source/pdf/pdf-parse.c => source/pdf/pdf-parse.c +1 -0
@@ 713,6 713,7 @@ pdf_parse_stm_obj(fz_context *ctx, pdf_document *doc, fz_stream *file, pdf_lexbu
case PDF_TOK_NULL: return PDF_NULL;
case PDF_TOK_INT: return pdf_new_int(ctx, buf->i);
default: fz_throw(ctx, FZ_ERROR_SYNTAX, "unknown token in object stream");
+ return NULL; /* unreachable */
}
}
M source/pdf/pdf-signature.c => source/pdf/pdf-signature.c +1 -1
@@ 207,7 207,7 @@ void pdf_sign_signature(fz_context *ctx, pdf_widget *widget, pdf_pkcs7_signer *s
pdf_obj *wobj = ((pdf_annot *)widget)->obj;
fz_rect rect;
time_t now = time(NULL);
-#ifdef _POSIX_SOURCE
+#if 0
struct tm tmbuf, *tm = gmtime_r(&now, &tmbuf);
#else
struct tm *tm = gmtime(&now);
M source/pdf/pdf-stream.c => source/pdf/pdf-stream.c +4 -0
@@ 688,6 688,7 @@ fz_buffer *pdf_load_raw_stream(fz_context *ctx, pdf_obj *ref)
if (pdf_is_stream(ctx, ref))
return pdf_load_raw_stream_number(ctx, pdf_get_indirect_document(ctx, ref), pdf_to_num(ctx, ref));
fz_throw(ctx, FZ_ERROR_GENERIC, "object is not a stream");
+ return NULL; /* unreachable */
}
fz_buffer *pdf_load_stream(fz_context *ctx, pdf_obj *ref)
@@ 695,6 696,7 @@ fz_buffer *pdf_load_stream(fz_context *ctx, pdf_obj *ref)
if (pdf_is_stream(ctx, ref))
return pdf_load_stream_number(ctx, pdf_get_indirect_document(ctx, ref), pdf_to_num(ctx, ref));
fz_throw(ctx, FZ_ERROR_GENERIC, "object is not a stream");
+ return NULL; /* unreachable */
}
fz_stream *pdf_open_raw_stream(fz_context *ctx, pdf_obj *ref)
@@ 702,6 704,7 @@ fz_stream *pdf_open_raw_stream(fz_context *ctx, pdf_obj *ref)
if (pdf_is_stream(ctx, ref))
return pdf_open_raw_stream_number(ctx, pdf_get_indirect_document(ctx, ref), pdf_to_num(ctx, ref));
fz_throw(ctx, FZ_ERROR_GENERIC, "object is not a stream");
+ return NULL; /* unreachable */
}
fz_stream *pdf_open_stream(fz_context *ctx, pdf_obj *ref)
@@ 709,4 712,5 @@ fz_stream *pdf_open_stream(fz_context *ctx, pdf_obj *ref)
if (pdf_is_stream(ctx, ref))
return pdf_open_stream_number(ctx, pdf_get_indirect_document(ctx, ref), pdf_to_num(ctx, ref));
fz_throw(ctx, FZ_ERROR_GENERIC, "object is not a stream");
+ return NULL; /* unreachable */
}
M source/xps/xps-doc.c => source/xps/xps-doc.c +1 -0
@@ 474,6 474,7 @@ xps_load_page(fz_context *ctx, fz_document *doc_, int chapter, int number)
}
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find page %d", number + 1);
+ return NULL; /* unreachable */
}
static int