Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DFCD18606 for ; Sat, 31 Oct 2015 00:19:28 +0000 (UTC) Received: (qmail 23490 invoked by uid 500); 31 Oct 2015 00:19:28 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 23402 invoked by uid 500); 31 Oct 2015 00:19:28 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 23007 invoked by uid 99); 31 Oct 2015 00:19:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2015 00:19:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D7F322C1F5D for ; Sat, 31 Oct 2015 00:19:27 +0000 (UTC) Date: Sat, 31 Oct 2015 00:19:27 +0000 (UTC) From: "Haohui Mai (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-9320) libhdfspp should not use sizeof for stream parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14983669#comment-14983669 ] Haohui Mai commented on HDFS-9320: ---------------------------------- {code} +const unsigned int kSizeofJavaShort = 2; +const unsigned int kSizeofJavaInt = 4; + {code} should be inlined as {{sizeof(uint16_t)}} and {{sizeof(uint32_t)}} respectively. Other than that it looks good to me. > 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 > > > 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)