Source-Changes-HG archive

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

[src/trunk]: src/sys/arch b{cmp,copy,zero} -> mem{cmp,cpy,set}



details:   https://anonhg.NetBSD.org/src/rev/e46ae7c9a6af
branches:  trunk
changeset: 512178:e46ae7c9a6af
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Jul 07 14:20:59 2001 +0000

description:
b{cmp,copy,zero} -> mem{cmp,cpy,set}
Also remove some unnecessary argument casts.

diffstat:

 sys/arch/mips/mips/cpu_exec.c         |   4 +-
 sys/arch/mips/mips/kgdb_machdep.c     |   4 +-
 sys/arch/pmax/dev/bt459.c             |   6 ++--
 sys/arch/pmax/dev/bt478.c             |   4 +-
 sys/arch/pmax/dev/cfb.c               |   4 +-
 sys/arch/pmax/dev/dc.c                |  11 +++----
 sys/arch/pmax/dev/dtop.c              |  15 +++++-----
 sys/arch/pmax/dev/fb_usrreq.c         |   4 +-
 sys/arch/pmax/dev/ims332.c            |   6 ++--
 sys/arch/pmax/dev/mfb.c               |  14 +++++-----
 sys/arch/pmax/dev/px.c                |  21 +++++++--------
 sys/arch/pmax/dev/qvss_compat.c       |   6 ++--
 sys/arch/pmax/dev/rcons.c             |   4 +-
 sys/arch/pmax/dev/rz.c                |  48 +++++++++++++++++-----------------
 sys/arch/pmax/dev/scsi.c              |   8 ++--
 sys/arch/pmax/dev/tz.c                |  14 +++++-----
 sys/arch/pmax/pmax/bus_dma.c          |   8 ++--
 sys/arch/pmax/stand/common/bootinfo.c |   4 +-
 sys/arch/pmax/stand/common/bootxx.c   |   5 +--
 sys/arch/pmax/tc/scc.c                |  11 +++----
 20 files changed, 98 insertions(+), 103 deletions(-)

diffs (truncated from 787 to 300 lines):

diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/mips/mips/cpu_exec.c
--- a/sys/arch/mips/mips/cpu_exec.c     Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/mips/mips/cpu_exec.c     Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_exec.c,v 1.26 2000/11/27 13:25:24 tsutsui Exp $    */
+/*     $NetBSD: cpu_exec.c,v 1.27 2001/07/07 14:20:59 simonb Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -189,7 +189,7 @@
        }
 
        /* See if it's got the basic elf magic number leadin... */
-       if (bcmp(ex->e_ident, ELFMAG, SELFMAG) != 0) {
+       if (memcmp(ex->e_ident, ELFMAG, SELFMAG) != 0) {
                return ENOEXEC;
        }
 
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/mips/mips/kgdb_machdep.c
--- a/sys/arch/mips/mips/kgdb_machdep.c Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/mips/mips/kgdb_machdep.c Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kgdb_machdep.c,v 1.3 2000/07/20 18:14:46 jeffs Exp $   */
+/*     $NetBSD: kgdb_machdep.c,v 1.4 2001/07/07 14:20:59 simonb Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -204,7 +204,7 @@
 {
        struct frame *f = (struct frame *)regs;
 
-       bzero(gdb_regs, KGDB_NUMREGS * sizeof(kgdb_reg_t));
+       memset(gdb_regs, 0, KGDB_NUMREGS * sizeof(kgdb_reg_t));
        gdb_regs[ 1] = f->f_regs[AST];     /* AT */
        gdb_regs[ 2] = f->f_regs[V0];      /* V0 */
        gdb_regs[ 3] = f->f_regs[V1];      /* V1 */
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/bt459.c
--- a/sys/arch/pmax/dev/bt459.c Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/bt459.c Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt459.c,v 1.20 2000/01/10 03:24:31 simonb Exp $        */
+/*     $NetBSD: bt459.c,v 1.21 2001/07/07 14:21:00 simonb Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: bt459.c,v 1.20 2000/01/10 03:24:31 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bt459.c,v 1.21 2001/07/07 14:21:00 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -490,7 +490,7 @@
        cmap_bits = (u_char *)bits;
        cmap = (u_char *)(fi -> fi_cmap_bits) + index * 3;
 
-       bcopy (cmap, cmap_bits, count * 3);
+       memcpy(cmap_bits, cmap, count * 3);
        return 0;
 }
 
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/bt478.c
--- a/sys/arch/pmax/dev/bt478.c Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/bt478.c Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt478.c,v 1.15 2000/01/10 03:24:31 simonb Exp $        */
+/*     $NetBSD: bt478.c,v 1.16 2001/07/07 14:21:00 simonb Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -298,6 +298,6 @@
        cmap_bits = (u_char *)bits;
        cmap = (u_char *)(fi -> fi_cmap_bits) + index * 3;
 
-       bcopy (cmap, cmap_bits, count * 3);
+       memcpy(cmap_bits, cmap, count * 3);
        return 0;
 }
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/cfb.c
--- a/sys/arch/pmax/dev/cfb.c   Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/cfb.c   Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cfb.c,v 1.38 2000/02/03 04:09:13 nisimura Exp $        */
+/*     $NetBSD: cfb.c,v 1.39 2001/07/07 14:21:00 simonb Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -177,7 +177,7 @@
        void *aux;
 {
        struct tc_attach_args *ta = aux;
-       caddr_t base =  (caddr_t)(ta->ta_addr);
+       caddr_t base = (caddr_t)(ta->ta_addr);
        int unit = self->dv_unit;
        struct fbinfo *fi;
        
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/dc.c
--- a/sys/arch/pmax/dev/dc.c    Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/dc.c    Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dc.c,v 1.67 2001/05/02 10:32:18 scw Exp $      */
+/*     $NetBSD: dc.c,v 1.68 2001/07/07 14:21:00 simonb Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.67 2001/05/02 10:32:18 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.68 2001/07/07 14:21:00 simonb Exp $");
 
 /*
  * devDC7085.c --
@@ -502,8 +502,7 @@
        while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
               !(tp->t_state & TS_CARR_ON)) {
                tp->t_wopen++;
-               error = ttysleep(tp, (caddr_t)&tp->t_rawq,
-                   TTIPRI | PCATCH, ttopen, 0);
+               error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, ttopen, 0);
                tp->t_wopen--;
                if (error != 0)
                        break;
@@ -837,7 +836,7 @@
                        }
                }
                if (!(tp->t_state & TS_ISOPEN)) {
-                       wakeup((caddr_t)&tp->t_rawq);
+                       wakeup(&tp->t_rawq);
 #ifdef PORTSELECTOR
                        if (tp->t_wopen == 0)
 #endif
@@ -951,7 +950,7 @@
        if (tp->t_outq.c_cc <= tp->t_lowat) {
                if (tp->t_state & TS_ASLEEP) {
                        tp->t_state &= ~TS_ASLEEP;
-                       wakeup((caddr_t)&tp->t_outq);
+                       wakeup(&tp->t_outq);
                }
                selwakeup(&tp->t_wsel);
        }
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/dtop.c
--- a/sys/arch/pmax/dev/dtop.c  Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/dtop.c  Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtop.c,v 1.55 2001/05/02 10:32:18 scw Exp $    */
+/*     $NetBSD: dtop.c,v 1.56 2001/07/07 14:21:00 simonb Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -94,7 +94,7 @@
 ********************************************************/
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.55 2001/05/02 10:32:18 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.56 2001/07/07 14:21:00 simonb Exp $");
 
 #include "opt_ddb.h"
 #include "rasterconsole.h"
@@ -331,8 +331,7 @@
        while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
               !(tp->t_state & TS_CARR_ON)) {
                tp->t_wopen++;
-               error = ttysleep(tp, (caddr_t)&tp->t_rawq,
-                                     TTIPRI | PCATCH, ttopen, 0);
+               error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, ttopen, 0);
                tp->t_wopen--;
                if (error != 0)
                        break;
@@ -511,7 +510,7 @@
        if (tp->t_outq.c_cc <= tp->t_lowat) {
                if (tp->t_state & TS_ASLEEP) {
                        tp->t_state &= ~TS_ASLEEP;
-                       wakeup((caddr_t)&tp->t_outq);
+                       wakeup(&tp->t_outq);
                }
                selwakeup(&tp->t_wsel);
        }
@@ -533,7 +532,7 @@
                if (tp->t_outq.c_cc <= tp->t_lowat) {
                        if (tp->t_state & TS_ASLEEP) {
                                tp->t_state &= ~TS_ASLEEP;
-                               wakeup((caddr_t)&tp->t_outq);
+                               wakeup(&tp->t_outq);
                        }
                        selwakeup(&tp->t_wsel);
                }
@@ -900,7 +899,7 @@
        if (msg_len == 1)
                save[0] = msg->body[0];
        else if (msg_len > 0)
-               bcopy(msg->body, save, msg_len);
+               memcpy(save, msg->body, msg_len);
 
        /*
         * Cancel out any keys in both the last and current message as
@@ -975,7 +974,7 @@
        if (msg_len == 1)
                dev->keyboard.last_codes[0] = save[0];
        else if (msg_len > 0)
-               bcopy(save, dev->keyboard.last_codes, msg_len);
+               memcpy(dev->keyboard.last_codes, save, msg_len);
        dev->keyboard.last_codes_count = msg_len;
        if (dev->keyboard.k_ar_state == K_AR_ACTIVE)
                callout_reset(&dev->keyboard.repeat_ch, hz / 2,
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/fb_usrreq.c
--- a/sys/arch/pmax/dev/fb_usrreq.c     Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/fb_usrreq.c     Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fb_usrreq.c,v 1.21 2000/06/26 04:55:54 simonb Exp $    */
+/*     $NetBSD: fb_usrreq.c,v 1.22 2001/07/07 14:21:00 simonb Exp $    */
 
 /*ARGSUSED*/
 int
@@ -76,7 +76,7 @@
         */
        lk_reset(fbtty->kbddev, fbtty->KBDPutc);
 
-       bzero((caddr_t)fi->fi_pixels, fi->fi_pixelsize);
+       memset(fi->fi_pixels, 0, fi->fi_pixelsize);
        (*fi->fi_driver->fbd_poscursor)
                (fi, fbtty->col * 8, fbtty->row * 15);
        return (0);
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/ims332.c
--- a/sys/arch/pmax/dev/ims332.c        Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/ims332.c        Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ims332.c,v 1.12 2000/01/10 03:24:32 simonb Exp $       */
+/*     $NetBSD: ims332.c,v 1.13 2001/07/07 14:21:00 simonb Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993, 1995
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: ims332.c,v 1.12 2000/01/10 03:24:32 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ims332.c,v 1.13 2001/07/07 14:21:00 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -271,7 +271,7 @@
        cmap_bits = (u_char *)bits;
        cmap = (u_char *)(fi -> fi_cmap_bits) + index * 3;
 
-       bcopy (cmap, cmap_bits, count * 3);
+       memcpy(cmap_bits, cmap, count * 3);
        return 0;
 }
 
diff -r f8f18e6f61df -r e46ae7c9a6af sys/arch/pmax/dev/mfb.c
--- a/sys/arch/pmax/dev/mfb.c   Sat Jul 07 12:23:43 2001 +0000
+++ b/sys/arch/pmax/dev/mfb.c   Sat Jul 07 14:20:59 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mfb.c,v 1.45 2000/02/03 04:09:14 nisimura Exp $        */
+/*     $NetBSD: mfb.c,v 1.46 2001/07/07 14:21:00 simonb Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.45 2000/02/03 04:09:14 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.46 2001/07/07 14:21:00 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -223,7 +223,7 @@
        void *aux;
 {
        struct tc_attach_args *ta = aux;
-       caddr_t mfbaddr = (caddr_t) ta->ta_addr;
+       caddr_t mfbaddr = (caddr_t)ta->ta_addr;
        int unit = self->dv_unit;
        struct fbinfo *fi;
        
@@ -354,16 +354,16 @@
        u_char cursor_save [6];
 
        /* Stash the current cursor color (and overlay). */
-       bcopy (cursor_RGB, cursor_save, 6);
+       memcpy(cursor_save, cursor_RGB, sizeof(cursor_RGB));
        /* Zero the cursor colors. */
-       bzero(cursor_RGB, 6);
+       memset(cursor_RGB, 0, sizeof(cursor_RGB));
        /* Write the zeroed colors to the hardware and fb color map. */
        mfbRestoreCursorColor (fi);
        /*
         * Replace stashed colors, so the cursor will be visible next
         * time the cursor color map is restored.
         */
-       bcopy (cursor_save, cursor_RGB, 6);
+       memcpy(cursor_RGB, cursor_save, sizeof(cursor_RGB));
 }
 
 



Home | Main Index | Thread Index | Old Index