summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2016-01-20 16:31:58 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2016-01-20 16:31:58 (GMT)
commit40f7838c77270539dc22605ab235adee53171518 (patch)
tree9c6549f87da846435c770a704ec215b6a1701ada
parent99457229adecc63246e900b01aee360039e7183d (diff)
downloaduscxml-40f7838c77270539dc22605ab235adee53171518.zip
uscxml-40f7838c77270539dc22605ab235adee53171518.tar.gz
uscxml-40f7838c77270539dc22605ab235adee53171518.tar.bz2
fixed a silly bug with bit masks in generated C
-rw-r--r--src/uscxml/transform/ChartToC.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/uscxml/transform/ChartToC.cpp b/src/uscxml/transform/ChartToC.cpp
index 477b1c7..cb54257 100644
--- a/src/uscxml/transform/ChartToC.cpp
+++ b/src/uscxml/transform/ChartToC.cpp
@@ -1615,7 +1615,8 @@ void ChartToC::writeFSM(std::ostream& stream) {
stream << " bit_copy(history_targets, scxml_states[i].completion, " << _stateCharArraySize << ");" << std::endl;
stream << " bit_and(history_targets, ctx->history, " << _stateCharArraySize << ");" << std::endl;
stream << " bit_or(entry_set, history_targets, " << _stateCharArraySize << ");" << std::endl;
- stream << " if (scxml_states[i].type == (SCXML_STATE_HAS_HISTORY | SCXML_STATE_HISTORY_DEEP)) {" << std::endl;
+ stream << " if (SCXML_STATE_MASK(scxml_states[i].type) == SCXML_STATE_HAS_HISTORY || " << std::endl;
+ stream << " SCXML_STATE_MASK(scxml_states[i].type) == SCXML_STATE_HISTORY_DEEP) {" << std::endl;
stream << " // a deep history state with nested histories -> more completion" << std::endl;
stream << " for (size_t j = i + 1; j < SCXML_NUMBER_STATES; j++) {" << std::endl;
stream << " if (IS_SET(j, scxml_states[i].completion) &&" << std::endl;
@@ -1623,8 +1624,8 @@ void ChartToC::writeFSM(std::ostream& stream) {
stream << " (scxml_states[j].type & SCXML_STATE_HAS_HISTORY)) {" << std::endl;
stream << " for (size_t k = j + 1; k < SCXML_NUMBER_STATES; k++) {" << std::endl;
stream << " // add nested history to entry_set" << std::endl;
- stream << " if ((scxml_states[k].type == SCXML_STATE_HISTORY_DEEP ||" << std::endl;
- stream << " scxml_states[k].type == SCXML_STATE_HISTORY_SHALLOW) &&" << std::endl;
+ stream << " if ((SCXML_STATE_MASK(scxml_states[k].type) == SCXML_STATE_HISTORY_DEEP ||" << std::endl;
+ stream << " SCXML_STATE_MASK(scxml_states[k].type) == SCXML_STATE_HISTORY_SHALLOW) &&" << std::endl;
stream << " IS_SET(k, scxml_states[j].children)) {" << std::endl;
stream << " // a nested history state" << std::endl;
stream << " SET_BIT(k, entry_set);" << std::endl;