szaszm commented on a change in pull request #515: MINIFICPP-646 - Re-evaluate 
passing attributes. Potentially deprecate…
URL: https://github.com/apache/nifi-minifi-cpp/pull/515#discussion_r380177760
 
 

 ##########
 File path: nanofi/examples/transmit_payload.c
 ##########
 @@ -47,9 +47,7 @@ int main(int argc, char **argv) {
   attribute attribute1;
 
   attribute1.key = "some_key";
-  const char * attr_value = "some value";
-  attribute1.value = (void *)attr_value;
-  attribute1.value_size = strlen(attr_value);
+  attribute1.value = "some value";
 
 Review comment:
   I've expected `attribute` to be an owning container of `key`/`value`. We 
really need to clarify ownership semantics and enforce them through the API.
   I support the opaque struct proposal and would provide copying and 
optionally adopting setters for the struct.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to