From 51db93cf783662a155ced91dceef7508ffa955a6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 24 Nov 2016 16:17:20 +0100 Subject: Resolve the mixup of various ID types We should not compare instances of different IDs with one another. Change-Id: I830d747ffde4c162c73475a600cef23e10c898e5 Reviewed-by: Erik Verbruggen --- src/scxml/qscxmlinvokableservice.cpp | 2 +- src/scxml/qscxmltabledata.cpp | 6 +++--- src/scxml/qscxmltabledata_p.h | 2 +- tools/qscxmlc/scxmlcppdumper.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/scxml/qscxmlinvokableservice.cpp b/src/scxml/qscxmlinvokableservice.cpp index 9af6be7..c608e3d 100644 --- a/src/scxml/qscxmlinvokableservice.cpp +++ b/src/scxml/qscxmlinvokableservice.cpp @@ -73,7 +73,7 @@ QScxmlStateMachine *QScxmlInvokableService::parentStateMachine() const void QScxmlInvokableService::finalize(QScxmlExecutableContent::ContainerId finalize) { - if (finalize != QScxmlExecutableContent::NoInstruction) { + if (finalize != QScxmlExecutableContent::NoContainer) { auto psm = parentStateMachine(); qCDebug(qscxmlLog) << psm << "running finalize on event"; auto smp = QScxmlStateMachinePrivate::get(psm); diff --git a/src/scxml/qscxmltabledata.cpp b/src/scxml/qscxmltabledata.cpp index 2457840..5d5115e 100644 --- a/src/scxml/qscxmltabledata.cpp +++ b/src/scxml/qscxmltabledata.cpp @@ -68,7 +68,7 @@ public: { m_activeSequences.reserve(4); - tableData.theInitialSetup = QScxmlExecutableContent::NoInstruction; + tableData.theInitialSetup = QScxmlExecutableContent::NoContainer; } void buildTableData(DocumentModel::ScxmlDocument *doc) @@ -264,7 +264,7 @@ protected: // visitor params.append(p); } QScxmlExecutableContent::ContainerId finalize = - QScxmlExecutableContent::NoInstruction; + QScxmlExecutableContent::NoContainer; if (!invoke->finalize.isEmpty()) { finalize = startNewSequence(); visit(&invoke->finalize); @@ -528,7 +528,7 @@ protected: ContainerId generate(const DocumentModel::InstructionSequences &inSequences) { if (inSequences.isEmpty()) - return NoInstruction; + return NoContainer; auto id = m_instructions.newContainerId(); auto outSequences = m_instructions.add(); diff --git a/src/scxml/qscxmltabledata_p.h b/src/scxml/qscxmltabledata_p.h index 2c825db..767b88a 100644 --- a/src/scxml/qscxmltabledata_p.h +++ b/src/scxml/qscxmltabledata_p.h @@ -117,7 +117,7 @@ public: QVector theAssignments; QVector theForeaches; QVector theDataNameIds; - QScxmlExecutableContent::EvaluatorId theInitialSetup; + QScxmlExecutableContent::ContainerId theInitialSetup; int theName; }; } // QScxmlInternal namespace diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index b539e0d..81b9dcf 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -374,7 +374,7 @@ int createFactoryId(QStringList &factories, const QString &className, const int idx = factories.size(); QString line = QStringLiteral("case %1: return new ").arg(QString::number(idx)); - if (invokeInfo.expr == QScxmlExecutableContent::NoInstruction) { + if (invokeInfo.expr == QScxmlExecutableContent::NoEvaluator) { line += QStringLiteral("QScxmlStaticScxmlServiceFactory< %1::%2 >(") .arg(namespacePrefix, className); } else { @@ -445,7 +445,7 @@ void CppDumper::dump(TranslationUnit *unit) const QVector ¶meters, const QSharedPointer &content) -> int { QString className; - if (invokeInfo.expr == QScxmlExecutableContent::NoInstruction) { + if (invokeInfo.expr == QScxmlExecutableContent::NoEvaluator) { className = mangleIdentifier(classnameForDocument.value(content.data())); } return createFactoryId(factories[i], className, namespacePrefix, -- cgit v1.2.3