Date: Sat, 11 Jan 2014 00:00:11 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260527 - head/sys/net Message-ID: <201401110000.s0B00BZa057272@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Sat Jan 11 00:00:11 2014 New Revision: 260527 URL: http://svnweb.freebsd.org/changeset/base/260527 Log: use explicit casts with void* to compile when included by C++ code Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Fri Jan 10 23:41:01 2014 (r260526) +++ head/sys/net/netmap_user.h Sat Jan 11 00:00:11 2014 (r260527) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401110000.s0B00BZa057272>