From owner-svn-src-all@FreeBSD.ORG Sat Jan 11 00:00:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9588EF77; Sat, 11 Jan 2014 00:00:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8256F1D36; Sat, 11 Jan 2014 00:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0B00BCO057273; Sat, 11 Jan 2014 00:00:11 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0B00BZa057272; Sat, 11 Jan 2014 00:00:11 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201401110000.s0B00BZa057272@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 11 Jan 2014 00:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260527 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2014 00:00:11 -0000 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;