diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-09-12 18:43:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-09-14 11:37:38 +0000 |
commit | abd6d0c93bdbe24b78dc26212d4d586425a50706 (patch) | |
tree | 0cc1bf82b2d313171b3042f91fe761cd37bd62bd /tools/qscxmlc/cppdatamodel.t | |
parent | fd81d2fb5823089fb245fdb5ec9412291d41a3a2 (diff) |
Don't generate empty switch statements for C++ data models
Some compilers will complain about them.
Change-Id: I82bee601480e43ce00657d609d30179fe17e6bdb
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tools/qscxmlc/cppdatamodel.t')
-rw-r--r-- | tools/qscxmlc/cppdatamodel.t | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/tools/qscxmlc/cppdatamodel.t b/tools/qscxmlc/cppdatamodel.t index 524571b..2ca5b16 100644 --- a/tools/qscxmlc/cppdatamodel.t +++ b/tools/qscxmlc/cppdatamodel.t @@ -1,42 +1,34 @@ QString ${datamodel}::evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) { *ok = true; - switch (id) { -${evaluateToStringCases} default: - Q_UNREACHABLE(); - *ok = false; - return QString(); - } +${evaluateToStringCases} + Q_UNREACHABLE(); + *ok = false; + return QString(); } bool ${datamodel}::evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) { *ok = true; - switch (id) { -${evaluateToBoolCases} default: - Q_UNREACHABLE(); - *ok = false; - return false; - } +${evaluateToBoolCases} + Q_UNREACHABLE(); + *ok = false; + return false; } QVariant ${datamodel}::evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) { *ok = true; - switch (id) { -${evaluateToVariantCases} default: - Q_UNREACHABLE(); - *ok = false; - return QVariant(); - } +${evaluateToVariantCases} + Q_UNREACHABLE(); + *ok = false; + return QVariant(); } void ${datamodel}::evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) { *ok = true; - switch (id) { -${evaluateToVoidCases} default: - Q_UNREACHABLE(); - *ok = false; - } +${evaluateToVoidCases} + Q_UNREACHABLE(); + *ok = false; } |