You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/06/30 11:25:44 UTC
[plc4x] branch develop updated: - Fixed an error in the code
generation (No idea why it built correctly on my Mac)
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new ac87a2e - Fixed an error in the code generation (No idea why it built correctly on my Mac)
ac87a2e is described below
commit ac87a2eee8e6d5d96c09a2c1f9ef925d547211d2
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Jun 30 13:25:36 2020 +0200
- Fixed an error in the code generation (No idea why it built correctly on my Mac)
---
.../language-c/src/main/resources/templates/c/pojo-template-c.ftlh | 4 ++--
sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c | 2 +-
sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c | 2 +-
sandbox/plc4c/generated-sources/s7/src/cotp_packet.c | 2 +-
sandbox/plc4c/generated-sources/s7/src/s7_message.c | 4 ++--
sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c | 2 +-
.../plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c | 2 +-
sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c | 2 +-
8 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh b/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
index 2a1e83b..db5d9f6 100644
--- a/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
+++ b/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
@@ -483,7 +483,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_serialize(plc4c_spi_wr
<#if helper.isSimpleTypeReference(optionalField.type)>
<#if indentContent> </#if> _res= ${helper.getWriteBufferWriteMethodCall(optionalField.type, "_message->" + helper.getFieldName(baseType, optionalField))};
<#else>
-<#if indentContent> </#if> _res = plc4c_${helper.getCTypeName(optionalField.type.name)}_serialize(buf, "_message-><@fieldName baseType=baseType field=optionalField/>");
+<#if indentContent> </#if> _res = plc4c_${helper.getCTypeName(optionalField.type.name)}_serialize(buf, _message-><@fieldName baseType=baseType field=optionalField/>);
</#if>
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -524,7 +524,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_serialize(plc4c_spi_wr
<#if helper.isSimpleTypeReference(simpleField.type)>
<#if indentContent> </#if> _res = ${helper.getWriteBufferWriteMethodCall(simpleField.type, "_message->" + helper.getFieldName(baseType, simpleField))};
<#else>
-<#if indentContent> </#if> _res = plc4c_${helper.getCTypeName(simpleField.type.name)}_serialize(buf, "_message-><@fieldName baseType=baseType field=simpleField/>");
+<#if indentContent> </#if> _res = plc4c_${helper.getCTypeName(simpleField.type.name)}_serialize(buf, _message-><@fieldName baseType=baseType field=simpleField/>);
</#if>
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
index bda3e03..a0e01c9 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
@@ -110,7 +110,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_serialize(plc4c_spi_
}
// Simple Field (pdu)
- _res = plc4c_modbus_read_write_modbus_pdu_serialize(buf, "_message->pdu");
+ _res = plc4c_modbus_read_write_modbus_pdu_serialize(buf, _message->pdu);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
index df13dc7..f62bd54 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
@@ -105,7 +105,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_serialize(plc4c_spi_wri
}
// Simple Field (pdu)
- _res = plc4c_modbus_read_write_modbus_pdu_serialize(buf, "_message->pdu");
+ _res = plc4c_modbus_read_write_modbus_pdu_serialize(buf, _message->pdu);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c b/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
index 00a06cc..f171ffd 100644
--- a/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
+++ b/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
@@ -421,7 +421,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_serialize(plc4c_spi_write_buff
// Optional Field (payload)
if(_message->payload != NULL) {
- _res = plc4c_s7_read_write_s7_message_serialize(buf, "_message->payload");
+ _res = plc4c_s7_read_write_s7_message_serialize(buf, _message->payload);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_message.c b/sandbox/plc4c/generated-sources/s7/src/s7_message.c
index 99476a9..56a13ca 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_message.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_message.c
@@ -268,7 +268,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_serialize(plc4c_spi_write_buffe
// Optional Field (parameter)
if(_message->parameter != NULL) {
- _res = plc4c_s7_read_write_s7_parameter_serialize(buf, "_message->parameter");
+ _res = plc4c_s7_read_write_s7_parameter_serialize(buf, _message->parameter);
if(_res != OK) {
return _res;
}
@@ -276,7 +276,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_serialize(plc4c_spi_write_buffe
// Optional Field (payload)
if(_message->payload != NULL) {
- _res = plc4c_s7_read_write_s7_payload_serialize(buf, "_message->payload");
+ _res = plc4c_s7_read_write_s7_payload_serialize(buf, _message->payload);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
index 8c3ec93..6d266b6 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
@@ -165,7 +165,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_serialize(plc4c_
}
// Simple Field (szlId)
- _res = plc4c_s7_read_write_szl_id_serialize(buf, "_message->szl_id");
+ _res = plc4c_s7_read_write_szl_id_serialize(buf, _message->szl_id);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
index 7696b33..7f63703 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
@@ -98,7 +98,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_request_parameter_item_serialize(pl
}
// Simple Field (address)
- _res = plc4c_s7_read_write_s7_address_serialize(buf, "_message->s7_var_request_parameter_item_address_address");
+ _res = plc4c_s7_read_write_s7_address_serialize(buf, _message->s7_var_request_parameter_item_address_address);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c b/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
index b144b40..0b14a90 100644
--- a/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
+++ b/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
@@ -95,7 +95,7 @@ plc4c_return_code plc4c_s7_read_write_tpkt_packet_serialize(plc4c_spi_write_buff
}
// Simple Field (payload)
- _res = plc4c_s7_read_write_cotp_packet_serialize(buf, "_message->payload");
+ _res = plc4c_s7_read_write_cotp_packet_serialize(buf, _message->payload);
if(_res != OK) {
return _res;
}