[
https://issues.apache.org/jira/browse/MINIFICPP-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16653265#comment-16653265
]
ASF GitHub Bot commented on MINIFICPP-638:
------------------------------------------
Github user arpadboda commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/417#discussion_r225853255
--- Diff: libminifi/src/capi/api.cpp ---
@@ -212,7 +214,7 @@ void free_flowfile(flow_file_record *ff) {
* @param size size of value
* @return 0 or -1 based on whether the attributed existed previously (-1)
or not (0)
*/
-uint8_t add_attribute(flow_file_record *ff, char *key, void *value, size_t
size) {
+uint8_t add_attribute(flow_file_record *ff, const char *key, void *value,
size_t size) {
--- End diff --
This is quite the same issue as I've described below (the change in
cstructs.h): add_attribute(ff, "my_key", ...) would compile with warning.
Moreover this function doesn't take ownership (the internal c++ string
representation copies the key), so this signature gives better suggestions on
ownership to the user.
> C API: add unit tests
> ---------------------
>
> Key: MINIFICPP-638
> URL: https://issues.apache.org/jira/browse/MINIFICPP-638
> Project: NiFi MiNiFi C++
> Issue Type: Sub-task
> Reporter: Arpad Boda
> Assignee: Arpad Boda
> Priority: Minor
> Fix For: 0.6.0
>
>
> Add some C API unit tests.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)