Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-02-21 18:29:56 +0000
committerHenrik Rentz-Reichert2012-02-21 18:29:56 +0000
commit5cbe79fbf4dc676551eecd754a0a18a6844da71c (patch)
tree51d51a09405ba8e528af9c84267f9f302b6f1498 /plugins
parent3b74849b3e734c85d747bd65bc3ef6f84360c38f (diff)
downloadorg.eclipse.etrice-5cbe79fbf4dc676551eecd754a0a18a6844da71c.tar.gz
org.eclipse.etrice-5cbe79fbf4dc676551eecd754a0a18a6844da71c.tar.xz
org.eclipse.etrice-5cbe79fbf4dc676551eecd754a0a18a6844da71c.zip
[generator.c] bug fix in length of history array
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
index 4cae655ad..f17e4a509 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
@@ -27,7 +27,7 @@ class StateMachineGen extends GenericStateMachineGenerator {
def genDataMembers(ExpandedActorClass xpac, ActorClass ac) {'''
/* state machine variables */
etInt16 state;
- etInt16 history[«xpac.allLeafStates.size»];
+ etInt16 history[«xpac.allLeafStates.size+1/* TODO: can save one entry if NO_STATE=-1 but influences Java */»];
'''}
def genInitialization(ExpandedActorClass xpac, ActorClass ac) {'''
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
index cc1106cfe..c1b22f966 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
@@ -8,6 +8,7 @@ import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.generator.etricegen.ExpandedActorClass;
import org.eclipse.etrice.generator.extensions.RoomExtensions;
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator;
+import org.eclipse.xtext.xbase.lib.IntegerExtensions;
import org.eclipse.xtext.xtend2.lib.StringConcatenation;
@SuppressWarnings("all")
@@ -25,7 +26,8 @@ public class StateMachineGen extends GenericStateMachineGenerator {
_builder.append("etInt16 history[");
List<State> _allLeafStates = this._roomExtensions.getAllLeafStates(xpac);
int _size = _allLeafStates.size();
- _builder.append(_size, "");
+ int _operator_plus = IntegerExtensions.operator_plus(((Integer)_size), ((Integer)1));
+ _builder.append(_operator_plus, "");
_builder.append("];");
_builder.newLineIfNotEmpty();
return _builder;

Back to the top