hutcheb commented on a change in pull request #230:
URL: https://github.com/apache/plc4x/pull/230#discussion_r603093049
##########
File path:
build-utils/language-c/src/main/java/org/apache/plc4x/language/c/CLanguageTemplateHelper.java
##########
@@ -380,7 +390,7 @@ public String
getReadBufferReadMethodCall(SimpleTypeReference simpleTypeReferenc
throw new FreemarkerException("Unsupported float type with " +
floatTypeReference.getSizeInBits() + " bits");
case STRING:
StringTypeReference stringTypeReference =
(StringTypeReference) simpleTypeReference;
- return "plc4c_spi_read_string(io, " +
stringTypeReference.getSizeInBits() + ", \"" +
+ return "plc4c_spi_read_string(io, " +
stringTypeReference.getLength() + " * 8, \"" +
Review comment:
I added a getLength (now getLengthExpression) to the StringTypeReference
class as it now uses an expression instead of a hard coded value.
getLengthExpression returns the size in bits, I have removed the "* 8"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]