Source-Changes-HG archive

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

[src/trunk]: src/sbin fix a couple of -Wshadow warnings



details:   https://anonhg.NetBSD.org/src/rev/0f632e07dbf5
branches:  trunk
changeset: 516886:0f632e07dbf5
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Nov 01 07:31:22 2001 +0000

description:
fix a couple of -Wshadow warnings

diffstat:

 sbin/fsck/fsck.c         |   8 ++++----
 sbin/fsck/preen.c        |  14 +++++++-------
 sbin/ldconfig/ldconfig.c |  14 ++++++--------
 3 files changed, 17 insertions(+), 19 deletions(-)

diffs (128 lines):

diff -r f74ef5d04184 -r 0f632e07dbf5 sbin/fsck/fsck.c
--- a/sbin/fsck/fsck.c  Thu Nov 01 07:27:35 2001 +0000
+++ b/sbin/fsck/fsck.c  Thu Nov 01 07:31:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fsck.c,v 1.26 2001/06/18 06:28:59 lukem Exp $  */
+/*     $NetBSD: fsck.c,v 1.27 2001/11/01 07:31:22 lukem Exp $  */
 
 /*
  * Copyright (c) 1996 Christos Zoulas. All rights reserved.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fsck.c,v 1.26 2001/06/18 06:28:59 lukem Exp $");
+__RCSID("$NetBSD: fsck.c,v 1.27 2001/11/01 07:31:22 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -446,7 +446,7 @@
 
 
 static void
-mangle(char *options, int *argcp, const char ***argvp, int *maxargcp)
+mangle(char *opts, int *argcp, const char ***argvp, int *maxargcp)
 {
        char *p, *s;
        int argc, maxargc;
@@ -456,7 +456,7 @@
        argv = *argvp;
        maxargc = *maxargcp;
 
-       for (s = options; (p = strsep(&s, ",")) != NULL;) {
+       for (s = opts; (p = strsep(&s, ",")) != NULL;) {
                /* Always leave space for one more argument and the NULL. */
                if (argc >= maxargc - 3) {
                        maxargc <<= 1;
diff -r f74ef5d04184 -r 0f632e07dbf5 sbin/fsck/preen.c
--- a/sbin/fsck/preen.c Thu Nov 01 07:27:35 2001 +0000
+++ b/sbin/fsck/preen.c Thu Nov 01 07:31:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: preen.c,v 1.22 2001/06/18 06:28:59 lukem Exp $ */
+/*     $NetBSD: preen.c,v 1.23 2001/11/01 07:31:23 lukem Exp $ */
 
 /*
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)preen.c    8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: preen.c,v 1.22 2001/06/18 06:28:59 lukem Exp $");
+__RCSID("$NetBSD: preen.c,v 1.23 2001/11/01 07:31:23 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -293,19 +293,19 @@
 
 
 static void
-addpart(const char *type, const char *devname, const char *mntpt, void *auxarg)
+addpart(const char *type, const char *dev, const char *mntpt, void *auxarg)
 {
-       struct diskentry *d = finddisk(devname);
+       struct diskentry *d = finddisk(dev);
        struct partentry *p;
 
        TAILQ_FOREACH(p, &d->d_part, p_entries)
-               if (strcmp(p->p_devname, devname) == 0) {
-                       warnx("%s in fstab more than once!\n", devname);
+               if (strcmp(p->p_devname, dev) == 0) {
+                       warnx("%s in fstab more than once!\n", dev);
                        return;
                }
 
        p = emalloc(sizeof(*p));
-       p->p_devname = estrdup(devname);
+       p->p_devname = estrdup(dev);
        p->p_mntpt = estrdup(mntpt);
        p->p_type = estrdup(type);
        p->p_auxarg = auxarg;
diff -r f74ef5d04184 -r 0f632e07dbf5 sbin/ldconfig/ldconfig.c
--- a/sbin/ldconfig/ldconfig.c  Thu Nov 01 07:27:35 2001 +0000
+++ b/sbin/ldconfig/ldconfig.c  Thu Nov 01 07:31:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldconfig.c,v 1.33 2001/02/19 22:56:20 cgd Exp $        */
+/*     $NetBSD: ldconfig.c,v 1.34 2001/11/01 07:33:43 lukem Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -389,7 +389,7 @@
        int                     strtab_sz = 0;  /* Total length of strings */
        int                     nhints = 0;     /* Total number of hints */
        int                     fd;
-       char                    *tmpfile;
+       char                    *tempfile;
 
        for (shp = shlib_head; shp; shp = shp->next) {
                strtab_sz += 1 + strlen(shp->name);
@@ -430,8 +430,6 @@
                  (hinthash(shp->name, shp->major, shp->minor) % hdr.hh_nbucket);
 
                if (bp->hi_pathx) {
-                       int     i;
-
                        for (i = 0; i < hdr.hh_nbucket; i++) {
                                if (blist[i].hi_pathx == 0)
                                        break;
@@ -469,9 +467,9 @@
                errx(1, "str_index(%d) != strtab_sz(%d)", str_index, strtab_sz);
        }
 
-       tmpfile = concat(_PATH_LD_HINTS, ".XXXXXX", "");
-       if ((fd = mkstemp(tmpfile)) == -1) {
-               warn("%s", tmpfile);
+       tempfile = concat(_PATH_LD_HINTS, ".XXXXXX", "");
+       if ((fd = mkstemp(tempfile)) == -1) {
+               warn("%s", tempfile);
                return (-1);
        }
 
@@ -504,7 +502,7 @@
                return (-1);
        }
 
-       if (rename(tmpfile, _PATH_LD_HINTS) != 0) {
+       if (rename(tempfile, _PATH_LD_HINTS) != 0) {
                warn("%s", _PATH_LD_HINTS);
                return (-1);
        }



Home | Main Index | Thread Index | Old Index