From 4c892e14c6929e174c8bccc9ec5693a63a8ce69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 3 Apr 2012 13:23:55 +0200 Subject: 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 --- src/tools/moc/generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tools/moc/generator.cpp') 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", -- cgit v1.2.3