[
https://issues.apache.org/jira/browse/AVRO-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768008#action_12768008
]
Scott Banachowski commented on AVRO-47:
---------------------------------------
I tend to agree with Thiru on this issue. In most C++ projects I've
participated, use of void* is discouraged in favor of types, in light of C++'s
stronger type support.
To me, void* is too opaque, it implies a type that may not be serializeable.
Whereas when you cast to uint8_t*, the expectation is that the data can be
interpreted as a contiguous array of bytes.
> Byte sequence to be represented as void*
> ----------------------------------------
>
> Key: AVRO-47
> URL: https://issues.apache.org/jira/browse/AVRO-47
> Project: Avro
> Issue Type: Bug
> Components: c++
> Reporter: Arvind Jayaprakash
> Attachments: AVRO-47
>
>
> The current function prototype for serializin bytes is as follows:
> void putBytes(const uint8_t *val, size_t size)
> This is better written as
> void putBytes(const void *val, size_t size)
> Using void* in favour of an int based data type frees us from unnecessary
> casting opaque bytes from arbitrary stuctures/classes into "integer". This is
> consistent with say a function like memcpy()
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.