[
https://issues.apache.org/jira/browse/HDFS-9320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14985757#comment-14985757
]
Haohui Mai commented on HDFS-9320:
----------------------------------
{code}
+const unsigned int kSizeofJavaShort = sizeof(int16_t);
+const unsigned int kSizeofJavaInt = sizeof(int32_t);
+
{code}
I should have worded it more clear. To avoid polluting the namespace, it's
better to get rid of these two statements in the header files and inline them
directly to the places that use them.
+1 once addressed.
> libhdfspp should not use sizeof for stream parsing
> --------------------------------------------------
>
> Key: HDFS-9320
> URL: https://issues.apache.org/jira/browse/HDFS-9320
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Reporter: Bob Hansen
> Assignee: James Clampffer
> Attachments: HDFS-9320.HDFS-8707.000.patch,
> HDFS-9320.HDFS-8707.001.patch
>
>
> In a few places, we're using sizeof(int) and sizeof(short) to determine where
> in the received buffers we should be looking for data. Those values are
> compiler- and platform-dependent. We should use specified sizes, or at least
> sizeof(int32_t).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)