Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libsa Remove bcmp(). Use memcmp() instead.



details:   https://anonhg.NetBSD.org/src/rev/dfd6e394b09e
branches:  trunk
changeset: 582006:dfd6e394b09e
user:      junyoung <junyoung%NetBSD.org@localhost>
date:      Mon Jun 13 12:11:07 2005 +0000

description:
Remove bcmp(). Use memcmp() instead.

diffstat:

 sys/lib/libsa/Makefile      |  4 ++--
 sys/lib/libsa/arp.c         |  6 +++---
 sys/lib/libsa/bcmp.c        |  3 ---
 sys/lib/libsa/bootp.c       |  6 +++---
 sys/lib/libsa/checkpasswd.c |  4 ++--
 sys/lib/libsa/ether.c       |  6 +++---
 sys/lib/libsa/rarp.c        |  4 ++--
 sys/lib/libsa/stand.h       |  3 ++-
 8 files changed, 17 insertions(+), 19 deletions(-)

diffs (149 lines):

diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/Makefile
--- a/sys/lib/libsa/Makefile    Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/Makefile    Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.55 2004/05/19 23:37:41 abs Exp $
+#      $NetBSD: Makefile,v 1.56 2005/06/13 12:11:07 junyoung Exp $
 
 LIB=   sa
 NOPIC= # defined
@@ -17,7 +17,7 @@
 .PATH.c: ${SADIR}
 
 # stand routines
-SRCS+= alloc.c bcmp.c bcopy.c bzero.c errno.c exit.c exec.c files.c \
+SRCS+= alloc.c bcopy.c bzero.c errno.c exit.c exec.c files.c \
        getfile.c gets.c globals.c memcmp.c memcpy.c memmove.c memset.c \
        panic.c printf.c qsort.c snprintf.c sprintf.c strerror.c subr_prf.c \
        twiddle.c vsprintf.c checkpasswd.c
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/arp.c
--- a/sys/lib/libsa/arp.c       Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/arp.c       Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arp.c,v 1.25 2005/02/26 22:58:56 perry Exp $   */
+/*     $NetBSD: arp.c,v 1.26 2005/06/13 12:11:07 junyoung Exp $        */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -257,7 +257,7 @@
        }
 
        /* Is the reply from the source we want? */
-       if (bcmp(&arp_list[arp_num].addr,
+       if (memcmp(&arp_list[arp_num].addr,
                         ah->arp_spa, sizeof(ah->arp_spa)))
        {
 #ifdef ARP_DEBUG
@@ -308,7 +308,7 @@
        }
 
        /* If we are not the target, ignore the request. */
-       if (bcmp(arp->arp_tpa, &d->myip, sizeof(arp->arp_tpa)))
+       if (memcmp(arp->arp_tpa, &d->myip, sizeof(arp->arp_tpa)))
                return;
 
 #ifdef ARP_DEBUG
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/bcmp.c
--- a/sys/lib/libsa/bcmp.c      Mon Jun 13 12:06:36 2005 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: bcmp.c,v 1.6 2003/09/01 12:28:03 dsl Exp $     */
-
-#include "memcmp.c"
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/bootp.c
--- a/sys/lib/libsa/bootp.c     Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/bootp.c     Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootp.c,v 1.26 2005/02/26 22:58:56 perry Exp $ */
+/*     $NetBSD: bootp.c,v 1.27 2005/06/13 12:11:07 junyoung Exp $      */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -337,12 +337,12 @@
 #endif
 
        /* Suck out vendor info */
-       if (bcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) {
+       if (memcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) {
                if (vend_rfc1048(bp->bp_vend, sizeof(bp->bp_vend)) != 0)
                        goto bad;
        }
 #ifdef BOOTP_VEND_CMU
-       else if (bcmp(vm_cmu, bp->bp_vend, sizeof(vm_cmu)) == 0)
+       else if (memcmp(vm_cmu, bp->bp_vend, sizeof(vm_cmu)) == 0)
                vend_cmu(bp->bp_vend);
 #endif
        else
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/checkpasswd.c
--- a/sys/lib/libsa/checkpasswd.c       Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/checkpasswd.c       Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: checkpasswd.c,v 1.5 2003/04/15 22:26:42 dsl Exp $      */
+/*     $NetBSD: checkpasswd.c,v 1.6 2005/06/13 12:11:07 junyoung Exp $ */
 
 /*-
  * Copyright (c) 1993
@@ -120,7 +120,7 @@
                MD5Init(&md5ctx);
                MD5Update(&md5ctx, passwd, strlen(passwd));
                MD5Final(pwdigest, &md5ctx);
-               if (bcmp(pwdigest, password, 16) == 0)
+               if (memcmp(pwdigest, password, 16) == 0)
                        return (1);
        }
 
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/ether.c
--- a/sys/lib/libsa/ether.c     Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/ether.c     Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ether.c,v 1.18 2003/08/31 22:40:48 fvdl Exp $  */
+/*     $NetBSD: ether.c,v 1.19 2005/06/13 12:11:07 junyoung Exp $      */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -117,8 +117,8 @@
                return (-1);
 
        /* Validate Ethernet address. */
-       if (bcmp(d->myea, eh->ether_dhost, 6) != 0 &&
-           bcmp(bcea, eh->ether_dhost, 6) != 0) {
+       if (memcmp(d->myea, eh->ether_dhost, 6) != 0 &&
+           memcmp(bcea, eh->ether_dhost, 6) != 0) {
 #ifdef ETHER_DEBUG
                if (debug)
                        printf("readether: not ours (ea=%s)\n",
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/rarp.c
--- a/sys/lib/libsa/rarp.c      Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/rarp.c      Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rarp.c,v 1.23 2005/02/26 22:58:56 perry Exp $  */
+/*     $NetBSD: rarp.c,v 1.24 2005/06/13 12:11:07 junyoung Exp $       */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -231,7 +231,7 @@
        }
 
        /* Is the reply for our Ethernet address? */
-       if (bcmp(ap->arp_tha, d->myea, 6)) {
+       if (memcmp(ap->arp_tha, d->myea, 6)) {
 #ifdef RARP_DEBUG
                if (debug)
                        printf("unwanted address\n");
diff -r e528982f20e5 -r dfd6e394b09e sys/lib/libsa/stand.h
--- a/sys/lib/libsa/stand.h     Mon Jun 13 12:06:36 2005 +0000
+++ b/sys/lib/libsa/stand.h     Mon Jun 13 12:11:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stand.h,v 1.56 2005/05/23 19:05:00 jmc Exp $   */
+/*     $NetBSD: stand.h,v 1.57 2005/06/13 12:11:07 junyoung Exp $      */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -83,6 +83,7 @@
 #define vprintf                libsa_vprintf
 #define vsprintf       libsa_vsprintf
 #endif
+#define bcmp(s1, s2, l)        memcmp(s1, s2, l)
 #ifdef LIBSA_USE_MEMSET
 #define        bzero(s, l)     memset(s, 0, l)
 #endif



Home | Main Index | Thread Index | Old Index