From 9b92bac1ec135862132b1c49b977b53891b73d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Thu, 2 Jan 2014 21:27:15 +0100 Subject: 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. --- include/mupdf/fitz/system.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h index e9f337b5..1decfda6 100644 --- a/include/mupdf/fitz/system.h +++ b/include/mupdf/fitz/system.h @@ -74,15 +74,19 @@ typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; #pragma warning( disable: 4244 ) /* conversion from X to Y, possible loss of data */ -#pragma warning( disable: 4996 ) /* The POSIX name for this item is deprecated */ -#pragma warning( disable: 4996 ) /* This function or variable may be unsafe */ +#pragma warning( disable: 4701 ) /* Potentially uninitialized local variable 'name' used */ +#pragma warning( disable: 4996 ) /* 'function': was declared deprecated */ #include +struct timeval; +struct timezone; int gettimeofday(struct timeval *tv, struct timezone *tz); #define snprintf _snprintf +#if _MSC_VER < 1800 #define isnan _isnan +#endif #define hypotf _hypotf #define fopen fz_fopen_utf8 -- cgit v1.2.3