Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-scxml for openSUSE:Factory checked in at 2024-04-08 17:39:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-scxml (Old) and /work/SRC/openSUSE:Factory/.qt6-scxml.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qt6-scxml" Mon Apr 8 17:39:06 2024 rev:25 rq:1165800 version:6.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-scxml/qt6-scxml.changes 2024-03-28 14:22:47.600204120 +0100 +++ /work/SRC/openSUSE:Factory/.qt6-scxml.new.1905/qt6-scxml.changes 2024-04-08 17:51:30.079978850 +0200 @@ -1,0 +2,6 @@ +Tue Apr 2 13:39:55 UTC 2024 - Christophe Marin <christo...@krop.fr> + +- Update to 6.7.0: + * https://www.qt.io/blog/qt-6.7-released + +------------------------------------------------------------------- Old: ---- qtscxml-everywhere-src-6.6.3.tar.xz New: ---- qtscxml-everywhere-src-6.7.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-scxml.spec ++++++ --- /var/tmp/diff_new_pack.hGJKXZ/_old 2024-04-08 17:51:31.136017826 +0200 +++ /var/tmp/diff_new_pack.hGJKXZ/_new 2024-04-08 17:51:31.136017826 +0200 @@ -16,8 +16,8 @@ # -%define real_version 6.6.3 -%define short_version 6.6 +%define real_version 6.7.0 +%define short_version 6.7 %define short_name qtscxml %define tar_name qtscxml-everywhere-src %define tar_suffix %{nil} @@ -28,7 +28,7 @@ %endif # Name: qt6-scxml%{?pkg_suffix} -Version: 6.6.3 +Version: 6.7.0 Release: 0 Summary: SCXML (state machine notation) compiler and related tools License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) ++++++ qtscxml-everywhere-src-6.6.3.tar.xz -> qtscxml-everywhere-src-6.7.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/.cmake.conf new/qtscxml-everywhere-src-6.7.0/.cmake.conf --- old/qtscxml-everywhere-src-6.6.3/.cmake.conf 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/.cmake.conf 2024-03-22 19:51:00.000000000 +0100 @@ -1,3 +1,5 @@ -set(QT_REPO_MODULE_VERSION "6.6.3") +set(QT_REPO_MODULE_VERSION "6.7.0") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1") +list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1") +list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_CONTEXTLESS_CONNECT=1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/.tag new/qtscxml-everywhere-src-6.7.0/.tag --- old/qtscxml-everywhere-src-6.6.3/.tag 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/.tag 2024-03-22 19:51:00.000000000 +0100 @@ -1 +1 @@ -7c3716741e93c0ab8ca3fe411f77bf6f3f52aef2 +0942dca79e25794bcb0d81cf04fdf74b621c489c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/coin/axivion/ci_config_linux.json new/qtscxml-everywhere-src-6.7.0/coin/axivion/ci_config_linux.json --- old/qtscxml-everywhere-src-6.6.3/coin/axivion/ci_config_linux.json 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/coin/axivion/ci_config_linux.json 2024-03-22 19:51:00.000000000 +0100 @@ -1,9 +1,5 @@ { "Project": { - "Git": { - "_active": true, - "sourceserver_gitdir": "/data/axivion/databases/$(env:TESTED_MODULE_COIN).git" - }, "BuildSystemIntegration": { "child_order": [ "GCCSetup", @@ -35,29 +31,14 @@ "plugin_files": [ "build/plugins/*/lib*.so*.ir" ] - }, - "Project-GlobalOptions": { - "directory": "../work/qt/$(env:TESTED_MODULE_COIN)", - "ir": "build/$(env:TESTED_MODULE_COIN).ir", - "name": "qt_$(env:TESTED_MODULE_COIN)_dev_$(env:TARGET_OS_COIN)" - } - }, - "Results": { - "Dashboard": { - "dashboard_url": "https://axivion-srv.ci.qt.io/axivion/" - }, - "Database": { - "ci_mode": { - "directory": "/data/axivion/databases" - } } }, "_Format": "1.0", - "_Version": "trunk-9e0ef9c5818", + "_Version": "7.6.2", "_VersionNum": [ 7, 6, - 9999, - 11489 + 2, + 12725 ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/dependencies.yaml new/qtscxml-everywhere-src-6.7.0/dependencies.yaml --- old/qtscxml-everywhere-src-6.6.3/dependencies.yaml 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/dependencies.yaml 2024-03-22 19:51:00.000000000 +0100 @@ -1,7 +1,7 @@ dependencies: ../qtbase: - ref: afdec885058c92e24604f398a926297222da06f3 + ref: 98602c26fc97eb41e3dd7548194ca637420a31b9 required: true ../qtdeclarative: - ref: ab5521fd1a637739c7e91def84caa84426055aff + ref: e6d14fcdc95713f65367499629f93fb1f1e35ec9 required: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/src/scxml/doc/qtscxml.qdocconf new/qtscxml-everywhere-src-6.7.0/src/scxml/doc/qtscxml.qdocconf --- old/qtscxml-everywhere-src-6.6.3/src/scxml/doc/qtscxml.qdocconf 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/src/scxml/doc/qtscxml.qdocconf 2024-03-22 19:51:00.000000000 +0100 @@ -53,6 +53,3 @@ # Highlighted examples in Data Processing & IO category manifestmeta.highlighted.names = "QtScxml/SCXML Sudoku" - -# Fail the documentation build if there are more warnings than the limit -warninglimit = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/src/scxmlqml/invokedservices.cpp new/qtscxml-everywhere-src-6.7.0/src/scxmlqml/invokedservices.cpp --- old/qtscxml-everywhere-src-6.6.3/src/scxmlqml/invokedservices.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/src/scxmlqml/invokedservices.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -77,12 +77,12 @@ m_stateMachine.setValueBypassingBindings(stateMachine); if (stateMachine) { - m_serviceConnection = QObject::connect( - stateMachine, &QScxmlStateMachine::invokedServicesChanged, - [this](){ - m_children.notify(); - emit childrenChanged(); - }); + m_serviceConnection = + QObject::connect(stateMachine, + &QScxmlStateMachine::invokedServicesChanged, this, [this]() { + m_children.notify(); + emit childrenChanged(); + }); } m_stateMachine.notify(); m_children.notify(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/src/statemachine/doc/qtstatemachine.qdocconf new/qtscxml-everywhere-src-6.7.0/src/statemachine/doc/qtstatemachine.qdocconf --- old/qtscxml-everywhere-src-6.6.3/src/statemachine/doc/qtstatemachine.qdocconf 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/src/statemachine/doc/qtstatemachine.qdocconf 2024-03-22 19:51:00.000000000 +0100 @@ -53,6 +53,3 @@ # Highlighted examples in Data Processing & IO category manifestmeta.highlighted.names = "QtStateMachine/Traffic Light" - -# Fail the documentation build if there are more warnings than the limit -warninglimit = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/src/statemachine/qabstracttransition_p.h new/qtscxml-everywhere-src-6.7.0/src/statemachine/qabstracttransition_p.h --- old/qtscxml-everywhere-src-6.6.3/src/statemachine/qabstracttransition_p.h 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/src/statemachine/qabstracttransition_p.h 2024-03-22 19:51:00.000000000 +0100 @@ -18,6 +18,7 @@ #include <private/qobject_p.h> #include <QtCore/qlist.h> +#include <QtCore/qpointer.h> #include <QtCore/qsharedpointer.h> QT_REQUIRE_CONFIG(statemachine); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/src/statemachineqml/signaltransition.cpp new/qtscxml-everywhere-src-6.7.0/src/statemachineqml/signaltransition.cpp --- old/qtscxml-everywhere-src-6.6.3/src/statemachineqml/signaltransition.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/src/statemachineqml/signaltransition.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -18,7 +18,7 @@ SignalTransition::SignalTransition(QState *parent) : QSignalTransition(this, SIGNAL(invokeYourself()), parent), m_complete(false), m_signalExpression(nullptr) { - connect(this, &SignalTransition::signalChanged, [this](){ m_signal.notify(); }); + connect(this, &SignalTransition::signalChanged, this, [this](){ m_signal.notify(); }); } bool SignalTransition::eventTest(QEvent *event) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/sync.profile new/qtscxml-everywhere-src-6.7.0/sync.profile --- old/qtscxml-everywhere-src-6.6.3/sync.profile 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/sync.profile 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -%modules = ( # path to module name map - "QtScxml" => "$basedir/src/scxml", - "QtScxmlQml" => "$basedir/src/scxmlqml", - "QtStateMachine" => "$basedir/src/statemachine", - "QtStateMachineQml" => "$basedir/src/statemachineqml" -); -%moduleheaders = ( # restrict the module headers to those found in relative path -); -%classnames = ( -); -%deprecatedheaders = ( -); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tests/auto/compiled/tst_compiled.cpp new/qtscxml-everywhere-src-6.7.0/tests/auto/compiled/tst_compiled.cpp --- old/qtscxml-everywhere-src-6.6.3/tests/auto/compiled/tst_compiled.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tests/auto/compiled/tst_compiled.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -234,7 +234,7 @@ ++doneCounter; }); - QObject::connect(&stateMachine, &QScxmlStateMachine::invokedServicesChanged, + QObject::connect(&stateMachine, &QScxmlStateMachine::invokedServicesChanged, this, [&invokableServicesCount](const QList<QScxmlInvokableService *> &services) { invokableServicesCount = services.size(); }); @@ -259,7 +259,7 @@ ++doneCounter; }); - QObject::connect(stateMachine.data(), &QScxmlStateMachine::invokedServicesChanged, + QObject::connect(stateMachine.data(), &QScxmlStateMachine::invokedServicesChanged, this, [&invokableServicesCount](const QList<QScxmlInvokableService *> &services) { invokableServicesCount = services.size(); }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/generator.cpp new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/generator.cpp --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/generator.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/generator.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -25,6 +25,8 @@ QT_BEGIN_NAMESPACE +using namespace QtMiscUtils; + // -- QtScxml void fprintf(QIODevice &out, const char *fmt, ...) { @@ -94,10 +96,11 @@ requireCompleteTypes(requireCompleteTypes) { if (cdef->superclassList.size()) - purestSuperClass = cdef->superclassList.constFirst().first; + purestSuperClass = cdef->superclassList.constFirst().classname; } // -- QtScxml +#if 0 // -- QtScxml static inline qsizetype lengthOfEscapeSequence(const QByteArray &s, qsizetype i) { if (s.at(i) != '\\' || i >= s.size() - 1) @@ -107,12 +110,12 @@ char ch = s.at(i); if (ch == 'x') { ++i; - while (i < s.size() && is_hex_char(s.at(i))) + while (i < s.size() && isHexDigit(s.at(i))) ++i; - } else if (is_octal_char(ch)) { + } else if (isOctalDigit(ch)) { while (i < startPos + 4 && i < s.size() - && is_octal_char(s.at(i))) { + && isOctalDigit(s.at(i))) { ++i; } } else { // single character escape sequence @@ -121,19 +124,6 @@ return i - startPos; } -static inline uint lengthOfEscapedString(const QByteArray &str) -{ - int extra = 0; - for (int j = 0; j < str.size(); ++j) { - if (str.at(j) == '\\') { - int cnt = lengthOfEscapeSequence(str, j) - 1; - extra += cnt; - j += cnt; - } - } - return str.size() - extra; -} - // Prints \a s to \a out, breaking it into lines of at most ColumnWidth. The // opening and closing quotes are NOT included (it's up to the caller). static void printStringWithIndentation(QIODevice &out, const QByteArray &s) // -- QtScxml @@ -154,6 +144,7 @@ idx += spanLen; } while (idx < len); } +#endif // -- QtSxcml void Generator::strreg(const QByteArray &s) { @@ -163,7 +154,7 @@ int Generator::stridx(const QByteArray &s) { - int i = strings.indexOf(s); + int i = int(strings.indexOf(s)); Q_ASSERT_X(i != -1, Q_FUNC_INFO, "We forgot to register some strings"); return i; } @@ -212,14 +203,14 @@ #undef STREAM_1ARG_TEMPLATE ; for (const QByteArray &oneArgTemplateType : oneArgTemplates) { - QByteArray ba = oneArgTemplateType + "<"; + const QByteArray ba = oneArgTemplateType + "<"; if (propertyType.startsWith(ba) && propertyType.endsWith(">")) { - const qsizetype argumentSize = propertyType.size() - oneArgTemplateType.size() - 1 + const qsizetype argumentSize = propertyType.size() - ba.size() // The closing '>' - 1 // templates inside templates have an extra whitespace char to strip. - (propertyType.at(propertyType.size() - 2) == ' ' ? 1 : 0 ); - const QByteArray templateArg = propertyType.mid(oneArgTemplateType.size() + 1, argumentSize); + const QByteArray templateArg = propertyType.sliced(ba.size(), argumentSize); return isBuiltinType(templateArg) || registerableMetaType(templateArg); } } @@ -304,84 +295,30 @@ fprintf(out, "\n#ifdef QT_MOC_HAS_STRINGDATA\n" "struct qt_meta_stringdata_%s_t {};\n" - "static constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(", + "constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(", qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); { char comma = 0; - for (const QByteArray &str : strings) { +// -- QtScxml + for (qsizetype i = 0, end = strings.size(); i < end; ++i) { if (comma) fputc(comma, out); - printStringWithIndentation(out, str); + fprintf(out, "\n {"); + const QByteArray s = strings.at(i); + const qsizetype len = s.size(); + for (qsizetype charPos = 0; charPos < len; ++charPos) + fprintf(out, "char(0x%.2x),", static_cast<quint8>(s.at(charPos))); + const bool isLast = (i == end - 1); + fprintf(out, "char(0)%s // %d: %s", isLast ? "}" : "},", i, s.constData()); comma = ','; } - } - fprintf(out, "\n);\n" - "#else // !QT_MOC_HAS_STRING_DATA\n"); - -#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0) - fprintf(out, "#error \"qtmochelpers.h not found or too old.\"\n"); -#else -// -// Build stringdata struct -// - - fprintf(out, "struct qt_meta_stringdata_%s_t {\n", qualifiedClassNameIdentifier.constData()); - fprintf(out, " uint offsetsAndSizes[%d];\n", int(strings.size() * 2)); - for (int i = 0; i < strings.size(); ++i) { - int thisLength = lengthOfEscapedString(strings.at(i)) + 1; -// -- QtScxml - fprintf(out, " char stringdata%d[%d];\n", i, thisLength); // -- QtScxml - } - fprintf(out, "};\n"); - - // Macro that simplifies the string data listing. The offset is calculated - // from the top of the stringdata object (i.e., past the uints). - fprintf(out, "#define QT_MOC_LITERAL(ofs, len) \\\n" - " uint(sizeof(qt_meta_stringdata_%s_t::offsetsAndSizes) + ofs), len \n", - qualifiedClassNameIdentifier.constData()); - fprintf(out, "Q_CONSTINIT static const qt_meta_stringdata_%s_t qt_meta_stringdata_%s = {\n", - qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); - fprintf(out, " {"); - { - int idx = 0; - for (int i = 0; i < strings.size(); ++i) { - const QByteArray &str = strings.at(i); - const QByteArray comment = str.size() > 32 ? str.left(29) + "..." : str; - const char *comma = (i != strings.size() - 1 ? "," : " "); - int len = lengthOfEscapedString(str); - fprintf(out, "\n QT_MOC_LITERAL(%d, %d)%s // \"%s\"", idx, len, comma, - comment.constData()); - - idx += len + 1; - } - fprintf(out, "\n }"); - } - -// -// Build stringdata arrays -// -// -- QtScxml - for (qsizetype i = 0, end = strings.size(); i < end; ++i) { - if (i == 0) - fprintf(out, ","); - fprintf(out, "\n {"); - const QByteArray s = strings.at(i); - const qsizetype len = s.size(); - for (qsizetype charPos = 0; charPos < len; ++charPos) - fprintf(out, "char(0x%.2x),", static_cast<quint8>(s.at(charPos))); - const bool isLast = (i == end - 1); - fprintf(out, "0%s // %d: %s", isLast ? "}" : "},", i, s.constData()); } -// -- QtScxml - -// Terminate stringdata struct - fprintf(out, "\n};\n"); - fprintf(out, "#undef QT_MOC_LITERAL\n"); -#endif // Qt 6.9 - - fprintf(out, "#endif // !QT_MOC_HAS_STRING_DATA\n"); + fprintf(out, "\n);\n" + "#else // !QT_MOC_HAS_STRINGDATA\n"); + fprintf(out, "#error \"qtmochelpers.h not found or too old.\"\n"); + fprintf(out, "#endif // !QT_MOC_HAS_STRINGDATA\n"); fprintf(out, "} // unnamed namespace\n\n"); // @@ -396,7 +333,15 @@ fprintf(out, " %4d, %4d, // classinfo\n", int(cdef->classInfoList.size()), int(cdef->classInfoList.size() ? index : 0)); index += cdef->classInfoList.size() * 2; - const qsizetype methodCount = cdef->signalList.size() + cdef->slotList.size() + cdef->methodList.size(); + qsizetype methodCount = 0; + if (qAddOverflow(cdef->signalList.size(), cdef->slotList.size(), &methodCount) + || qAddOverflow(cdef->methodList.size(), methodCount, &methodCount)) { +// -- QtScxml + qFatal("internal limit exceeded: the total number of member functions" + " (including signals and slots) is too big."); +// -- QtScxml + } + fprintf(out, " %4" PRIdQSIZETYPE ", %4d, // methods\n", methodCount, methodCount ? index : 0); index += methodCount * QMetaObjectPrivate::IntsPerMethod; if (cdef->revisionedMethods) @@ -408,7 +353,7 @@ + aggregateParameterCount(cdef->constructorList); index += totalParameterCount * 2 // types and parameter names - methodCount // return "parameters" don't have names - - cdef->constructorList.size(); // "this" parameters don't have names + - int(cdef->constructorList.size()); // "this" parameters don't have names fprintf(out, " %4d, %4d, // properties\n", int(cdef->propertyList.size()), int(cdef->propertyList.size() ? index : 0)); index += cdef->propertyList.size() * QMetaObjectPrivate::IntsPerProperty; @@ -436,8 +381,16 @@ // generateClassInfos(); + qsizetype propEnumCount = 0; // all property metatypes + all enum metatypes + 1 for the type of the current class itself - int initialMetaTypeOffset = cdef->propertyList.size() + cdef->enumList.size() + 1; + if (qAddOverflow(cdef->propertyList.size(), cdef->enumList.size(), &propEnumCount) + || qAddOverflow(propEnumCount, qsizetype(1), &propEnumCount) + || propEnumCount >= std::numeric_limits<int>::max()) { +// -- QtScxml + qFatal("internal limit exceeded: number of property and enum metatypes is too big."); +// -- QtScxml + } + int initialMetaTypeOffset = int(propEnumCount); // // Build signals array first, otherwise the signal indices would be wrong @@ -628,9 +581,9 @@ // metatypes for all exposed methods // because we definitely printed something above, this section doesn't need comma control - for (const QList<FunctionDef> &methodContainer : - { cdef->signalList, cdef->slotList, cdef->methodList }) { - for (const FunctionDef &fdef : methodContainer) { + const auto allMethods = {&cdef->signalList, &cdef->slotList, &cdef->methodList}; + for (const QList<FunctionDef> *methodContainer : allMethods) { + for (const FunctionDef &fdef : *methodContainer) { fprintf(out, ",\n // method '%s'\n %s", fdef.name.constData(), stringForType(fdef.type.name, false).constData()); for (const auto &argument: fdef.arguments) @@ -674,7 +627,7 @@ fprintf(out, "\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData()); fprintf(out, " if (!_clname) return nullptr;\n"); fprintf(out, " if (!strcmp(_clname, qt_meta_stringdata_%s.stringdata0))\n" - " return static_cast<void*>(this);\n", + " return static_cast<void*>(this);\n", qualifiedClassNameIdentifier.constData()); // for all superclasses but the first one @@ -682,10 +635,9 @@ auto it = cdef->superclassList.cbegin() + 1; const auto end = cdef->superclassList.cend(); for (; it != end; ++it) { - const auto &[className, access] = *it; - if (access == FunctionDef::Private) + if (it->access == FunctionDef::Private) continue; - const char *cname = className.constData(); + const char *cname = it->classname.constData(); fprintf(out, " if (!strcmp(_clname, \"%s\"))\n return static_cast< %s*>(this);\n", cname, cname); } @@ -715,8 +667,8 @@ // // Generate internal signal functions // - for (int signalindex = 0; signalindex < cdef->signalList.size(); ++signalindex) - generateSignal(&cdef->signalList[signalindex], signalindex); + for (int signalindex = 0; signalindex < int(cdef->signalList.size()); ++signalindex) + generateSignal(&cdef->signalList.at(signalindex), signalindex); // // Generate plugin meta data @@ -729,12 +681,29 @@ // Generate function to make sure the non-class signals exist in the parent classes // if (!cdef->nonClassSignalList.isEmpty()) { - fprintf(out, "// If you get a compile error in this function it can be because either\n"); - fprintf(out, "// a) You are using a NOTIFY signal that does not exist. Fix it.\n"); - fprintf(out, "// b) You are using a NOTIFY signal that does exist (in a parent class) but has a non-empty parameter list. This is a moc limitation.\n"); - fprintf(out, "[[maybe_unused]] static void checkNotifySignalValidity_%s(%s *t) {\n", qualifiedClassNameIdentifier.constData(), cdef->qualified.constData()); - for (const QByteArray &nonClassSignal : std::as_const(cdef->nonClassSignalList)) - fprintf(out, " t->%s();\n", nonClassSignal.constData()); + fprintf(out, "namespace CheckNotifySignalValidity_%s {\n", qualifiedClassNameIdentifier.constData()); + for (const QByteArray &nonClassSignal : std::as_const(cdef->nonClassSignalList)) { + const auto propertyIt = std::find_if(cdef->propertyList.constBegin(), + cdef->propertyList.constEnd(), + [&nonClassSignal](const PropertyDef &p) { + return nonClassSignal == p.notify; + }); + // must find something, otherwise checkProperties wouldn't have inserted an entry into nonClassSignalList + Q_ASSERT(propertyIt != cdef->propertyList.constEnd()); + fprintf(out, "template<typename T> using has_nullary_%s = decltype(std::declval<T>().%s());\n", + nonClassSignal.constData(), + nonClassSignal.constData()); + const auto &propertyType = propertyIt->type; + fprintf(out, "template<typename T> using has_unary_%s = decltype(std::declval<T>().%s(std::declval<%s>()));\n", + nonClassSignal.constData(), + nonClassSignal.constData(), + propertyType.constData()); + fprintf(out, "static_assert(qxp::is_detected_v<has_nullary_%s, %s> || qxp::is_detected_v<has_unary_%s, %s>,\n" + " \"NOTIFY signal %s does not exist in class (or is private in its parent)\");\n", + nonClassSignal.constData(), cdef->qualified.constData(), + nonClassSignal.constData(), cdef->qualified.constData(), + nonClassSignal.constData()); + } fprintf(out, "}\n"); } } @@ -823,7 +792,7 @@ comment.append(" | MethodIsConst "); } - int argc = f.arguments.size(); + const int argc = int(f.arguments.size()); fprintf(out, " %4d, %4d, %4d, %4d, 0x%02x, %4d /* %s */,\n", stridx(f.name), argc, paramsIndex, stridx(f.tag), flags, initialMetatypeOffset, comment.constData()); @@ -850,12 +819,12 @@ fprintf(out, " "); // Types - int argsCount = f.arguments.size(); - for (int j = -1; j < argsCount; ++j) { - if (j > -1) - fputc(' ', out); - const QByteArray &typeName = (j < 0) ? f.normalizedType : f.arguments.at(j).normalizedType; - generateTypeInfo(typeName, /*allowEmptyName=*/f.isConstructor); + const bool allowEmptyName = f.isConstructor; + generateTypeInfo(f.normalizedType, allowEmptyName); + fputc(',', out); + for (const ArgumentDef &arg : f.arguments) { + fputc(' ', out); + generateTypeInfo(arg.normalizedType, allowEmptyName); fputc(',', out); } @@ -953,7 +922,7 @@ int notifyId = p.notifyId; if (p.notifyId < -1) { // signal is in parent class - const int indexInStrings = strings.indexOf(p.notify); + const int indexInStrings = int(strings.indexOf(p.notify)); notifyId = indexInStrings | IsUnresolvedSignal; } fprintf(out, ", 0x%.8x, uint(%d), %d,\n", flags, notifyId, p.revision); @@ -1074,7 +1043,7 @@ QMultiMap<QByteArray, int> Generator::automaticPropertyMetaTypesHelper() { QMultiMap<QByteArray, int> automaticPropertyMetaTypes; - for (int i = 0; i < cdef->propertyList.size(); ++i) { + for (int i = 0; i < int(cdef->propertyList.size()); ++i) { const QByteArray propertyType = cdef->propertyList.at(i).type; if (registerableMetaType(propertyType) && !isBuiltinType(propertyType)) automaticPropertyMetaTypes.insert(propertyType, i); @@ -1124,7 +1093,7 @@ if (!cdef->constructorList.isEmpty()) { fprintf(out, " if (_c == QMetaObject::CreateInstance) {\n"); fprintf(out, " switch (_id) {\n"); - const int ctorend = cdef->constructorList.size(); + const int ctorend = int(cdef->constructorList.size()); for (int ctorindex = 0; ctorindex < ctorend; ++ctorindex) { fprintf(out, " case %d: { %s *_r = new %s(", ctorindex, cdef->classname.constData(), cdef->classname.constData()); @@ -1256,7 +1225,7 @@ fprintf(out, " else if (_c == QMetaObject::IndexOfMethod) {\n"); fprintf(out, " int *result = reinterpret_cast<int *>(_a[0]);\n"); bool anythingUsed = false; - for (int methodindex = 0; methodindex < cdef->signalList.size(); ++methodindex) { + for (int methodindex = 0; methodindex < int(cdef->signalList.size()); ++methodindex) { const FunctionDef &f = cdef->signalList.at(methodindex); if (f.wasCloned || !f.inPrivateClass.isEmpty() || f.isStatic) continue; @@ -1359,7 +1328,7 @@ if (needTempVarForGet) fprintf(out, " void *_v = _a[0];\n"); fprintf(out, " switch (_id) {\n"); - for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { + for (int propindex = 0; propindex < int(cdef->propertyList.size()); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); if (p.read.isEmpty() && p.member.isEmpty()) continue; @@ -1403,7 +1372,7 @@ setupMemberAccess(); fprintf(out, " void *_v = _a[0];\n"); fprintf(out, " switch (_id) {\n"); - for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { + for (int propindex = 0; propindex < int(cdef->propertyList.size()); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); if (p.constant) continue; @@ -1456,7 +1425,7 @@ if (needReset) { setupMemberAccess(); fprintf(out, " switch (_id) {\n"); - for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { + for (int propindex = 0; propindex < int(cdef->propertyList.size()); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); if (p.reset.isEmpty()) continue; @@ -1477,7 +1446,7 @@ if (hasBindableProperties) { setupMemberAccess(); fprintf(out, " switch (_id) {\n"); - for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { + for (int propindex = 0; propindex < int(cdef->propertyList.size()); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); if (p.bind.isEmpty()) continue; @@ -1513,7 +1482,7 @@ fprintf(out, "}\n"); } -void Generator::generateSignal(FunctionDef *def,int index) +void Generator::generateSignal(const FunctionDef *def, int index) { if (def->wasCloned || def->isAbstract) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/generator.h new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/generator.h --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/generator.h 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/generator.h 2024-03-22 19:51:00.000000000 +0100 @@ -27,6 +27,7 @@ QIODevice &outfile, // -- QtScxml bool requireCompleteTypes = false); void generateCode(); + qsizetype registeredStringsCount() { return strings.size(); }; // -- QtScxml void generateAccessorDefs(); @@ -50,8 +51,7 @@ void generateProperties(); void generateMetacall(); void generateStaticMetacall(); - void generateSignal(FunctionDef *def, int index); - void generateQPropertyApi(); + void generateSignal(const FunctionDef *def, int index); #if 0 // -- QtScxml void generatePluginMetaData(); #endif // -- QtScxml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc.cpp new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc.cpp --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -12,9 +12,9 @@ #include <QtCore/qdir.h> #include <QtCore/qjsondocument.h> -// -- QScxml +// -- QtScxml #include <QtCore/qjsonobject.h> -// -- QScxml +// -- QtScxml QT_BEGIN_NAMESPACE @@ -27,6 +27,15 @@ return ba.size() ? normalizeTypeInternal(ba.constBegin(), ba.constEnd()) : ba; } +const QByteArray &Moc::toFullyQualified(const QByteArray &name) const noexcept +{ + if (auto it = knownQObjectClasses.find(name); it != knownQObjectClasses.end()) + return it.value(); + if (auto it = knownGadgets.find(name); it != knownGadgets.end()) + return it.value(); + return name; +} + bool Moc::parseClassHead(ClassDef *def) { // figure out whether this is a class declaration, or only a @@ -88,17 +97,17 @@ else test(PUBLIC); test(VIRTUAL); - const QByteArray type = parseType().name; + const Type type = parseType(); // ignore the 'class Foo : BAR(Baz)' case if (test(LPAREN)) { until(RPAREN); } else { - def->superclassList += qMakePair(type, access); + def->superclassList.push_back({type.name, toFullyQualified(type.name), access}); } } while (test(COMMA)); if (!def->superclassList.isEmpty() - && knownGadgets.contains(def->superclassList.constFirst().first)) { + && knownGadgets.contains(def->superclassList.constFirst().classname)) { // Q_GADGET subclasses are treated as Q_GADGETs knownGadgets.insert(def->classname, def->qualified); knownGadgets.insert(def->qualified, def->qualified); @@ -319,6 +328,9 @@ def->arguments.removeLast(); def->isRawSlot = true; } + + if (Q_UNLIKELY(def->arguments.size() >= std::numeric_limits<int>::max())) + error("number of function arguments exceeds std::numeric_limits<int>::max()"); } bool Moc::testFunctionAttribute(FunctionDef *def) @@ -421,35 +433,29 @@ error(); } bool scopedFunctionName = false; - if (test(LPAREN)) { - def->name = def->type.name; - scopedFunctionName = def->type.isScoped; - def->type = Type("int"); - } else { - // we might have modifiers and attributes after a tag - // note that testFunctionAttribute is handled further below, - // and revisions and attributes must come first - while (testForFunctionModifiers(def)) {} - Type tempType = parseType();; - while (!tempType.name.isEmpty() && lookup() != LPAREN) { - if (testFunctionAttribute(def->type.firstToken, def)) - ; // fine - else if (def->type.firstToken == Q_SIGNALS_TOKEN) - error(); - else if (def->type.firstToken == Q_SLOTS_TOKEN) - error(); - else { - if (!def->tag.isEmpty()) - def->tag += ' '; - def->tag += def->type.name; - } - def->type = tempType; - tempType = parseType(); - } - next(LPAREN, "Not a signal or slot declaration"); - def->name = tempType.name; - scopedFunctionName = tempType.isScoped; - } + // we might have modifiers and attributes after a tag + // note that testFunctionAttribute is handled further below, + // and revisions and attributes must come first + while (testForFunctionModifiers(def)) {} + Type tempType = parseType();; + while (!tempType.name.isEmpty() && lookup() != LPAREN) { + if (testFunctionAttribute(def->type.firstToken, def)) + ; // fine + else if (def->type.firstToken == Q_SIGNALS_TOKEN) + error(); + else if (def->type.firstToken == Q_SLOTS_TOKEN) + error(); + else { + if (!def->tag.isEmpty()) + def->tag += ' '; + def->tag += def->type.name; + } + def->type = tempType; + tempType = parseType(); + } + next(LPAREN, "Not a signal or slot declaration"); + def->name = tempType.name; + scopedFunctionName = tempType.isScoped; if (!test(RPAREN)) { parseFunctionArguments(def); @@ -541,7 +547,8 @@ def->isConstructor = !tilde; def->type = Type(); } else { - def->type = Type("int"); + // missing type name? => Skip + return false; } } else { // ### TODO: The condition before testForFunctionModifiers shoulnd't be necessary, @@ -617,6 +624,42 @@ } } +void Moc::checkListSizes(const ClassDef &def) +{ + if (Q_UNLIKELY(def.nonClassSignalList.size() > std::numeric_limits<int>::max())) + error("number of signals defined in parent class(es) exceeds " + "std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.propertyList.size() > std::numeric_limits<int>::max())) + error("number of bindable properties exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.classInfoList.size() > std::numeric_limits<int>::max())) + error("number of times Q_CLASSINFO macro is used exceeds " + "std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.enumList.size() > std::numeric_limits<int>::max())) + error("number of enumerations exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.superclassList.size() > std::numeric_limits<int>::max())) + error("number of super classes exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.constructorList.size() > std::numeric_limits<int>::max())) + error("number of constructor parameters exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.signalList.size() > std::numeric_limits<int>::max())) + error("number of signals exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.slotList.size() > std::numeric_limits<int>::max())) + error("number of declared slots exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.methodList.size() > std::numeric_limits<int>::max())) + error("number of methods exceeds std::numeric_limits<int>::max()."); + + if (Q_UNLIKELY(def.publicList.size() > std::numeric_limits<int>::max())) + error("number of public functions declared in this class exceeds " + "std::numeric_limits<int>::max()."); +} + void Moc::parse() { QList<NamespaceDef> namespaceList; @@ -673,8 +716,10 @@ switch (next()) { case NAMESPACE: if (test(IDENTIFIER)) { - while (test(SCOPE)) + while (test(SCOPE)) { + test(INLINE); // ignore inline namespaces next(IDENTIFIER); + } if (test(EQ)) { // namespace Foo = Bar::Baz; until(SEMIC); @@ -988,6 +1033,8 @@ checkProperties(&def); + checkListSizes(def); + classList += def; QHash<QByteArray, QByteArray> &classHash = def.hasQObject ? knownQObjectClasses : knownGadgets; classHash.insert(def.classname, def.qualified); @@ -1007,8 +1054,10 @@ if (it != classList.end()) { it->classInfoList += def.classInfoList; + Q_ASSERT(it->classInfoList.size() <= std::numeric_limits<int>::max()); it->enumDeclarations.insert(def.enumDeclarations); it->enumList += def.enumList; + Q_ASSERT(it->enumList.size() <= std::numeric_limits<int>::max()); it->flagAliases.insert(def.flagAliases); } else { knownGadgets.insert(def.classname, def.qualified); @@ -1125,18 +1174,10 @@ for (const QByteArray &qtContainer : qtContainers) fprintf(out, "#include <QtCore/%s>\n", qtContainer.constData()); - fprintf(out, "\n%s#include <QtCore/qtmochelpers.h>\n%s\n", -#if QT_VERSION <= QT_VERSION_CHECK(6, 9, 0) - "#if __has_include(<QtCore/qtmochelpers.h>)\n", - "#else\n" - "QT_BEGIN_MOC_NAMESPACE\n" - "#endif\n" -#else - "", "" -#endif - ); + fprintf(out, "\n#include <QtCore/qtmochelpers.h>\n"); fprintf(out, "\n#include <memory>\n\n"); // For std::addressof + fprintf(out, "\n#include <QtCore/qxptype_traits.h>\n"); // is_detected fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n" "#error \"The header file '%s' doesn't include <QObject>.\"\n", fn.constData()); @@ -1159,9 +1200,15 @@ fputs("", out); for (ClassDef &def : classList) { - Generator generator(&def, metaTypes, knownQObjectClasses, knownGadgets, out, + Generator generator(this, &def, metaTypes, knownQObjectClasses, knownGadgets, out, requireCompleteTypes); generator.generateCode(); + + // generator.generateCode() should have already registered all strings + if (Q_UNLIKELY(generator.registeredStringsCount() >= std::numeric_limits<int>::max())) { + error("internal limit exceeded: number of parsed strings is too big."); + exit(EXIT_FAILURE); + } } fputs("", out); @@ -1822,7 +1869,7 @@ void Moc::checkSuperClasses(ClassDef *def) { Q_ASSERT(!def->superclassList.isEmpty()); - const QByteArray &firstSuperclass = def->superclassList.at(0).first; + const QByteArray &firstSuperclass = def->superclassList.at(0).classname; if (!knownQObjectClasses.contains(firstSuperclass)) { // enable once we /require/ include paths @@ -1848,7 +1895,7 @@ const auto end = def->superclassList.cend(); auto it = def->superclassList.cbegin() + 1; for (; it != end; ++it) { - const QByteArray &superClass = it->first; + const QByteArray &superClass = it->classname; if (knownQObjectClasses.contains(superClass)) { const QByteArray msg = "Class " @@ -1884,28 +1931,25 @@ // returning pointers, or const char * for QByteArray. // QDuplicateTracker<QByteArray> definedProperties(cdef->propertyList.size()); - for (int i = 0; i < cdef->propertyList.size(); ++i) { - PropertyDef &p = cdef->propertyList[i]; + auto hasNoAttributes = [&](const PropertyDef &p) { if (definedProperties.hasSeen(p.name)) { QByteArray msg = "The property '" + p.name + "' is defined multiple times in class " + cdef->classname + "."; warning(msg.constData()); } if (p.read.isEmpty() && p.member.isEmpty() && p.bind.isEmpty()) { - const qsizetype rewind = index; - if (p.location >= 0) - index = p.location; QByteArray msg = "Property declaration " + p.name + " has neither an associated QProperty<> member" ", nor a READ accessor function nor an associated MEMBER variable. The property will be invalid."; - warning(msg.constData()); - index = rewind; - if (p.write.isEmpty()) { - cdef->propertyList.removeAt(i); - --i; - } - continue; + const auto &sym = p.location >= 0 ? symbolAt(p.location) : Symbol(); + warning(sym, msg.constData()); + if (p.write.isEmpty()) + return true; } + return false; + }; + cdef->propertyList.removeIf(hasNoAttributes); + for (PropertyDef &p : cdef->propertyList) { for (const FunctionDef &f : std::as_const(cdef->publicList)) { if (f.name != p.read) continue; @@ -1932,7 +1976,7 @@ } if (!p.notify.isEmpty()) { int notifyId = -1; - for (int j = 0; j < cdef->signalList.size(); ++j) { + for (int j = 0; j < int(cdef->signalList.size()); ++j) { const FunctionDef &f = cdef->signalList.at(j); if (f.name != p.notify) { continue; @@ -1943,10 +1987,10 @@ } p.notifyId = notifyId; if (notifyId == -1) { - int index = cdef->nonClassSignalList.indexOf(p.notify); + const int index = int(cdef->nonClassSignalList.indexOf(p.notify)); if (index == -1) { cdef->nonClassSignalList << p.notify; - p.notifyId = -1 - cdef->nonClassSignalList.size(); + p.notifyId = int(-1 - cdef->nonClassSignalList.size()); } else { p.notifyId = int(-2 - index); } @@ -1954,7 +1998,7 @@ } } } -#endif // -- QScxml +#endif // -- QtScxml QJsonObject ClassDef::toJson() const { @@ -2006,11 +2050,11 @@ QJsonArray superClasses; for (const auto &super: std::as_const(superclassList)) { - const auto name = super.first; - const auto access = super.second; QJsonObject superCls; - superCls["name"_L1] = QString::fromUtf8(name); - FunctionDef::accessToJson(&superCls, access); + superCls["name"_L1] = QString::fromUtf8(super.classname); + if (super.classname != super.qualified) + superCls["fullyQualifiedName"_L1] = QString::fromUtf8(super.qualified); + FunctionDef::accessToJson(&superCls, super.access); superClasses.append(superCls); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc.h new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc.h --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc.h 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc.h 2024-03-22 19:51:00.000000000 +0100 @@ -165,8 +165,15 @@ qsizetype end = 0; }; +struct SuperClass { + QByteArray classname; + QByteArray qualified; + FunctionDef::Access access; +}; +Q_DECLARE_TYPEINFO(SuperClass, Q_RELOCATABLE_TYPE); + struct ClassDef : BaseDef { - QList<QPair<QByteArray, FunctionDef::Access>> superclassList; + QList<SuperClass> superclassList; struct Interface { @@ -245,6 +252,8 @@ return index > def->begin && index < def->end - 1; } + const QByteArray &toFullyQualified(const QByteArray &name) const noexcept; + void prependNamespaces(BaseDef &def, const QList<NamespaceDef> &namespaceList) const; Type parseType(); @@ -292,6 +301,8 @@ void checkSuperClasses(ClassDef *def); void checkProperties(ClassDef* cdef); bool testForFunctionModifiers(FunctionDef *def); + + void checkListSizes(const ClassDef &def); }; #endif // -- QtScxml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/generator.cpp.patch new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/generator.cpp.patch --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/generator.cpp.patch 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/generator.cpp.patch 2024-03-22 19:51:00.000000000 +0100 @@ -1,5 +1,5 @@ ---- .upstream/generator.cpp 2023-08-11 10:37:23.940392525 +0200 -+++ generator.cpp 2023-08-21 11:25:19.407307372 +0200 +--- .upstream/generator.cpp 2024-02-01 11:08:00.055494626 +0100 ++++ generator.cpp 2024-02-05 14:18:32.229391845 +0100 @@ -4,7 +4,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 @@ -10,9 +10,9 @@ #include "outputrevision.h" #include "utils.h" #include <QtCore/qmetatype.h> -@@ -23,6 +25,29 @@ +@@ -25,6 +27,29 @@ - QT_BEGIN_NAMESPACE + using namespace QtMiscUtils; +// -- QtScxml +void fprintf(QIODevice &out, const char *fmt, ...) @@ -40,15 +40,16 @@ uint nameToBuiltinType(const QByteArray &name) { if (name.isEmpty()) -@@ -55,20 +80,23 @@ +@@ -57,22 +82,25 @@ return nullptr; } -- Generator::Generator(ClassDef *classDef, const QList<QByteArray> &metaTypes, +- Generator::Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes, - const QHash<QByteArray, QByteArray> &knownQObjectClasses, - const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile, - bool requireCompleteTypes) -- : out(outfile), +- : parser(moc), +- out(outfile), - cdef(classDef), - metaTypes(metaTypes), - knownQObjectClasses(knownQObjectClasses), @@ -56,7 +57,7 @@ - requireCompleteTypes(requireCompleteTypes) - { - if (cdef->superclassList.size()) -- purestSuperClass = cdef->superclassList.constFirst().first; +- purestSuperClass = cdef->superclassList.constFirst().classname; +// -- QtScxml +Generator::Generator(ClassDef *classDef, const QList<QByteArray> &metaTypes, + const QHash<QByteArray, QByteArray> &knownQObjectClasses, @@ -71,13 +72,15 @@ + requireCompleteTypes(requireCompleteTypes) +{ + if (cdef->superclassList.size()) -+ purestSuperClass = cdef->superclassList.constFirst().first; ++ purestSuperClass = cdef->superclassList.constFirst().classname; } +// -- QtScxml ++#if 0 // -- QtScxml static inline qsizetype lengthOfEscapeSequence(const QByteArray &s, qsizetype i) { -@@ -108,7 +136,7 @@ + if (s.at(i) != '\\' || i >= s.size() - 1) +@@ -98,7 +126,7 @@ // Prints \a s to \a out, breaking it into lines of at most ColumnWidth. The // opening and closing quotes are NOT included (it's up to the caller). @@ -86,40 +89,71 @@ { static constexpr int ColumnWidth = 72; const qsizetype len = s.size(); -@@ -301,7 +329,9 @@ - fprintf(out, " uint offsetsAndSizes[%d];\n", int(strings.size() * 2)); - for (int i = 0; i < strings.size(); ++i) { - int thisLength = lengthOfEscapedString(strings.at(i)) + 1; +@@ -116,6 +144,7 @@ + idx += spanLen; + } while (idx < len); + } ++#endif // -- QtSxcml + + void Generator::strreg(const QByteArray &s) + { +@@ -270,12 +299,21 @@ + qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); + { + char comma = 0; +- for (const QByteArray &str : strings) { ++// -- QtScxml ++ for (qsizetype i = 0, end = strings.size(); i < end; ++i) { + if (comma) + fputc(comma, out); +- printStringWithIndentation(out, str); ++ fprintf(out, "\n {"); ++ const QByteArray s = strings.at(i); ++ const qsizetype len = s.size(); ++ for (qsizetype charPos = 0; charPos < len; ++charPos) ++ fprintf(out, "char(0x%.2x),", static_cast<quint8>(s.at(charPos))); ++ const bool isLast = (i == end - 1); ++ fprintf(out, "char(0)%s // %d: %s", isLast ? "}" : "},", i, s.constData()); + comma = ','; + } ++// -- QtScxml ++ + } + fprintf(out, "\n);\n" + "#else // !QT_MOC_HAS_STRINGDATA\n"); +@@ -298,8 +336,10 @@ + qsizetype methodCount = 0; + if (qAddOverflow(cdef->signalList.size(), cdef->slotList.size(), &methodCount) + || qAddOverflow(cdef->methodList.size(), methodCount, &methodCount)) { +- parser->error("internal limit exceeded: the total number of member functions" +// -- QtScxml - fprintf(out, " char stringdata%d[%d];\n", i, thisLength); ++ qFatal("internal limit exceeded: the total number of member functions" + " (including signals and slots) is too big."); +// -- QtScxml } - fprintf(out, "};\n"); -@@ -332,10 +362,19 @@ - // - // Build stringdata arrays - // -- for (const QByteArray &s : std::as_const(strings)) { -- fputc(',', out); -- printStringWithIndentation(out, s); -+// -- QtScxml -+ for (qsizetype i = 0, end = strings.size(); i < end; ++i) { -+ if (i == 0) -+ fprintf(out, ","); -+ fprintf(out, "\n {"); -+ const QByteArray s = strings.at(i); -+ const qsizetype len = s.size(); -+ for (qsizetype charPos = 0; charPos < len; ++charPos) -+ fprintf(out, "char(0x%.2x),", static_cast<quint8>(s.at(charPos))); -+ const bool isLast = (i == end - 1); -+ fprintf(out, "0%s // %d: %s", isLast ? "}" : "},", i, s.constData()); - } + fprintf(out, " %4" PRIdQSIZETYPE ", %4d, // methods\n", methodCount, methodCount ? index : 0); +@@ -346,7 +386,9 @@ + if (qAddOverflow(cdef->propertyList.size(), cdef->enumList.size(), &propEnumCount) + || qAddOverflow(propEnumCount, qsizetype(1), &propEnumCount) + || propEnumCount >= std::numeric_limits<int>::max()) { +- parser->error("internal limit exceeded: number of property and enum metatypes is too big."); +// -- QtScxml ++ qFatal("internal limit exceeded: number of property and enum metatypes is too big."); ++// -- QtScxml + } + int initialMetaTypeOffset = int(propEnumCount); + +@@ -585,7 +627,7 @@ + fprintf(out, "\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData()); + fprintf(out, " if (!_clname) return nullptr;\n"); + fprintf(out, " if (!strcmp(_clname, qt_meta_stringdata_%s.stringdata0))\n" +- " return static_cast<void*>(this);\n", ++ " return static_cast<void*>(this);\n", + qualifiedClassNameIdentifier.constData()); - // Terminate stringdata struct - fprintf(out, "\n};\n"); -@@ -682,7 +721,9 @@ + // for all superclasses but the first one +@@ -631,7 +673,9 @@ // // Generate plugin meta data // @@ -129,7 +163,7 @@ // // Generate function to make sure the non-class signals exist in the parent classes -@@ -1134,6 +1175,13 @@ +@@ -1100,6 +1144,13 @@ const FunctionDef &f = methodList.at(methodindex); Q_ASSERT(!f.normalizedType.isEmpty()); fprintf(out, " case %d: ", methodindex); @@ -143,7 +177,7 @@ if (f.normalizedType != "void") fprintf(out, "{ %s _r = ", noRef(f.normalizedType).constData()); fprintf(out, "_t->"); -@@ -1212,6 +1260,10 @@ +@@ -1178,6 +1229,10 @@ const FunctionDef &f = cdef->signalList.at(methodindex); if (f.wasCloned || !f.inPrivateClass.isEmpty() || f.isStatic) continue; @@ -154,7 +188,7 @@ anythingUsed = true; fprintf(out, " {\n"); fprintf(out, " using _t = %s (%s::*)(",f.type.rawName.constData() , cdef->classname.constData()); -@@ -1234,7 +1286,7 @@ +@@ -1200,7 +1255,7 @@ else fprintf(out, ");\n"); fprintf(out, " if (_t _q_method = &%s::%s; *reinterpret_cast<_t *>(_a[1]) == _q_method) {\n", @@ -163,7 +197,7 @@ fprintf(out, " *result = %d;\n", methodindex); fprintf(out, " return;\n"); fprintf(out, " }\n }\n"); -@@ -1329,8 +1381,11 @@ +@@ -1295,8 +1350,11 @@ fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s%s().value(); break;\n", propindex, p.type.constData(), prefix.constData(), p.bind.constData()); else if (!p.read.isEmpty()) @@ -177,7 +211,7 @@ else fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s%s; break;\n", propindex, p.type.constData(), prefix.constData(), p.member.constData()); -@@ -1462,6 +1517,10 @@ +@@ -1428,6 +1486,10 @@ { if (def->wasCloned || def->isAbstract) return; @@ -188,7 +222,7 @@ fprintf(out, "\n// SIGNAL %d\n%s %s::%s(", index, def->type.name.constData(), cdef->qualified.constData(), def->name.constData()); -@@ -1510,10 +1569,8 @@ +@@ -1476,10 +1538,8 @@ if (def->normalizedType == "void") { fprintf(out, "nullptr"); } else { @@ -201,7 +235,7 @@ } int i; for (i = 1; i < offset; ++i) -@@ -1528,6 +1585,36 @@ +@@ -1494,6 +1554,36 @@ fprintf(out, "}\n"); } @@ -238,7 +272,7 @@ static CborError jsonValueToCbor(CborEncoder *parent, const QJsonValue &v); static CborError jsonObjectToCbor(CborEncoder *parent, const QJsonObject &o) { -@@ -1663,7 +1750,11 @@ +@@ -1629,7 +1719,11 @@ #define CBOR_ENCODER_WRITER_CONTROL 1 #define CBOR_ENCODER_WRITE_FUNCTION CborDevice::callback diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/generator.h.patch new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/generator.h.patch --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/generator.h.patch 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/generator.h.patch 2024-03-22 19:51:00.000000000 +0100 @@ -1,6 +1,6 @@ ---- .upstream/generator.h 2023-06-06 10:15:35.263646156 +0200 -+++ generator.h 2023-08-21 11:17:37.759825035 +0200 -@@ -6,20 +6,33 @@ +--- .upstream/generator.h 2023-06-22 20:40:43.078529554 +0200 ++++ generator.h 2024-02-05 14:06:04.258179059 +0100 +@@ -6,23 +6,34 @@ #include "moc.h" @@ -14,20 +14,23 @@ class Generator { +- Moc *parser = nullptr; - FILE *out; + QIODevice &out; // -- QtScxml ClassDef *cdef; QList<uint> meta_data; public: - Generator(ClassDef *classDef, const QList<QByteArray> &metaTypes, +- Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes, ++ Generator(ClassDef *classDef, const QList<QByteArray> &metaTypes, const QHash<QByteArray, QByteArray> &knownQObjectClasses, - const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile = nullptr, + const QHash<QByteArray, QByteArray> &knownGadgets, + QIODevice &outfile, // -- QtScxml bool requireCompleteTypes = false); void generateCode(); -+ + qsizetype registeredStringsCount() { return strings.size(); }; + +// -- QtScxml + void generateAccessorDefs(); + void generateSignalDefs(); @@ -36,11 +39,10 @@ private: bool registerableMetaType(const QByteArray &propertyType); void registerClassInfoStrings(); -@@ -38,7 +51,10 @@ +@@ -41,7 +52,9 @@ void generateMetacall(); void generateStaticMetacall(); - void generateSignal(FunctionDef *def, int index); -+ void generateQPropertyApi(); + void generateSignal(const FunctionDef *def, int index); +#if 0 // -- QtScxml void generatePluginMetaData(); +#endif // -- QtScxml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/moc.cpp.patch new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/moc.cpp.patch --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/moc.cpp.patch 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/moc.cpp.patch 2024-03-22 19:51:00.000000000 +0100 @@ -1,5 +1,5 @@ ---- .upstream/moc.cpp 2023-08-11 10:37:23.940392525 +0200 -+++ moc.cpp 2023-08-21 11:21:53.873272207 +0200 +--- .upstream/moc.cpp 2024-02-01 11:08:00.055494626 +0100 ++++ moc.cpp 2024-02-05 14:06:04.258179059 +0100 @@ -12,14 +12,15 @@ #include <QtCore/qdir.h> #include <QtCore/qjsondocument.h> @@ -7,9 +7,9 @@ -// for normalizeTypeInternal -#include <private/qmetaobject_moc_p.h> -#include <private/qduplicatetracker_p.h> -+// -- QScxml ++// -- QtScxml +#include <QtCore/qjsonobject.h> -+// -- QScxml ++// -- QtScxml QT_BEGIN_NAMESPACE @@ -19,11 +19,11 @@ // only moc needs this function static QByteArray normalizeType(const QByteArray &ba) { -@@ -1953,6 +1954,7 @@ +@@ -1997,6 +1998,7 @@ } } } -+#endif // -- QScxml ++#endif // -- QtScxml QJsonObject ClassDef::toJson() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/moc.h.patch new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/moc.h.patch --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/moc.h.patch 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/moc.h.patch 2024-03-22 19:51:00.000000000 +0100 @@ -1,17 +1,16 @@ ---- .upstream/moc.h 2023-08-11 10:37:23.940392525 +0200 -+++ moc.h 2023-08-21 11:17:37.751825117 +0200 -@@ -4,15 +4,12 @@ +--- .upstream/moc.h 2024-02-05 14:10:55.937714571 +0100 ++++ moc.h 2024-02-05 14:12:52.133597464 +0100 +@@ -4,14 +4,12 @@ #ifndef MOC_H #define MOC_H -#include "parser.h" -#include <qstringlist.h> -#include <qmap.h> --#include <qpair.h> -#include <qjsondocument.h> -#include <qjsonarray.h> -#include <qjsonobject.h> --#include <qversionnumber.h> +-#include <qtyperevision.h> -#include <stdio.h> +// -- QtScxml +#include <QtCore/qmap.h> @@ -22,7 +21,7 @@ #include <private/qtools_p.h> -@@ -24,16 +21,18 @@ +@@ -23,16 +21,18 @@ { enum ReferenceType { NoReference, Reference, RValueReference, Pointer }; @@ -43,7 +42,7 @@ ReferenceType referenceType; }; Q_DECLARE_TYPEINFO(Type, Q_RELOCATABLE_TYPE); -@@ -83,8 +82,9 @@ +@@ -82,8 +82,9 @@ bool inlineCode = false; bool wasCloned = false; @@ -54,7 +53,7 @@ bool isCompat = false; bool isInvokable = false; bool isScriptable = false; -@@ -98,6 +98,11 @@ +@@ -97,6 +98,11 @@ QJsonObject toJson() const; static void accessToJson(QJsonObject *obj, Access acs); @@ -66,7 +65,7 @@ }; Q_DECLARE_TYPEINFO(FunctionDef, Q_RELOCATABLE_TYPE); -@@ -125,6 +130,10 @@ +@@ -124,6 +130,10 @@ qsizetype location = -1; // token index, used for error reporting QJsonObject toJson() const; @@ -77,7 +76,7 @@ }; Q_DECLARE_TYPEINFO(PropertyDef, Q_RELOCATABLE_TYPE); -@@ -198,6 +207,7 @@ +@@ -204,6 +214,7 @@ }; Q_DECLARE_TYPEINFO(NamespaceDef, Q_RELOCATABLE_TYPE); @@ -85,9 +84,9 @@ class Moc : public Parser { public: -@@ -283,6 +293,7 @@ - void checkProperties(ClassDef* cdef); - bool testForFunctionModifiers(FunctionDef *def); +@@ -293,6 +304,7 @@ + + void checkListSizes(const ClassDef &def); }; +#endif // -- QtScxml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/outputrevision.h.patch new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/outputrevision.h.patch --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/moc_patches/outputrevision.h.patch 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/moc_patches/outputrevision.h.patch 2024-03-22 19:51:00.000000000 +0100 @@ -1,5 +1,5 @@ ---- .upstream/outputrevision.h 2022-07-14 10:20:51.543950028 +0200 -+++ outputrevision.h 2023-08-21 11:17:37.747825158 +0200 +--- .upstream/outputrevision.h 2022-05-23 08:46:14.490945334 +0200 ++++ outputrevision.h 2024-02-05 14:06:04.254179068 +0100 @@ -4,7 +4,13 @@ #ifndef OUTPUTREVISION_H #define OUTPUTREVISION_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/scxmlcppdumper.cpp new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/scxmlcppdumper.cpp --- old/qtscxml-everywhere-src-6.6.3/tools/qscxmlc/scxmlcppdumper.cpp 2024-03-19 00:53:03.000000000 +0100 +++ new/qtscxml-everywhere-src-6.7.0/tools/qscxmlc/scxmlcppdumper.cpp 2024-03-22 19:51:00.000000000 +0100 @@ -533,7 +533,9 @@ cpp << l("#include \"") << headerName << l("\"") << Qt::endl; cpp << Qt::endl << QStringLiteral("#include <qscxmlinvokableservice.h>") << Qt::endl - << QStringLiteral("#include <qscxmltabledata.h>") << Qt::endl; + << QStringLiteral("#include <qscxmltabledata.h>") << Qt::endl + << QStringLiteral("#include <QtCore/qtmochelpers.h>") << Qt::endl; + for (const QString &inc : std::as_const(includes)) { cpp << l("#include <") << inc << l(">") << Qt::endl; } @@ -727,7 +729,11 @@ ClassDef classDef; classDef.classname = className.toUtf8(); classDef.qualified = classDef.classname; - classDef.superclassList << qMakePair(QByteArray("QScxmlStateMachine"), FunctionDef::Public); + classDef.superclassList << SuperClass { + QByteArray("QScxmlStateMachine"), + QByteArray(QT_STRINGIFY(QT_PREPEND_NAMESPACE(QScxmlStateMachine))), + FunctionDef::Public + }; classDef.hasQObject = true; FunctionDef constructor; constructor.name = className.toUtf8();