Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Adapt to -Wcast-qual by adding a const and using ...



details:   https://anonhg.NetBSD.org/src/rev/237aeb05a058
branches:  trunk
changeset: 581554:237aeb05a058
user:      he <he%NetBSD.org@localhost>
date:      Thu Jun 02 14:41:26 2005 +0000

description:
Adapt to -Wcast-qual by adding a const and using __UNVOLATILE() in
a couple of places where memcpy() is used.

diffstat:

 sys/dev/ic/i82596.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r de3af655ffc4 -r 237aeb05a058 sys/dev/ic/i82596.c
--- a/sys/dev/ic/i82596.c       Thu Jun 02 14:40:05 2005 +0000
+++ b/sys/dev/ic/i82596.c       Thu Jun 02 14:41:26 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82596.c,v 1.8 2005/02/27 00:27:01 perry Exp $ */
+/* $NetBSD: i82596.c,v 1.9 2005/06/02 14:41:26 he Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.8 2005/02/27 00:27:01 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.9 2005/06/02 14:41:26 he Exp $");
 
 /* autoconfig and device stuff */
 #include <sys/param.h>
@@ -80,7 +80,7 @@
 
 
 /* Supported chip variants */
-char *i82596_typenames[] = { "unknowen", "DX/SX", "CA" };
+const char *i82596_typenames[] = { "unknowen", "DX/SX", "CA" };
 
 
 
@@ -421,11 +421,11 @@
        case IEE_CB_CMD_NOP:    /* NOP CMD */
                break;
        case IEE_CB_CMD_IAS:    /* Individual Address Setup */
-               memcpy((void*)cb->cb_ind_addr, LLADDR(ifp->if_sadl),
+               memcpy(__UNVOLATILE(cb->cb_ind_addr), LLADDR(ifp->if_sadl),
                    ETHER_ADDR_LEN);
                break;
        case IEE_CB_CMD_CONF:   /* Configure */
-               memcpy((void*)cb->cb_cf, sc->sc_cf, sc->sc_cf[0]
+               memcpy(__UNVOLATILE(cb->cb_cf), sc->sc_cf, sc->sc_cf[0]
                    & IEE_CF_0_CNT_M);
                break;
        case IEE_CB_CMD_MCS:    /* Multicast Setup */
@@ -453,8 +453,8 @@
                                cb->cb_mcast.mc_size = 0;
                                break;
                        }
-                       memcpy((void*) &cb->cb_mcast.mc_addrs[
-                           cb->cb_mcast.mc_size * ETHER_ADDR_LEN],
+                       memcpy(__UNVOLATILE(&cb->cb_mcast.mc_addrs[
+                           cb->cb_mcast.mc_size * ETHER_ADDR_LEN]),
                            enm->enm_addrlo, ETHER_ADDR_LEN);
                        ETHER_NEXT_MULTI(step, enm);
                        cb->cb_mcast.mc_size++;



Home | Main Index | Thread Index | Old Index