Fixed QJsonDocument::fromBinaryData on big endian platforms.
Change-Id: I1786b6222867c8780f6768e5220e7ddff952b28e Reviewed-by: Lars Knoll <lars.knoll@digia.com>bb10
parent
609d2eebe8
commit
855018ac55
|
|
@ -278,9 +278,9 @@ int Value::usedStorage(const Base *b) const
|
|||
case QJsonValue::String: {
|
||||
char *d = data(b);
|
||||
if (latinOrIntValue)
|
||||
s = sizeof(ushort) + *(ushort *)d;
|
||||
s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d);
|
||||
else
|
||||
s = sizeof(int) + sizeof(ushort)*(*(int *)d);
|
||||
s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);
|
||||
break;
|
||||
}
|
||||
case QJsonValue::Array:
|
||||
|
|
|
|||
|
|
@ -590,9 +590,9 @@ public:
|
|||
int size() const {
|
||||
int s = sizeof(Entry);
|
||||
if (value.latinKey)
|
||||
s += sizeof(ushort) + *(ushort *) ((const char *)this + sizeof(Entry));
|
||||
s += sizeof(ushort) + qFromLittleEndian(*(ushort *) ((const char *)this + sizeof(Entry)));
|
||||
else
|
||||
s += sizeof(uint) + *(int *) ((const char *)this + sizeof(Entry));
|
||||
s += sizeof(uint) + qFromLittleEndian(*(int *) ((const char *)this + sizeof(Entry)));
|
||||
return alignedSize(s);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue