From 680156458242c87bfa9f3013cc5d23308409e8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Tue, 25 Mar 2014 18:13:28 +0100 Subject: fix warnings in fitz/printf.c This fixes three instances of warning C4706, allows compilation with VS2013 and prevents an accidental va_end for when va_end is defined (which is the case for debug builds). --- source/fitz/printf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/fitz/printf.c b/source/fitz/printf.c index e06ec486..a1af9436 100644 --- a/source/fitz/printf.c +++ b/source/fitz/printf.c @@ -1,14 +1,12 @@ #include "mupdf/fitz.h" -#ifdef _MSC_VER /* Microsoft Visual C */ +/* Microsoft Visual C up to VS2012 */ +#if _MSC_VER < 1800 #define va_copy(a, oa) do { a=oa; } while (0) -#ifndef va_end +#undef va_end #define va_end(a) -#endif -#ifndef strtof #define strtof(a, b) ((float)strtod((a), (b))) #endif -#endif struct fmtbuf { @@ -132,7 +130,7 @@ static void fmtquote(struct fmtbuf *out, const char *s, int sq, int eq) { int c; fmtputc(out, sq); - while ((c = *s++)) { + while ((c = *s++) != 0) { switch (c) { default: if (c < 32 || c > 127) { @@ -172,7 +170,7 @@ fz_vsnprintf(char *buffer, int space, const char *fmt, va_list args) out.s = space; out.n = 0; - while ((c = *fmt++)) + while ((c = *fmt++) != 0) { if (c == '%') { c = *fmt++; @@ -248,7 +246,7 @@ fz_vsnprintf(char *buffer, int space, const char *fmt, va_list args) s = va_arg(args, char*); if (!s) s = "(null)"; - while ((c = *s++)) + while ((c = *s++) != 0) fmtputc(&out, c); break; case 'q': -- cgit v1.2.3