summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2014-01-11 00:00:11 +0000
committerluigi <luigi@FreeBSD.org>2014-01-11 00:00:11 +0000
commit651494a5f1183fa7a351ff494970640ba9c6f3d8 (patch)
treef7bb18ea51bd616e9ca74433170f7c5fcea16e3d
parenta243e8b5026111351c044402454aa4be2e77e6d1 (diff)
downloadFreeBSD-src-651494a5f1183fa7a351ff494970640ba9c6f3d8.zip
FreeBSD-src-651494a5f1183fa7a351ff494970640ba9c6f3d8.tar.gz
use explicit casts with void* to compile when included by C++ code
-rw-r--r--sys/net/netmap_user.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h
index bd6fe0d..72882b0 100644
--- a/sys/net/netmap_user.h
+++ b/sys/net/netmap_user.h
@@ -164,6 +164,7 @@ struct nm_desc_t {
/*
* when the descriptor is open correctly, d->self == d
+ * Eventually we should also use some magic number.
*/
#define P2NMD(p) ((struct nm_desc_t *)(p))
#define IS_NETMAP_DESC(d) (P2NMD(d)->self == P2NMD(d))
@@ -181,8 +182,9 @@ struct nm_desc_t {
static inline void
pkt_copy(const void *_src, void *_dst, int l)
{
- const uint64_t *src = _src;
- uint64_t *dst = _dst;
+ const uint64_t *src = (const uint64_t *)_src;
+ uint64_t *dst = (uint64_t *)_dst;
+
if (unlikely(l >= 1024)) {
memcpy(dst, src, l);
return;
@@ -317,7 +319,8 @@ nm_close(struct nm_desc_t *d)
* ugly trick to avoid unused warnings
*/
static void *__xxzt[] __attribute__ ((unused)) =
- { nm_open, nm_inject, nm_dispatch, nm_nextpkt } ;
+ { (void *)nm_open, (void *)nm_inject,
+ (void *)nm_dispatch, (void *)nm_nextpkt } ;
if (d == NULL || d->self != d)
return EINVAL;
OpenPOWER on IntegriCloud