diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-04-03 13:23:55 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-04 23:29:52 +0200 |
commit | 4c892e14c6929e174c8bccc9ec5693a63a8ce69c (patch) | |
tree | c8e08cd6dc541fd122f395ea2c74f8733f31fc63 /src/tools | |
parent | a959f34d716f42925b22d42838e7a4b97e415c69 (diff) |
Introduce initializer macros for QString- and QByteArrayData
This enables easier updating of those structs, by reducing the amount of
code that needs to be fixed. The common (and known) use cases are
covered by the two macros being introduced in each case.
Change-Id: I44981ca9b9b034f99238a11797b30bb85471cfb7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/generator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 71df7e7579..cc66ca9963 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -196,11 +196,11 @@ void Generator::generateCode() // stringdata.stringdata member, and 2) the stringdata.data index of the // QByteArrayData being defined. This calculation relies on the // QByteArrayData::data() implementation returning simply "this + offset". - fprintf(out, "#define QT_MOC_LITERAL(idx, ofs, len) { \\\n" - " Q_REFCOUNT_INITIALIZE_STATIC, len, 0, 0, \\\n" + fprintf(out, "#define QT_MOC_LITERAL(idx, ofs, len) \\\n" + " Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\\n" " offsetof(qt_meta_stringdata_%s_t, stringdata) + ofs \\\n" " - idx * sizeof(QByteArrayData) \\\n" - " }\n", + " )\n", qualifiedClassNameIdentifier.constData()); fprintf(out, "static const qt_meta_stringdata_%s_t qt_meta_stringdata_%s = {\n", |