summaryrefslogtreecommitdiff
path: root/source/fitz/printf.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-03-25 18:13:28 +0100
committerRobin Watts <robin.watts@artifex.com>2014-03-25 17:18:12 +0000
commit680156458242c87bfa9f3013cc5d23308409e8de (patch)
tree783434fdf72e37d79efba889ba981cbfdbe5aedd /source/fitz/printf.c
parent3f4dd55e7bbcff9d26069cf763829fceca180367 (diff)
downloadmupdf-680156458242c87bfa9f3013cc5d23308409e8de.tar.xz
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).
Diffstat (limited to 'source/fitz/printf.c')
-rw-r--r--source/fitz/printf.c14
1 files changed, 6 insertions, 8 deletions
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':