From: Avi Kivity <avi@cloudius-systems.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] mempool: fix incompatibility with C++ in header file
Date: Fri, 14 Aug 2015 11:33:19 +0300 [thread overview]
Message-ID: <1439541199-26687-1-git-send-email-avi@cloudius-systems.com> (raw)
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_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
next reply other threads:[~2015-08-14 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-14 8:33 Avi Kivity [this message]
[not found] ` <55D19C6F.3040501@6wind.com>
2015-08-17 8:40 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1439541199-26687-1-git-send-email-avi@cloudius-systems.com \
--to=avi@cloudius-systems.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).