diff options
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 7bbc4d2835..20e8db528e 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -362,11 +362,14 @@ static_assert(sizeof(Class) == 24, "Class structure needs to have the expected s // Qml data structures -struct Q_QML_EXPORT TranslationData { +struct Q_QML_EXPORT TranslationData +{ + quint32_le stringIndex; quint32_le commentIndex; qint32_le number; + quint32_le padding; }; -static_assert(sizeof(TranslationData) == 8, "TranslationData structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(TranslationData) == 16, "TranslationData structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct Q_QML_PRIVATE_EXPORT Binding { @@ -407,15 +410,13 @@ struct Q_QML_PRIVATE_EXPORT Binding quint32_le constantValueIndex; quint32_le compiledScriptIndex; // used when Type_Script quint32_le objectIndex; - TranslationData translationData; // used when Type_Translation + quint32_le translationDataIndex; // used when Type_Translation } value; - quint32_le stringIndex; // Set for Type_String, Type_Translation and Type_Script (the latter because of script strings) + quint32_le stringIndex; // Set for Type_String and Type_Script (the latter because of script strings) Location location; Location valueLocation; - quint32_le padding; - bool isValueBinding() const { if (type == Type_AttachedProperty @@ -490,7 +491,7 @@ struct Q_QML_PRIVATE_EXPORT Binding }; -static_assert(sizeof(Binding) == 32, "Binding structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Binding) == 24, "Binding structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct EnumValue { @@ -799,6 +800,8 @@ struct Unit quint32_le offsetToConstantTable; quint32_le jsClassTableSize; quint32_le offsetToJSClassTable; + quint32_le translationTableSize; + quint32_le offsetToTranslationTable; qint32_le indexOfRootFunction; quint32_le sourceFileIndex; quint32_le finalUrlIndex; @@ -889,9 +892,13 @@ struct Unit *nMembers = klass->nMembers; return reinterpret_cast<const JSClassMember*>(ptr + sizeof(JSClass)); } + + const TranslationData *translations() const { + return reinterpret_cast<const TranslationData *>(reinterpret_cast<const char *>(this) + offsetToTranslationTable); + } }; -static_assert(sizeof(Unit) == 208, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Unit) == 216, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct TypeReference { |