summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-font.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-01-02 21:27:15 +0100
committerRobin Watts <robin.watts@artifex.com>2014-01-06 13:13:35 +0000
commit9b92bac1ec135862132b1c49b977b53891b73d88 (patch)
treedfd5faac92aa678cc5c8b23ae626d347b9d17494 /source/pdf/pdf-font.c
parentf6fe26922653b45519d406bd07840719cef1d979 (diff)
downloadmupdf-9b92bac1ec135862132b1c49b977b53891b73d88.tar.xz
fix various MSVC warnings
Some warnings we'd like to enable for MuPDF and still be able to compile it with warnings as errors using MSVC (2008 to 2013): * C4115: 'timeval' : named type definition in parentheses * C4204: nonstandard extension used : non-constant aggregate initializer * C4295: 'hex' : array is too small to include a terminating null character * C4389: '==' : signed/unsigned mismatch * C4702: unreachable code * C4706: assignment within conditional expression Also, globally disable C4701 which is frequently caused by MSVC not being able to correctly figure out fz_try/fz_catch code flow. And don't define isnan for VS2013 and later where that's no longer needed.
Diffstat (limited to 'source/pdf/pdf-font.c')
-rw-r--r--source/pdf/pdf-font.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c
index 0d387151..efb1eee6 100644
--- a/source/pdf/pdf-font.c
+++ b/source/pdf/pdf-font.c
@@ -821,7 +821,7 @@ pdf_load_hail_mary_font(pdf_document *doc)
pdf_font_desc *fontdesc;
pdf_font_desc *existing;
- if ((fontdesc = fz_find_item(ctx, pdf_free_font_imp, &hail_mary_store_type, &hail_mary_store_type)))
+ if ((fontdesc = fz_find_item(ctx, pdf_free_font_imp, &hail_mary_store_type, &hail_mary_store_type)) != NULL)
{
return fontdesc;
}
@@ -1101,12 +1101,9 @@ pdf_load_type0_font(pdf_document *doc, pdf_obj *dict)
if (pdf_is_name(subtype) && !strcmp(pdf_to_name(subtype), "CIDFontType0"))
return load_cid_font(doc, dfont, encoding, to_unicode);
- else if (pdf_is_name(subtype) && !strcmp(pdf_to_name(subtype), "CIDFontType2"))
+ if (pdf_is_name(subtype) && !strcmp(pdf_to_name(subtype), "CIDFontType2"))
return load_cid_font(doc, dfont, encoding, to_unicode);
- else
- fz_throw(doc->ctx, FZ_ERROR_GENERIC, "syntaxerror: unknown cid font type");
-
- return NULL; /* Stupid MSVC */
+ fz_throw(doc->ctx, FZ_ERROR_GENERIC, "syntaxerror: unknown cid font type");
}
/*
@@ -1224,7 +1221,7 @@ pdf_load_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, int nested_depth)
pdf_font_desc *fontdesc;
int type3 = 0;
- if ((fontdesc = pdf_find_item(ctx, pdf_free_font_imp, dict)))
+ if ((fontdesc = pdf_find_item(ctx, pdf_free_font_imp, dict)) != NULL)
{
return fontdesc;
}