Make QJsonPrivate::String compile on big endian platforms.
Was missing a variable declaration and an explicit cast. Change-Id: I4f0fb9c3d9b8472adf0d91036442adc1fe255c7e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
bcb0f28a4d
commit
76afa1556c
@ -309,6 +309,7 @@ public:
|
|||||||
{
|
{
|
||||||
d->length = str.length();
|
d->length = str.length();
|
||||||
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||||
|
const qle_ushort *uc = (const qle_ushort *)str.unicode();
|
||||||
for (int i = 0; i < str.length(); ++i)
|
for (int i = 0; i < str.length(); ++i)
|
||||||
d->utf16[i] = uc[i];
|
d->utf16[i] = uc[i];
|
||||||
#else
|
#else
|
||||||
@ -359,7 +360,7 @@ public:
|
|||||||
QString str(l, Qt::Uninitialized);
|
QString str(l, Qt::Uninitialized);
|
||||||
QChar *ch = str.data();
|
QChar *ch = str.data();
|
||||||
for (int i = 0; i < l; ++i)
|
for (int i = 0; i < l; ++i)
|
||||||
ch[i] = d->utf16[i];
|
ch[i] = QChar(d->utf16[i]);
|
||||||
return str;
|
return str;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user