summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonvalue.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-11-11 12:24:07 +0200
committerOrgad Shaneh <orgads@gmail.com>2015-11-13 03:56:20 +0000
commitbee361209f82425e6727a96c210ec6abf76b4bff (patch)
tree3769eb0d3f53bf975beb24f1ef8dfeead71ab263 /src/corelib/json/qjsonvalue.cpp
parent351853e04d585cc7e9098140fb50920d99597629 (diff)
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 <marc.mutz@kdab.com> Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/json/qjsonvalue.cpp')
-rw-r--r--src/corelib/json/qjsonvalue.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 4c7a44b4a0..328e07d18e 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -173,7 +173,7 @@ QJsonValue::QJsonValue(int n)
QJsonValue::QJsonValue(qint64 n)
: d(0), t(Double)
{
- this->dbl = n;
+ this->dbl = double(n);
}
/*!
@@ -515,7 +515,7 @@ bool QJsonValue::toBool(bool defaultValue) const
int QJsonValue::toInt(int defaultValue) const
{
if (t == Double && int(dbl) == dbl)
- return dbl;
+ return int(dbl);
return defaultValue;
}