summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjung2012-04-29 10:52:11 (EDT)
committertjung2012-04-29 10:52:11 (EDT)
commitcec14e451b379ffd5ae78e8a987ce13e8d51e581 (patch)
tree9a10b6a3c32e54e3dda11c42c4c26c85ef0d21bb
parent494aff12e2e97fe8f6ebfca62cceb2cafd18f918 (diff)
downloadorg.eclipse.etrice-cec14e451b379ffd5ae78e8a987ce13e8d51e581.zip
org.eclipse.etrice-cec14e451b379ffd5ae78e8a987ce13e8d51e581.tar.gz
org.eclipse.etrice-cec14e451b379ffd5ae78e8a987ce13e8d51e581.tar.bz2
[generator.c] fix in repl. port handlers
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend5
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java12
2 files changed, 13 insertions, 4 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
index f60f551..8aee500 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
@@ -243,6 +243,7 @@ void «portClassName»_«h.msg.name»_receiveHandler(«portClassName»* self, const et
«var refpd = if (hasData && (!(message.data.refType.type instanceof PrimitiveType)||(message.data.refType.ref))) "*" else ""»
«var refa = if (hasData && (!(message.data.refType.type instanceof PrimitiveType))&&(!(message.data.refType.ref))) "" else "&"»
«var data = if (hasData) ", "+typeName+refpd+" data" else ""»
+ «var dataCall = if (hasData) ", data" else ""»
«var hdlr = message.getSendHandler(conj)»
«messageSignature(portClassName, message.name, "", data)» {
@@ -260,7 +261,7 @@ void «portClassName»_«h.msg.name»_receiveHandler(«portClassName»* self, const et
«IF hdlr != null»
int i;
for (i=0; i<((etReplPort*)self)->size; ++i) {
- «portClassName»_«message.name»((etPort*)&((etReplPort*)self)->ports[i]«data»);
+ «portClassName»_«message.name»((etPort*)&((etReplPort*)self)->ports[i]«dataCall»);
}
«ELSE»
int i;
@@ -274,7 +275,7 @@ void «portClassName»_«h.msg.name»_receiveHandler(«portClassName»* self, const et
«messageSignature(replPortClassName, message.name, "", ", int idx"+data)» {
«IF hdlr != null»
- «portClassName»_«message.name»((etPort*)&((etReplPort*)self)->ports[idx]«data»);
+ «portClassName»_«message.name»((etPort*)&((etReplPort*)self)->ports[idx]«dataCall»);
«ELSE»
ET_MSC_LOGGER_SYNC_ENTRY("«replPortClassName»", "«message.name»")
if (0<=idx && idx<((etReplPort*)self)->size) {
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
index ed950f7..fabb3af 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
@@ -821,6 +821,14 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
String data = _xifexpression_6;
_builder.newLineIfNotEmpty();
+ String _xifexpression_7 = null;
+ if (hasData) {
+ _xifexpression_7 = ", data";
+ } else {
+ _xifexpression_7 = "";
+ }
+ String dataCall = _xifexpression_7;
+ _builder.newLineIfNotEmpty();
MessageHandler _sendHandler = this.roomExt.getSendHandler(message, conj);
MessageHandler hdlr = _sendHandler;
_builder.newLineIfNotEmpty();
@@ -892,7 +900,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String _name_5 = message.getName();
_builder.append(_name_5, " ");
_builder.append("((etPort*)&((etReplPort*)self)->ports[i]");
- _builder.append(data, " ");
+ _builder.append(dataCall, " ");
_builder.append(");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -950,7 +958,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String _name_10 = message.getName();
_builder.append(_name_10, " ");
_builder.append("((etPort*)&((etReplPort*)self)->ports[idx]");
- _builder.append(data, " ");
+ _builder.append(dataCall, " ");
_builder.append(");");
_builder.newLineIfNotEmpty();
} else {