Source-Changes-HG archive

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

[src/trunk]: src/sbin/dump fix -Wshadow warnings



details:   https://anonhg.NetBSD.org/src/rev/9f20de6fba2b
branches:  trunk
changeset: 516891:9f20de6fba2b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Nov 01 08:03:03 2001 +0000

description:
fix -Wshadow warnings

diffstat:

 sbin/dump/dumprmt.c   |  10 +++++-----
 sbin/dump/ffs_inode.c |  16 ++++++++--------
 sbin/dump/optr.c      |  24 ++++++++++++------------
 sbin/dump/tape.c      |  10 +++++-----
 sbin/dump/traverse.c  |  40 ++++++++++++++++++++--------------------
 5 files changed, 50 insertions(+), 50 deletions(-)

diffs (truncated from 363 to 300 lines):

diff -r de06227a9410 -r 9f20de6fba2b sbin/dump/dumprmt.c
--- a/sbin/dump/dumprmt.c       Thu Nov 01 07:48:08 2001 +0000
+++ b/sbin/dump/dumprmt.c       Thu Nov 01 08:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dumprmt.c,v 1.25 2001/05/28 00:41:14 lukem Exp $       */
+/*     $NetBSD: dumprmt.c,v 1.26 2001/11/01 08:03:03 lukem Exp $       */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)dumprmt.c  8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: dumprmt.c,v 1.25 2001/05/28 00:41:14 lukem Exp $");
+__RCSID("$NetBSD: dumprmt.c,v 1.26 2001/11/01 08:03:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -184,13 +184,13 @@
 }
 
 int
-rmtopen(char *tape, int mode)
+rmtopen(char *tapedevice, int mode)
 {
        char buf[256];
 
-       (void)snprintf(buf, sizeof buf, "O%s\n%d\n", tape, mode);
+       (void)snprintf(buf, sizeof buf, "O%s\n%d\n", tapedevice, mode);
        rmtstate = TS_OPEN;
-       return (rmtcall(tape, buf));
+       return (rmtcall(tapedevice, buf));
 }
 
 void
diff -r de06227a9410 -r 9f20de6fba2b sbin/dump/ffs_inode.c
--- a/sbin/dump/ffs_inode.c     Thu Nov 01 07:48:08 2001 +0000
+++ b/sbin/dump/ffs_inode.c     Thu Nov 01 08:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ffs_inode.c,v 1.7 2001/08/17 02:18:47 lukem Exp $ */
+/*      $NetBSD: ffs_inode.c,v 1.8 2001/11/01 08:03:03 lukem Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c      8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: ffs_inode.c,v 1.7 2001/08/17 02:18:47 lukem Exp $");
+__RCSID("$NetBSD: ffs_inode.c,v 1.8 2001/11/01 08:03:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -85,20 +85,20 @@
  * Determine whether byte-swapping needs to be done on this file system.
  */
 int
-fs_read_sblock(char *sblock_buf)
+fs_read_sblock(char *superblock)
 {
-       int needswap = 0;
+       int ns = 0;
 
-       sblock = (struct fs *)sblock_buf;
-       rawread(SBOFF, (char *) sblock, SBSIZE);
+       sblock = (struct fs *)superblock;
+       rawread(SBOFF, (char *) superblock, SBSIZE);
        if (sblock->fs_magic != FS_MAGIC) {
                if (sblock->fs_magic == bswap32(FS_MAGIC)) {
                        ffs_sb_swap(sblock, sblock);
-                       needswap = 1;
+                       ns = 1;
                } else
                        quit("bad sblock magic number\n");
        }
-       return needswap;
+       return ns;
 }
 
 /*
diff -r de06227a9410 -r 9f20de6fba2b sbin/dump/optr.c
--- a/sbin/dump/optr.c  Thu Nov 01 07:48:08 2001 +0000
+++ b/sbin/dump/optr.c  Thu Nov 01 08:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: optr.c,v 1.20 2001/10/25 08:04:27 lukem Exp $  */
+/*     $NetBSD: optr.c,v 1.21 2001/11/01 08:03:03 lukem Exp $  */
 
 /*-
  * Copyright (c) 1980, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)optr.c     8.2 (Berkeley) 1/6/94";
 #else
-__RCSID("$NetBSD: optr.c,v 1.20 2001/10/25 08:04:27 lukem Exp $");
+__RCSID("$NetBSD: optr.c,v 1.21 2001/11/01 08:03:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -72,7 +72,7 @@
 extern  char *time_string;
 extern  char default_time_string[];
 
-static void do_timestamp(time_t time, char *msg);
+static void do_timestamp(time_t, char *);
 
 /*
  *     Query the operator; This previously-fascist piece of code
@@ -215,10 +215,10 @@
 void
 broadcast(char *message)
 {
-       time_t          clock;
-       FILE    *f_utmp;
-       struct  utmp    utmp;
-       char    **np;
+       struct utmp utmp;
+       time_t  now;
+       FILE   *f_utmp;
+       char  **np;
        int     pid, s;
 
        if (!notify || gp == NULL)
@@ -239,8 +239,8 @@
                return;
        }
 
-       clock = time((time_t *)0);
-       localclock = localtime(&clock);
+       now = time((time_t *)0);
+       localclock = localtime(&now);
 
        if ((f_utmp = fopen(_PATH_UTMP, "r")) == NULL) {
                msg("Cannot open %s: %s\n", _PATH_UTMP, strerror(errno));
@@ -314,12 +314,12 @@
 #define STAMP_LENGTH 80
 
 static void
-do_timestamp(time_t time, char *msg)
+do_timestamp(time_t thistime, char *message)
 {
        struct tm tm_time;
        char then[STAMP_LENGTH + 1];
        
-       (void) localtime_r(&time, &tm_time);
+       (void) localtime_r(&thistime, &tm_time);
        if (strftime(then, STAMP_LENGTH, time_string, &tm_time) == 0) {
                time_string = default_time_string;
                strftime(then, STAMP_LENGTH, time_string, &tm_time);
@@ -327,7 +327,7 @@
                   "DUMP: ERROR: TIMEFORMAT too long, reverting to default\n");
        }
        
-       fprintf(stderr, msg, then);
+       fprintf(stderr, message, then);
 }
 
                        
diff -r de06227a9410 -r 9f20de6fba2b sbin/dump/tape.c
--- a/sbin/dump/tape.c  Thu Nov 01 07:48:08 2001 +0000
+++ b/sbin/dump/tape.c  Thu Nov 01 08:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tape.c,v 1.29 2001/08/14 05:44:15 lukem Exp $  */
+/*     $NetBSD: tape.c,v 1.30 2001/11/01 08:03:03 lukem Exp $  */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)tape.c     8.4 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: tape.c,v 1.29 2001/08/14 05:44:15 lukem Exp $");
+__RCSID("$NetBSD: tape.c,v 1.30 2001/11/01 08:03:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -563,7 +563,7 @@
        int     parentpid;
        int     childpid;
        int     status;
-       int     waitpid;
+       int     waitforpid;
        char    *p;
 #ifdef sunos
        void    (*interrupt_save)();
@@ -598,9 +598,9 @@
                msg("Tape: %d; parent process: %d child process %d\n",
                        tapeno+1, parentpid, childpid);
 #endif /* TDEBUG */
-               while ((waitpid = wait(&status)) != childpid)
+               while ((waitforpid = wait(&status)) != childpid)
                        msg("Parent %d waiting for child %d has another child %d return\n",
-                               parentpid, childpid, waitpid);
+                               parentpid, childpid, waitforpid);
                if (status & 0xFF) {
                        msg("Child %d returns LOB status %o\n",
                                childpid, status&0xFF);
diff -r de06227a9410 -r 9f20de6fba2b sbin/dump/traverse.c
--- a/sbin/dump/traverse.c      Thu Nov 01 07:48:08 2001 +0000
+++ b/sbin/dump/traverse.c      Thu Nov 01 08:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traverse.c,v 1.32 2001/08/14 05:44:15 lukem Exp $      */
+/*     $NetBSD: traverse.c,v 1.33 2001/11/01 08:03:03 lukem Exp $      */
 
 /*-
  * Copyright (c) 1980, 1988, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95";
 #else
-__RCSID("$NetBSD: traverse.c,v 1.32 2001/08/14 05:44:15 lukem Exp $");
+__RCSID("$NetBSD: traverse.c,v 1.33 2001/11/01 08:03:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -138,7 +138,7 @@
  * Determine if given inode should be dumped
  */
 void
-mapfileino(ino_t ino, long *tapesize, int *dirskipped)
+mapfileino(ino_t ino, long *tape_size, int *dirskipped)
 {
        int mode;
        struct dinode *dp;
@@ -162,9 +162,9 @@
        if (WANTTODUMP(dp)) {
                SETINO(ino, dumpinomap);
                if (mode != IFREG && mode != IFDIR && mode != IFLNK)
-                       *tapesize += 1;
+                       *tape_size += 1;
                else
-                       *tapesize += blockest(dp);
+                       *tape_size += blockest(dp);
                return;
        }
        if (mode == IFDIR) {
@@ -185,7 +185,7 @@
  * disk may be NULL if dirv is NULL.
  */
 int
-mapfiles(ino_t maxino, long *tapesize, char *disk, char * const *dirv)
+mapfiles(ino_t maxino, long *tape_size, char *diskname, char * const *dirv)
 {
        int anydirskipped = 0;
 
@@ -214,7 +214,7 @@
                        case FTS_DP:            /* already seen dir */
                                continue;
                        }
-                       mapfileino(entry->fts_statp->st_ino, tapesize,
+                       mapfileino(entry->fts_statp->st_ino, tape_size,
                            &anydirskipped);
                }
                (void)fts_close(dirh);
@@ -231,7 +231,7 @@
                        else
                                (void)snprintf(path, sizeof(path), "%s",
                                    dirv[d]);
-                       while (strcmp(path, disk) != 0) {
+                       while (strcmp(path, diskname) != 0) {
                                char *p;
                                struct stat sb;
 
@@ -247,7 +247,7 @@
                                            strerror(errno));
                                        break;
                                }
-                               mapfileino(sb.st_ino, tapesize, &anydirskipped);
+                               mapfileino(sb.st_ino, tape_size, &anydirskipped);
                        }
                }
 
@@ -255,12 +255,12 @@
                 * Ensure that the root inode actually appears in the
                 * file list for a subdir
                 */
-               mapfileino(ROOTINO, tapesize, &anydirskipped);
+               mapfileino(ROOTINO, tape_size, &anydirskipped);
        } else {
                ino_t ino;
 
                for (ino = ROOTINO; ino < maxino; ino++) {
-                       mapfileino(ino, tapesize, &anydirskipped);
+                       mapfileino(ino, tape_size, &anydirskipped);
                }
        }
        /*
@@ -284,7 +284,7 @@
  * pass using this algorithm.
  */
 int
-mapdirs(ino_t maxino, long *tapesize)
+mapdirs(ino_t maxino, long *tape_size)
 {
        struct  dinode *dp, di;
        int i, isdir, nodump;
@@ -318,7 +318,7 @@
                        if (di.di_db[i] != 0)
                                ret |= searchdir(ino, iswap32(di.di_db[i]),
                                        (long)ufs_dblksize(ufsib, &di, i),
-                                       filesize, tapesize, nodump);



Home | Main Index | Thread Index | Old Index