From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 161128DA8 for ; Fri, 14 Aug 2015 10:33:22 +0200 (CEST) Received: by wicne3 with SMTP id ne3so11104740wic.0 for ; Fri, 14 Aug 2015 01:33:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=yCUn4Bc9ciAI70fYyy9QH3P+4O/SZOpHsUA0u8X7Gzs=; b=Ma4owR3fFIh0QOJZ6jYGT4UfAu+I6zYjC7MRmJjSQlkdHFavU6USbPXX5EtTq3LLiL sf2Pyo3EwokzZHJvfccTJ4Ol5WYn4yg87mq4nla2wao5MyPVUyhnHeWVSZ2gf6OdRndB OmAlSOIHV3QlXzZkAt6F+Y27oLpaDYgMz/fFNx3WzOQgHK/AABKaQHj7xy25oL8gBFa3 3QrieDrW3s2E1VFUpxOXeD4yFp+S5bINkwMjptki+D6zEDNNN9S36YL9fZvV5j6DelTz i+cjQq9M5zYsAViWEo/PkRCAIkIsOgrobgagQKz/97oel3mxWGpb4cafT3QwDwrax7b5 yEFw== X-Gm-Message-State: ALoCoQl0jWzPGy6YI06g8t2tUAphM2KClITSpTCVNkfGNjmiFcCd46I/Y5MDV6az3Mnurtvk0WRO X-Received: by 10.180.107.138 with SMTP id hc10mr4503548wib.2.1439541201966; Fri, 14 Aug 2015 01:33:21 -0700 (PDT) Received: from robocop.localdomain (bzq-109-64-134-34.red.bezeqint.net. [109.64.134.34]) by smtp.gmail.com with ESMTPSA id dz4sm1918304wib.17.2015.08.14.01.33.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 01:33:21 -0700 (PDT) From: Avi Kivity To: dev@dpdk.org Date: Fri, 14 Aug 2015 11:33:19 +0300 Message-Id: <1439541199-26687-1-git-send-email-avi@cloudius-systems.com> X-Mailer: git-send-email 2.4.3 Subject: [dpdk-dev] [PATCH] mempool: fix incompatibility with C++ in header file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2015 08:33:22 -0000 C++ doesn't allow implied casting from void * to another pointer, so supply an explicit cast. Signed-off-by: Avi Kivity --- lib/librte_mempool/rte_mempool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 075bcdf..8abeca9 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -268,7 +268,7 @@ struct rte_mempool { /* return the header of a mempool object (internal) */ static inline struct rte_mempool_objhdr *__mempool_get_header(void *obj) { - return RTE_PTR_SUB(obj, sizeof(struct rte_mempool_objhdr)); + return (struct rte_mempool_objhdr *)RTE_PTR_SUB(obj, sizeof(struct rte_mempool_objhdr)); } /** @@ -290,7 +290,7 @@ static inline struct rte_mempool *rte_mempool_from_obj(void *obj) static inline struct rte_mempool_objtlr *__mempool_get_trailer(void *obj) { struct rte_mempool *mp = rte_mempool_from_obj(obj); - return RTE_PTR_ADD(obj, mp->elt_size); + return (struct rte_mempool_objtlr *)RTE_PTR_ADD(obj, mp->elt_size); } /** -- 2.4.3