From bee361209f82425e6727a96c210ec6abf76b4bff Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 11 Nov 2015 12:24:07 +0200 Subject: JSON: Fix MSVC2013 warnings json_p.h(283) : warning C4800: 'uint64_t' : forcing value to bool 'true' or 'false' (performance warning) json_p.h(546) : warning C4800: 'uint32_t' : forcing value to bool 'true' or 'false' (performance warning) qjsonvalue.cpp(176) : warning C4244: '=' : conversion from 'int64_t' to 'double', possible loss of data qjsonvalue.cpp(518) : warning C4244: 'return' : conversion from 'const double' to 'int', possible loss of data Change-Id: I2a24f90f7615aeb47f747ecbe3b580f23773ebda Reviewed-by: Marc Mutz Reviewed-by: hjk Reviewed-by: Lars Knoll --- src/corelib/json/qjson_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/json/qjson_p.h') diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index 5fc021c841..35a16b0ef6 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -280,7 +280,7 @@ static inline int compressedNumber(double d) if (non_int) return INT_MAX; - bool neg = (val >> 63); + bool neg = (val >> 63) != 0; val &= fraction_mask; val |= ((quint64)1 << 52); int res = (int)(val >> (52 - exp)); @@ -543,7 +543,7 @@ public: offset tableOffset; // content follows here - inline bool isObject() const { return is_object; } + inline bool isObject() const { return !!is_object; } inline bool isArray() const { return !isObject(); } inline offset *table() const { return (offset *) (((char *) this) + tableOffset); } -- cgit v1.2.3