* [dpdk-dev] [PATCH] mbuf: fix incompatibility with C++ in header file
@ 2015-08-14 8:33 Avi Kivity
2015-08-14 8:59 ` Sergey Balabanov
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2015-08-14 8:33 UTC (permalink / raw)
To: dev
C++ doesn't allow implied casting from void * to another pointer, so
supply an explicit cast.
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
---
lib/librte_mbuf/rte_mbuf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index c3b8c98..8c2db1b 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -882,7 +882,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
static inline struct rte_mbuf *
rte_mbuf_from_indirect(struct rte_mbuf *mi)
{
- return RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) + mi->priv_size);
+ return (struct rte_mbuf *)RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) + mi->priv_size);
}
/**
--
2.4.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] mbuf: fix incompatibility with C++ in header file
2015-08-14 8:33 [dpdk-dev] [PATCH] mbuf: fix incompatibility with C++ in header file Avi Kivity
@ 2015-08-14 8:59 ` Sergey Balabanov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Balabanov @ 2015-08-14 8:59 UTC (permalink / raw)
To: dev
The patch duplicates http://dpdk.org/dev/patchwork/patch/6750/
On Friday 14 August 2015 11:33:15 Avi Kivity wrote:
> C++ doesn't allow implied casting from void * to another pointer, so
> supply an explicit cast.
>
> Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
> ---
> lib/librte_mbuf/rte_mbuf.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index c3b8c98..8c2db1b 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -882,7 +882,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct
> rte_mempool *mp); static inline struct rte_mbuf *
> rte_mbuf_from_indirect(struct rte_mbuf *mi)
> {
> - return RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) + mi->priv_size);
> + return (struct rte_mbuf *)RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) +
> mi->priv_size); }
>
> /**
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-14 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14 8:33 [dpdk-dev] [PATCH] mbuf: fix incompatibility with C++ in header file Avi Kivity
2015-08-14 8:59 ` Sergey Balabanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).