diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-02-01 17:04:19 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 01:56:03 +0100 |
commit | bd8ef8d073201504a983249c4006c827befacf09 (patch) | |
tree | e096d27c74b4183996026d57ad93b4fca4afa43b /src/corelib/json/qjsonwriter.cpp | |
parent | 15f253a46aa45e2a9fa1055799fa2768ba49b9a3 (diff) |
Fix some warnings from clang
One of them was a real error, that could
lead to Data::alloc containing wrong values.
Change-Id: I48315ef6fd59188630107ebbe7bf8dbaa5da689e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/json/qjsonwriter.cpp')
-rw-r--r-- | src/corelib/json/qjsonwriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index aa6dc5d7b8..d544e6154b 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -261,7 +261,7 @@ static void objectContentToJson(const QJsonPrivate::Object *o, QByteArray &json, void Writer::objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int indent, bool compact) { - json.reserve(json.size() + (o ? o->size : 16)); + json.reserve(json.size() + (o ? (int)o->size : 16)); json += compact ? "{" : "{\n"; objectContentToJson(o, json, indent + (compact ? 0 : 1), compact); json += QByteArray(4*indent, ' '); @@ -270,7 +270,7 @@ void Writer::objectToJson(const QJsonPrivate::Object *o, QByteArray &json, int i void Writer::arrayToJson(const QJsonPrivate::Array *a, QByteArray &json, int indent, bool compact) { - json.reserve(json.size() + (a ? a->size : 16)); + json.reserve(json.size() + (a ? (int)a->size : 16)); json += compact ? "[" : "[\n"; arrayContentToJson(a, json, indent + (compact ? 0 : 1), compact); json += QByteArray(4*indent, ' '); |