mempool: fix incompatibility with C++ in header file
PATCH 1/1 mempool: fix incompatibility with C++ in header file
C++ doesn't allow implied casting from void * to another pointer, so supply an explicit cast.
Signed-off-by Avi Kivity <[email protected]>
--- lib/librte_mempool/rte_mempool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_mempool/rte_mempool.h +2 -2
@@ -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); }/**
Signature · 1 line
2.4.3
A message that is not in the archive (sent off-list or not yet received): [email protected]
(adding list+Thomas back to cc)
Quoted 13 lines · Olivier MATZ
Hi,
Quoted 4 lines · Avi Kivity
C++ doesn't allow implied casting from void * to another pointer, so supply an explicit cast.
Signed-off-by Avi Kivity <[email protected]>For Thomas:
This fix is already submitted in
http://dpdk.org/dev/patchwork/patch/6750/Thanks Avi