Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-02-23 11:07:10 -0500
committerHenrik Rentz-Reichert2012-02-23 11:07:10 -0500
commit174c1f53eb51741e3487927540dbde06ee10df44 (patch)
tree593d3968d6aa1d21713f6676349daad9cea98c3f
parent292ed77c8e1d1ac1cb1bd413fcbbbf964e60e331 (diff)
downloadorg.eclipse.etrice-174c1f53eb51741e3487927540dbde06ee10df44.tar.gz
org.eclipse.etrice-174c1f53eb51741e3487927540dbde06ee10df44.tar.xz
org.eclipse.etrice-174c1f53eb51741e3487927540dbde06ee10df44.zip
[generator.c] fix for unconnected ports
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java16
2 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
index 2b007c2bf..ce83ef9c1 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
@@ -273,7 +273,7 @@ class SubSystemClassGen {
def private String genPortInitializer(Root root, ActorInstance ai, PortInstance pi) {
var recvMsg = if (pi.peers.empty) "NULL" else ai.actorClass.name+"_ReceiveMessage"
var objId = if (pi.peers.empty) 0 else pi.peers.get(0).objId
- var idx = pi.peers.get(0).peers.indexOf(pi)
+ var idx = if (pi.peers.empty) 0 else pi.peers.get(0).peers.indexOf(pi)
"{&"+ai.path.getPathName()+", "
+recvMsg+", "
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
index d7232650a..3ea4f0c18 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
@@ -758,11 +758,19 @@ public class SubSystemClassGen {
_xifexpression_1 = _objId;
}
int objId = _xifexpression_1;
+ int _xifexpression_2 = (int) 0;
EList<InterfaceItemInstance> _peers_3 = pi.getPeers();
- InterfaceItemInstance _get_1 = _peers_3.get(0);
- EList<InterfaceItemInstance> _peers_4 = _get_1.getPeers();
- int _indexOf = _peers_4.indexOf(pi);
- int idx = _indexOf;
+ boolean _isEmpty_2 = _peers_3.isEmpty();
+ if (_isEmpty_2) {
+ _xifexpression_2 = 0;
+ } else {
+ EList<InterfaceItemInstance> _peers_4 = pi.getPeers();
+ InterfaceItemInstance _get_1 = _peers_4.get(0);
+ EList<InterfaceItemInstance> _peers_5 = _get_1.getPeers();
+ int _indexOf = _peers_5.indexOf(pi);
+ _xifexpression_2 = _indexOf;
+ }
+ int idx = _xifexpression_2;
String _path = ai.getPath();
String _pathName = this.roomExt.getPathName(_path);
String _operator_plus_1 = StringExtensions.operator_plus("{&", _pathName);

Back to the top