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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to