Source-Changes-HG archive

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

[src/trunk]: src/lib/libc fix WARNS=2 (-Wshadow) warnings



details:   https://anonhg.NetBSD.org/src/rev/ec66f5b30857
branches:  trunk
changeset: 517007:ec66f5b30857
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Nov 04 13:57:29 2001 +0000

description:
fix WARNS=2 (-Wshadow) warnings

diffstat:

 lib/libc/arch/i386/gen/ldexp.c |  12 ++++++------
 lib/libc/db/recno/rec_delete.c |  14 +++++++-------
 lib/libc/net/rcmd.c            |  28 ++++++++++++++--------------
 lib/libc/net/rthdr.c           |  24 ++++++++++++------------
 lib/libc/rpc/bindresvport.c    |  22 +++++++++++-----------
 lib/libc/rpc/clnt_bcast.c      |  14 +++++++-------
 lib/libc/rpc/clnt_raw.c        |   8 ++++----
 lib/libc/rpc/rpc_generic.c     |  30 +++++++++++++++---------------
 lib/libc/rpc/rpc_soc.c         |  10 +++++-----
 lib/libc/stdio/vfprintf.c      |  22 +++++++++++-----------
 lib/libc/stdlib/getopt_long.c  |  20 ++++++++++----------
 lib/libc/time/localtime.c      |  20 ++++++++++----------
 12 files changed, 112 insertions(+), 112 deletions(-)

diffs (truncated from 647 to 300 lines):

diff -r 082de6037177 -r ec66f5b30857 lib/libc/arch/i386/gen/ldexp.c
--- a/lib/libc/arch/i386/gen/ldexp.c    Sun Nov 04 13:42:27 2001 +0000
+++ b/lib/libc/arch/i386/gen/ldexp.c    Sun Nov 04 13:57:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.6 1999/03/10 08:15:43 mycroft Exp $        */
+/*     $NetBSD: ldexp.c,v 1.7 2001/11/04 13:57:29 lukem Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.6 1999/03/10 08:15:43 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.7 2001/11/04 13:57:29 lukem Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -49,20 +49,20 @@
  * ldexp(value, exp): return value * (2 ** exp).
  */
 double
-ldexp(value, exp)
+ldexp(value, expon)
        double value;
-       int exp;
+       int expon;
 {
        double temp;
 
 #if __GNUC__ >= 2
        __asm ("fscale"
                : "=t" (temp)
-               : "0" (value), "u" ((double)exp));
+               : "0" (value), "u" ((double)expon));
 #else
        __asm ("fscale; fstp %%st(1)"
                : "=f" (temp)
-               : "f" (value), "0" ((double)exp));
+               : "f" (value), "0" ((double)expon));
 #endif
        return (temp);
 }
diff -r 082de6037177 -r ec66f5b30857 lib/libc/db/recno/rec_delete.c
--- a/lib/libc/db/recno/rec_delete.c    Sun Nov 04 13:42:27 2001 +0000
+++ b/lib/libc/db/recno/rec_delete.c    Sun Nov 04 13:57:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rec_delete.c,v 1.11 1998/12/09 12:42:51 christos Exp $ */
+/*     $NetBSD: rec_delete.c,v 1.12 2001/11/04 13:57:29 lukem Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)rec_delete.c       8.7 (Berkeley) 7/14/94";
 #else
-__RCSID("$NetBSD: rec_delete.c,v 1.11 1998/12/09 12:42:51 christos Exp $");
+__RCSID("$NetBSD: rec_delete.c,v 1.12 2001/11/04 13:57:29 lukem Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -159,10 +159,10 @@
  *     RET_SUCCESS, RET_ERROR.
  */
 int
-__rec_dleaf(t, h, index)
+__rec_dleaf(t, h, idx)
        BTREE *t;
        PAGE *h;
-       u_int32_t index;
+       u_int32_t idx;
 {
        RLEAF *rl;
        indx_t *ip, cnt, offset;
@@ -180,7 +180,7 @@
         * down, overwriting the deleted record and its index.  If the record
         * uses overflow pages, make them available for reuse.
         */
-       to = rl = GETRLEAF(h, index);
+       to = rl = GETRLEAF(h, idx);
        if (rl->flags & P_BIGDATA && __ovfl_delete(t, rl->bytes) == RET_ERROR)
                return (RET_ERROR);
        nbytes = NRLEAF(rl);
@@ -193,8 +193,8 @@
        memmove(from + nbytes, from, (size_t)((char *)to - from));
        h->upper += nbytes;
 
-       offset = h->linp[index];
-       for (cnt = &h->linp[index] - (ip = &h->linp[0]); cnt--; ++ip)
+       offset = h->linp[idx];
+       for (cnt = &h->linp[idx] - (ip = &h->linp[0]); cnt--; ++ip)
                if (ip[0] < offset)
                        ip[0] += nbytes;
        for (cnt = &h->linp[NEXTINDEX(h)] - ip; --cnt; ++ip)
diff -r 082de6037177 -r ec66f5b30857 lib/libc/net/rcmd.c
--- a/lib/libc/net/rcmd.c       Sun Nov 04 13:42:27 2001 +0000
+++ b/lib/libc/net/rcmd.c       Sun Nov 04 13:57:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rcmd.c,v 1.44 2000/07/07 08:03:39 itohy Exp $  */
+/*     $NetBSD: rcmd.c,v 1.45 2001/11/04 13:57:30 lukem Exp $  */
 
 /*
  * Copyright (c) 1997 Matthew R. Green.
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)rcmd.c     8.3 (Berkeley) 3/26/94";
 #else
-__RCSID("$NetBSD: rcmd.c,v 1.44 2000/07/07 08:03:39 itohy Exp $");
+__RCSID("$NetBSD: rcmd.c,v 1.45 2001/11/04 13:57:30 lukem Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -636,15 +636,15 @@
        int superuser;
        const char *ruser, *luser;
 {
-       struct sockaddr_in sin;
+       struct sockaddr_in irsin;
 
-       memset(&sin, 0, sizeof(sin));
-       sin.sin_family = AF_INET;
+       memset(&irsin, 0, sizeof(irsin));
+       irsin.sin_family = AF_INET;
 #ifdef BSD4_4
-       sin.sin_len = sizeof(struct sockaddr_in);
+       irsin.sin_len = sizeof(struct sockaddr_in);
 #endif
-       memcpy(&sin.sin_addr, &raddr, sizeof(sin.sin_addr));
-       return iruserok_sa(&sin, sizeof(struct sockaddr_in), superuser, ruser,
+       memcpy(&irsin.sin_addr, &raddr, sizeof(irsin.sin_addr));
+       return iruserok_sa(&irsin, sizeof(struct sockaddr_in), superuser, ruser,
                    luser);
 }
 
@@ -752,15 +752,15 @@
        u_int32_t raddr;
        const char *luser, *ruser;
 {
-       struct sockaddr_in sin;
+       struct sockaddr_in ivusin;
 
-       memset(&sin, 0, sizeof(sin));
-       sin.sin_family = AF_INET;
+       memset(&ivusin, 0, sizeof(ivusin));
+       ivusin.sin_family = AF_INET;
 #ifdef BSD4_4
-       sin.sin_len = sizeof(struct sockaddr_in);
+       ivusin.sin_len = sizeof(struct sockaddr_in);
 #endif
-       memcpy(&sin.sin_addr, &raddr, sizeof(sin.sin_addr));
-       return __ivaliduser_sa(hostf, (struct sockaddr *)(void *)&sin,
+       memcpy(&ivusin.sin_addr, &raddr, sizeof(ivusin.sin_addr));
+       return __ivaliduser_sa(hostf, (struct sockaddr *)(void *)&ivusin,
            sizeof(struct sockaddr_in), luser, ruser);
 }
 
diff -r 082de6037177 -r ec66f5b30857 lib/libc/net/rthdr.c
--- a/lib/libc/net/rthdr.c      Sun Nov 04 13:42:27 2001 +0000
+++ b/lib/libc/net/rthdr.c      Sun Nov 04 13:57:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rthdr.c,v 1.10 2000/07/06 03:02:22 christos Exp $      */
+/*     $NetBSD: rthdr.c,v 1.11 2001/11/04 13:57:30 lukem Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: rthdr.c,v 1.10 2000/07/06 03:02:22 christos Exp $");
+__RCSID("$NetBSD: rthdr.c,v 1.11 2001/11/04 13:57:30 lukem Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -254,9 +254,9 @@
 }
 
 struct in6_addr *
-inet6_rthdr_getaddr(cmsg, index)
+inet6_rthdr_getaddr(cmsg, idx)
     struct cmsghdr *cmsg;
-    int index;
+    int idx;
 {
     struct ip6_rthdr *rthdr;
 
@@ -278,13 +278,13 @@
            return NULL;
        }
        naddr = (rt0->ip6r0_len * 8) / sizeof(struct in6_addr);
-       if (index <= 0 || naddr < index) {
+       if (idx <= 0 || naddr < idx) {
 #ifdef DEBUG
-           fprintf(stderr, "inet6_rthdr_getaddr: invalid index(%d)\n", index);
+           fprintf(stderr, "inet6_rthdr_getaddr: invalid index(%d)\n", idx);
 #endif 
            return NULL;
        }
-       return &rt0->ip6r0_addr[index - 1];
+       return &rt0->ip6r0_addr[idx - 1];
       }
 
     default:
@@ -297,9 +297,9 @@
 }
 
 int
-inet6_rthdr_getflags(cmsg, index)
+inet6_rthdr_getflags(cmsg, idx)
     const struct cmsghdr *cmsg;
-    int index;
+    int idx;
 {
     const struct ip6_rthdr *rthdr;
 
@@ -323,13 +323,13 @@
            return -1;
        }
        naddr = (rt0->ip6r0_len * 8) / sizeof(struct in6_addr);
-       if (index < 0 || naddr < index) {
+       if (idx < 0 || naddr < idx) {
 #ifdef DEBUG
-           fprintf(stderr, "inet6_rthdr_getflags: invalid index(%d)\n", index);
+           fprintf(stderr, "inet6_rthdr_getflags: invalid index(%d)\n", idx);
 #endif 
            return -1;
        }
-       if (rt0->ip6r0_slmap[index / 8] & (0x80 >> (index % 8)))
+       if (rt0->ip6r0_slmap[idx / 8] & (0x80 >> (idx % 8)))
            return IPV6_RTHDR_STRICT;
        else
            return IPV6_RTHDR_LOOSE;
diff -r 082de6037177 -r ec66f5b30857 lib/libc/rpc/bindresvport.c
--- a/lib/libc/rpc/bindresvport.c       Sun Nov 04 13:42:27 2001 +0000
+++ b/lib/libc/rpc/bindresvport.c       Sun Nov 04 13:57:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bindresvport.c,v 1.19 2000/07/06 03:03:59 christos Exp $       */
+/*     $NetBSD: bindresvport.c,v 1.20 2001/11/04 13:57:30 lukem Exp $  */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)bindresvport.c 1.8 88/02/08 SMI";
 static char *sccsid = "@(#)bindresvport.c      2.2 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: bindresvport.c,v 1.19 2000/07/06 03:03:59 christos Exp $");
+__RCSID("$NetBSD: bindresvport.c,v 1.20 2001/11/04 13:57:30 lukem Exp $");
 #endif
 #endif
 
@@ -65,11 +65,11 @@
  * Bind a socket to a privileged IP port
  */
 int
-bindresvport(sd, sin)
+bindresvport(sd, brsin)
        int sd;
-       struct sockaddr_in *sin;
+       struct sockaddr_in *brsin;
 {
-       return bindresvport_sa(sd, (struct sockaddr *)(void *)sin);
+       return bindresvport_sa(sd, (struct sockaddr *)(void *)brsin);
 }
 
 /*
@@ -82,9 +82,9 @@
 {
        int error, old;
        struct sockaddr_storage myaddr;
-       struct sockaddr_in *sin;
+       struct sockaddr_in *brsin;
 #ifdef INET6
-       struct sockaddr_in6 *sin6;
+       struct sockaddr_in6 *brsin6;
 #endif
        int proto, portrange, portlow;
        u_int16_t *portp;
@@ -108,18 +108,18 @@
                proto = IPPROTO_IP;
                portrange = IP_PORTRANGE;
                portlow = IP_PORTRANGE_LOW;
-               sin = (struct sockaddr_in *)(void *)sa;
+               brsin = (struct sockaddr_in *)(void *)sa;
                salen = sizeof(struct sockaddr_in);
-               portp = &sin->sin_port;
+               portp = &brsin->sin_port;
                break;
 #ifdef INET6
        case AF_INET6:
                proto = IPPROTO_IPV6;
                portrange = IPV6_PORTRANGE;
                portlow = IPV6_PORTRANGE_LOW;
-               sin6 = (struct sockaddr_in6 *)(void *)sa;
+               brsin6 = (struct sockaddr_in6 *)(void *)sa;
                salen = sizeof(struct sockaddr_in6);
-               portp = &sin6->sin6_port;
+               portp = &brsin6->sin6_port;
                break;
 #endif
        default:



Home | Main Index | Thread Index | Old Index