]> git.wh0rd.org - dump.git/commitdiff
Fixed a lot of warnings in the code thanks to 'gcc -W'
authorStelian Pop <stelian@popies.net>
Fri, 19 Jul 2002 14:57:38 +0000 (14:57 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 19 Jul 2002 14:57:38 +0000 (14:57 +0000)
14 files changed:
CHANGES
THANKS
common/dumprmt.c
compat/include/bsdcompat.h
dump/main.c
dump/optr.c
dump/tape.c
dump/traverse.c
restore/dirs.c
restore/interactive.c
restore/main.c
restore/restore.c
restore/symtab.c
restore/tape.c

diff --git a/CHANGES b/CHANGES
index 0b2d3e1158578379120cda201a5a8dc754815f05..a8dde3a8c9ae2d9bee55c017b2626bc256eacf67 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.185 2002/07/17 10:18:52 stelian Exp $
+$Id: CHANGES,v 1.186 2002/07/19 14:57:38 stelian Exp $
 
 Changes between versions 0.4b29 and 0.4b30 (released ????????????????)
 ======================================================================
 
 Changes between versions 0.4b29 and 0.4b30 (released ????????????????)
 ======================================================================
@@ -28,7 +28,11 @@ Changes between versions 0.4b29 and 0.4b30 (released ????????????????)
        transparently support both inode formats, the change should
        have no side effects. Thanks to John Yu <jky@cs.bu.edu> for
        reporting the bug.
        transparently support both inode formats, the change should
        have no side effects. Thanks to John Yu <jky@cs.bu.edu> for
        reporting the bug.
-       
+
+6.     Fixed a lot of warnings in the code shown when compiling
+       with 'gcc -W'. Thanks to Matthias Andree 
+       <matthias.andree@stud.uni-dortmund.de> for reporting this.
+
 Changes between versions 0.4b28 and 0.4b29 (released June 8, 2002)
 ==================================================================
 
 Changes between versions 0.4b28 and 0.4b29 (released June 8, 2002)
 ==================================================================
 
diff --git a/THANKS b/THANKS
index 88da77faf13ee5f1d8881a83bfcb4152455208b3..34ed573d339595bf19056a8830ebfe488a245504 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.62 2002/07/01 11:54:39 stelian Exp $
+$Id: THANKS,v 1.63 2002/07/19 14:57:39 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -20,8 +20,9 @@ Stelian Pop <stelian@popies.net> is now the current maintainer (since dump-0.4b5
 Thanks to people who reported problems with the port, sent patches, and
 suggested various improvements.
 Here is a partial list of them (if I have forgotten someone, please complain):
 Thanks to people who reported problems with the port, sent patches, and
 suggested various improvements.
 Here is a partial list of them (if I have forgotten someone, please complain):
-Eros Albertazzi                eros@lamel.bo.cnr.it
 John Adams             johna@onevista.com
 John Adams             johna@onevista.com
+Eros Albertazzi                eros@lamel.bo.cnr.it
+Matthias Andree                matthias.andree@stud.uni-dortmund.de
 Andrea Arcangeli       andrea@suse.de
 Stephen Atwell         satwell@urbana.css.mot.com
 Gerd Bavendiek         bav@epost.de
 Andrea Arcangeli       andrea@suse.de
 Stephen Atwell         satwell@urbana.css.mot.com
 Gerd Bavendiek         bav@epost.de
index 129ce208c4c26d8ce9e82b5ec5a89f2caa1d9d60..69ada17ac0980df2139c6f6a1ccfa7604db4af89 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dumprmt.c,v 1.21 2002/05/21 15:48:46 stelian Exp $";
+       "$Id: dumprmt.c,v 1.22 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -132,7 +132,7 @@ rmthost(const char *host)
 }
 
 static void
 }
 
 static void
-rmtconnaborted(int signo)
+rmtconnaborted(UNUSED(int signo))
 {
        msg("Lost connection to remote host.\n");
        if (errfd != -1) {
 {
        msg("Lost connection to remote host.\n");
        if (errfd != -1) {
@@ -343,7 +343,7 @@ rmtstatus(void)
        if (rmtstate != TS_OPEN)
                return (NULL);
        rmtcall("status", "S\n");
        if (rmtstate != TS_OPEN)
                return (NULL);
        rmtcall("status", "S\n");
-       for (i = 0, cp = (char *)&mts; i < sizeof(mts); i++)
+       for (i = 0, cp = (char *)&mts; i < (int)sizeof(mts); i++)
                *cp++ = rmtgetb();
        return (&mts);
 }
                *cp++ = rmtgetb();
        return (&mts);
 }
@@ -363,7 +363,7 @@ static int
 rmtcall(const char *cmd, const char *buf)
 {
 
 rmtcall(const char *cmd, const char *buf)
 {
 
-       if (write(tormtape, buf, strlen(buf)) != strlen(buf))
+       if (write(tormtape, buf, strlen(buf)) != (ssize_t)strlen(buf))
                rmtconnaborted(0);
        return (rmtreply(cmd));
 }
                rmtconnaborted(0);
        return (rmtreply(cmd));
 }
index 8b8737877ef8605b02d7a40093f8d6353e62a75e..ecb102f4d9eceb097b6a2175a0be4f57fc13fc32 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: bsdcompat.h,v 1.18 2002/07/17 10:18:52 stelian Exp $
+ *     $Id: bsdcompat.h,v 1.19 2002/07/19 14:57:39 stelian Exp $
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -13,6 +13,7 @@
 #include <dirent.h>
 
 #define        __dead          volatile
 #include <dirent.h>
 
 #define        __dead          volatile
+#define UNUSED(x)      x __attribute__ ((unused))
 
 #ifndef        NBBY
 #define NBBY           8
 
 #ifndef        NBBY
 #define NBBY           8
index 3ef7bc1930aef7658892ad93cb92d6bdfdb46eec..d06c2fde3863fe2b1c98fe45a132835535a22e38 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.73 2002/07/17 10:18:52 stelian Exp $";
+       "$Id: main.c,v 1.74 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -879,10 +879,10 @@ main(int argc, char *argv[])
                /* print QFA-file header */
                snprintf(gTps, sizeof(gTps), "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION, (unsigned long)spcl.c_date);
                gTps[sizeof(gTps) - 1] = '\0';
                /* print QFA-file header */
                snprintf(gTps, sizeof(gTps), "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION, (unsigned long)spcl.c_date);
                gTps[sizeof(gTps) - 1] = '\0';
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        quit("can't write tapeposfile\n");
                sprintf(gTps, "ino\ttapeno\ttapepos\n");
                        quit("can't write tapeposfile\n");
                sprintf(gTps, "ino\ttapeno\ttapepos\n");
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        quit("can't write tapeposfile\n");
        }
 #endif /* USE_QFA */
                        quit("can't write tapeposfile\n");
        }
 #endif /* USE_QFA */
index a79462b24764c4f3aa42204e27ac5f5e36305949..81823a7865a0e7d26f6a9248ea87ca209c9ddbe2 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: optr.c,v 1.31 2002/02/04 11:18:45 stelian Exp $";
+       "$Id: optr.c,v 1.32 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -161,7 +161,7 @@ char lastmsg[BUFSIZ];
  *     sleep for 2 minutes in case nobody comes to satisfy dump
  */
 static void
  *     sleep for 2 minutes in case nobody comes to satisfy dump
  */
 static void
-alarmcatch(int signo)
+alarmcatch(UNUSED(int signo))
 {
        int save_errno = errno;
        if (notify == 0) {
 {
        int save_errno = errno;
        if (notify == 0) {
@@ -189,7 +189,7 @@ alarmcatch(int signo)
  *     Here if an inquisitive operator interrupts the dump program
  */
 void
  *     Here if an inquisitive operator interrupts the dump program
  */
 void
-interrupt(int signo)
+interrupt(UNUSED(int signo))
 {
        msg("Interrupt received.\n");
        if (query("Do you want to abort dump?"))
 {
        msg("Interrupt received.\n");
        if (query("Do you want to abort dump?"))
index c6161bedbec52d4863d00af48831f349ec474f0b..70c1d1d7f1de944af1a6f99f530b34f88fe90fd3 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.69 2002/07/01 11:54:40 stelian Exp $";
+       "$Id: tape.c,v 1.70 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -116,7 +116,11 @@ static int magtapeout;             /* output is really a tape */
 
 static ssize_t dump_atomic_read __P((int, void *, size_t));
 static ssize_t dump_atomic_write __P((int, const void *, size_t));
 
 static ssize_t dump_atomic_read __P((int, void *, size_t));
 static ssize_t dump_atomic_write __P((int, const void *, size_t));
+#ifdef WRITEDEBUG
 static void doslave __P((int, int, int));
 static void doslave __P((int, int, int));
+#else
+static void doslave __P((int, int));
+#endif
 static void enslave __P((void));
 static void flushtape __P((void));
 static void killall __P((void));
 static void enslave __P((void));
 static void flushtape __P((void));
 static void killall __P((void));
@@ -311,7 +315,7 @@ tperror(int errnum)
 }
 
 static void
 }
 
 static void
-sigpipe(int signo)
+sigpipe(UNUSED(int signo))
 {
 
        quit("Broken pipe\n");
 {
 
        quit("Broken pipe\n");
@@ -914,13 +918,13 @@ restore_check_point:
                if (tapeno > 1)
                        msg("Volume %d begins with blocks from inode %d\n",
                                tapeno, slp->inode);
                if (tapeno > 1)
                        msg("Volume %d begins with blocks from inode %d\n",
                                tapeno, slp->inode);
-               if (tapeno < TP_NINOS)
+               if (tapeno < (int)TP_NINOS)
                        volinfo[tapeno] = slp->inode;
        }
 }
 
 void
                        volinfo[tapeno] = slp->inode;
        }
 }
 
 void
-dumpabort(int signo)
+dumpabort(UNUSED(int signo))
 {
 
        if (master != 0 && master != getpid())
 {
 
        if (master != 0 && master != getpid())
@@ -950,7 +954,7 @@ Exit(int status)
  * proceed - handler for SIGUSR2, used to synchronize IO between the slaves.
  */
 static void
  * proceed - handler for SIGUSR2, used to synchronize IO between the slaves.
  */
 static void
-proceed(int signo)
+proceed(UNUSED(int signo))
 {
        if (ready)
                siglongjmp(jmpbuf, 1);
 {
        if (ready)
                siglongjmp(jmpbuf, 1);
@@ -1011,7 +1015,11 @@ enslave(void)
                            != sizeof i)
                                quit("master/slave protocol botched 3\n");
 #endif
                            != sizeof i)
                                quit("master/slave protocol botched 3\n");
 #endif
-                       doslave(cmd[0], i, (slaves[i].pid == slp->pid));
+                       doslave(cmd[0], 
+#ifdef WRITEDEBUG
+                               i, 
+#endif
+                               (slaves[i].pid == slp->pid));
                        Exit(X_FINOK);
                }
                else
                        Exit(X_FINOK);
                }
                else
@@ -1057,15 +1065,20 @@ killall(void)
  * slaves.
  */
 static void
  * slaves.
  */
 static void
-doslave(int cmd, int slave_number, int first)
+doslave(int cmd, 
+#ifdef WRITEDEBUG
+       int slave_number, 
+#endif
+       int first)
 {
        int nread;
 {
        int nread;
-       int nextslave, size, eot_count, bufsize;
-       volatile int wrote = 0;
-       char *buffer;
+       int nextslave;
+       volatile int wrote = 0, size, eot_count, bufsize;
+       char * volatile buffer;
 #if defined(HAVE_ZLIB) || defined(HAVE_BZLIB)
 #if defined(HAVE_ZLIB) || defined(HAVE_BZLIB)
-       struct tapebuf *comp_buf = NULL;
-       int compresult, do_compress = !first;
+       struct tapebuf * volatile comp_buf = NULL;
+       int compresult;
+       volatile int do_compress = !first;
        unsigned long worklen;
 #ifdef HAVE_BZLIB
        unsigned int worklen2;
        unsigned long worklen;
 #ifdef HAVE_BZLIB
        unsigned int worklen2;
@@ -1200,7 +1213,7 @@ doslave(int cmd, int slave_number, int first)
                        }
 
 #endif /* HAVE_BZLIB */
                        }
 
 #endif /* HAVE_BZLIB */
-                       if (compresult && worklen <= (writesize - 16)) {
+                       if (compresult && worklen <= ((unsigned long)writesize - 16)) {
                                /* write the compressed buffer */
                                comp_buf->length = worklen;
                                comp_buf->compressed = 1;
                                /* write the compressed buffer */
                                comp_buf->length = worklen;
                                comp_buf->compressed = 1;
@@ -1323,7 +1336,7 @@ dump_atomic_read(int fd, void *buf, size_t count)
                while ((got = read(fd, buf, need)) > 0 && (need -= got) > 0)
                        (char *)buf += got;
        } while (got == -1 && errno == EINTR);
                while ((got = read(fd, buf, need)) > 0 && (need -= got) > 0)
                        (char *)buf += got;
        } while (got == -1 && errno == EINTR);
-       return (got < 0 ? got : count - need);
+       return (got < 0 ? got : (ssize_t)count - need);
 }
 
 /*
 }
 
 /*
@@ -1340,7 +1353,7 @@ dump_atomic_write(int fd, const void *buf, size_t count)
                while ((got = write(fd, buf, need)) > 0 && (need -= got) > 0)
                        (char *)buf += got;
        } while (got == -1 && errno == EINTR);
                while ((got = write(fd, buf, need)) > 0 && (need -= got) > 0)
                        (char *)buf += got;
        } while (got == -1 && errno == EINTR);
-       return (got < 0 ? got : count - need);
+       return (got < 0 ? got : (ssize_t)count - need);
 }
 
 
 }
 
 
@@ -1393,7 +1406,7 @@ MkTapeString(struct s_spcl *spclptr, long long curtapepos) {
                 tapeno, 
                 curtapepos);
        gTps[sizeof(gTps) - 1] = '\0';
                 tapeno, 
                 curtapepos);
        gTps[sizeof(gTps) - 1] = '\0';
-       if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps)) {
+       if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps)) {
                warn("error writing tapepos file.\n");
        }
 }
                warn("error writing tapepos file.\n");
        }
 }
index bd16f9b7a696de34a607213a7e898b92b8973c67..6d4f00b3e910219257a3bd44ce6aff3b5997328c 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.48 2002/07/17 10:18:52 stelian Exp $";
+       "$Id: traverse.c,v 1.49 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #include <ctype.h>
 #include <stdio.h>
 #endif /* not lint */
 
 #include <config.h>
 #include <ctype.h>
 #include <stdio.h>
+#include <sys/types.h>
 #ifdef __STDC__
 #include <string.h>
 #include <unistd.h>
 #ifdef __STDC__
 #include <string.h>
 #include <unistd.h>
@@ -107,7 +108,7 @@ static      void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long *tapes
 #ifdef HAVE_EXT2_JOURNAL_INUM
 #define ext2_journal_ino(sb) (sb->s_journal_inum)
 #else
 #ifdef HAVE_EXT2_JOURNAL_INUM
 #define ext2_journal_ino(sb) (sb->s_journal_inum)
 #else
-#define ext2_journal_ino(sb) (*((__u32 *)sb + 0x38))
+#define ext2_journal_ino(sb) (*((u_int32_t *)sb + 0x38))
 #endif
 #ifndef HAVE_EXT2_INO_T
 typedef ino_t ext2_ino_t;
 #endif
 #ifndef HAVE_EXT2_INO_T
 typedef ino_t ext2_ino_t;
@@ -200,7 +201,7 @@ blockest(struct dinode const *dp)
        if (blkest > sizeest)
                blkest = sizeest;
 #ifdef __linux__
        if (blkest > sizeest)
                blkest = sizeest;
 #ifdef __linux__
-       if (i_size > fs->blocksize * NDADDR) {
+       if (i_size > (u_quad_t)fs->blocksize * NDADDR) {
                /* calculate the number of indirect blocks on the dump tape */
                blkest +=
                        howmany(sizeest - NDADDR * fs->blocksize / TP_BSIZE,
                /* calculate the number of indirect blocks on the dump tape */
                blkest +=
                        howmany(sizeest - NDADDR * fs->blocksize / TP_BSIZE,
@@ -234,7 +235,7 @@ blockest(struct dinode const *dp)
 
 /* The WANTTODUMP macro decides whether a file should be dumped. */
 #define        WANTTODUMP(dp, ino) \
 
 /* The WANTTODUMP macro decides whether a file should be dumped. */
 #define        WANTTODUMP(dp, ino) \
-       (CHANGEDSINCE(dp, spcl.c_ddate) && \
+       (CHANGEDSINCE(dp, ((u_int32_t)spcl.c_ddate)) && \
         (!NODUMP_FLAG(dp)) && \
         (!exclude_ino(ino)))
 
         (!NODUMP_FLAG(dp)) && \
         (!exclude_ino(ino)))
 
@@ -271,7 +272,7 @@ mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskip
                SETINO(ino, dumpdirmap);
        if (WANTTODUMP(dp, ino)) {
                SETINO(ino, dumpinomap);
                SETINO(ino, dumpdirmap);
        if (WANTTODUMP(dp, ino)) {
                SETINO(ino, dumpinomap);
-               if (!MSINCE(dp, spcl.c_ddate))
+               if (!MSINCE(dp, (u_int32_t)spcl.c_ddate))
                        SETINO(ino, metainomap);
                if (mode != IFREG && mode != IFDIR && mode != IFLNK)
                        *tapesize += 1;
                        SETINO(ino, metainomap);
                if (mode != IFREG && mode != IFDIR && mode != IFLNK)
                        *tapesize += 1;
@@ -295,7 +296,7 @@ mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskip
  */
 #ifdef __linux__
 int
  */
 #ifdef __linux__
 int
-mapfiles(dump_ino_t maxino, long *tapesize)
+mapfiles(UNUSED(dump_ino_t maxino), long *tapesize)
 {
        ext2_ino_t ino;
        int anydirskipped = 0;
 {
        ext2_ino_t ino;
        int anydirskipped = 0;
@@ -358,7 +359,7 @@ mapfiles(dump_ino_t maxino, long *tapesize)
 
 #ifdef __linux__
 int
 
 #ifdef __linux__
 int
-maponefile(dump_ino_t maxino, long *tapesize, char *directory)
+maponefile(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
 {
        errcode_t retval;
        ext2_ino_t dir_ino;
 {
        errcode_t retval;
        ext2_ino_t dir_ino;
@@ -368,7 +369,7 @@ maponefile(dump_ino_t maxino, long *tapesize, char *directory)
        /*
         * Mark every directory in the path as being dumped
         */
        /*
         * Mark every directory in the path as being dumped
         */
-       for (i = 0; i < strlen (directory); i++) {
+       for (i = 0; i < (int)strlen (directory); i++) {
                if (directory[i] == '/') {
                        strncpy (dir_name, directory, i);
                        dir_name[i] = '\0';
                if (directory[i] == '/') {
                        strncpy (dir_name, directory, i);
                        dir_name[i] = '\0';
@@ -411,7 +412,8 @@ struct mapfile_context {
 };
 
 static int
 };
 
 static int
-mapfilesindir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *private)
+mapfilesindir(struct ext2_dir_entry *dirent, UNUSED(int offset), 
+             UNUSED(int blocksize), UNUSED(char *buf), void *private)
 {
        struct dinode const *dp;
        int mode;
 {
        struct dinode const *dp;
        int mode;
@@ -447,7 +449,7 @@ mapfilesindir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *bu
  * the directories in the filesystem.
  */
 int
  * the directories in the filesystem.
  */
 int
-mapfilesfromdir(dump_ino_t maxino, long *tapesize, char *directory)
+mapfilesfromdir(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
 {
        errcode_t retval;
        struct mapfile_context mfc;
 {
        errcode_t retval;
        struct mapfile_context mfc;
@@ -458,7 +460,7 @@ mapfilesfromdir(dump_ino_t maxino, long *tapesize, char *directory)
        /*
         * Mark every directory in the path as being dumped
         */
        /*
         * Mark every directory in the path as being dumped
         */
-       for (i = 0; i < strlen (directory); i++) {
+       for (i = 0; i < (int)strlen (directory); i++) {
                if (directory[i] == '/') {
                        strncpy (dir_name, directory, i);
                        dir_name[i] = '\0';
                if (directory[i] == '/') {
                        strncpy (dir_name, directory, i);
                        dir_name[i] = '\0';
@@ -646,7 +648,8 @@ dirindir(dump_ino_t ino, daddr_t blkno, int ind_level, long *filesize)
  */
 #ifdef __linux__
 static int
  */
 #ifdef __linux__
 static int
-searchdir(struct ext2_dir_entry *dp, int offset, int blocksize, char *buf, void *private)
+searchdir(struct ext2_dir_entry *dp, UNUSED(int offset), 
+         UNUSED(int blocksize), UNUSED(char *buf), void *private)
 {
        struct mapdirs_context *mdc;
        int *ret;
 {
        struct mapdirs_context *mdc;
        int *ret;
@@ -749,8 +752,8 @@ struct block_context {
  * Dump a block to the tape
  */
 static int
  * Dump a block to the tape
  */
 static int
-dumponeblock(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt,
-            blk_t ref_block, int ref_offset, void * private)
+dumponeblock(UNUSED(ext2_filsys fs), blk_t *blocknr, e2_blkcnt_t blockcnt,
+            UNUSED(blk_t ref_block), UNUSED(int ref_offset), void * private)
 {
        struct block_context *p;
        int i;
 {
        struct block_context *p;
        int i;
@@ -901,7 +904,7 @@ dumpino(struct dinode *dp, dump_ino_t ino, int metaonly)
                msg("Warning: undefined file type 0%o\n", dp->di_mode & IFMT);
                return;
        }
                msg("Warning: undefined file type 0%o\n", dp->di_mode & IFMT);
                return;
        }
-       if (i_size > NDADDR * sblock->fs_bsize)
+       if (i_size > (u_quad_t)NDADDR * sblock->fs_bsize)
 #ifdef __linux__
                cnt = NDADDR * EXT2_FRAGS_PER_BLOCK(fs->super);
 #else
 #ifdef __linux__
                cnt = NDADDR * EXT2_FRAGS_PER_BLOCK(fs->super);
 #else
@@ -923,7 +926,7 @@ dumpino(struct dinode *dp, dump_ino_t ino, int metaonly)
        /* deal with holes at the end of the inode */
        if (i_size > ((u_quad_t)bc.next_block) * sblock->fs_fsize) {
                remaining = i_size - ((u_quad_t)bc.next_block) * sblock->fs_fsize;
        /* deal with holes at the end of the inode */
        if (i_size > ((u_quad_t)bc.next_block) * sblock->fs_fsize) {
                remaining = i_size - ((u_quad_t)bc.next_block) * sblock->fs_fsize;
-               for (i = 0; i < howmany(remaining, sblock->fs_fsize); i++) {
+               for (i = 0; i < (int)howmany(remaining, sblock->fs_fsize); i++) {
                        bc.buf[bc.cnt++] = 0;
                        if (bc.cnt == bc.max) {
                                blksout (bc.buf, bc.cnt, bc.ino);
                        bc.buf[bc.cnt++] = 0;
                        if (bc.cnt == bc.max) {
                                blksout (bc.buf, bc.cnt, bc.ino);
@@ -960,7 +963,8 @@ struct convert_dir_context {
  * size of the entry, and creates it in a temporary buffer
  */
 static int
  * size of the entry, and creates it in a temporary buffer
  */
 static int
-convert_dir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *private)
+convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), 
+           UNUSED(int blocksize), UNUSED(char *buf), void *private)
 {
        struct convert_dir_context *p;
        struct direct *dp;
 {
        struct convert_dir_context *p;
        struct direct *dp;
index bf1583be85fc9c4e79e8e54fe96217c3beb71496..228877733a4388fd90cb82c91315142ffd91790b 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.20 2002/06/25 19:00:38 stelian Exp $";
+       "$Id: dirs.c,v 1.21 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -276,7 +276,7 @@ treescan(char *pname, dump_ino_t ino, long (*todo) __P((char *, dump_ino_t, int)
         * skipping over "." and ".."
         */
        namelen = snprintf(locname, sizeof(locname), "%s/", pname);
         * skipping over "." and ".."
         */
        namelen = snprintf(locname, sizeof(locname), "%s/", pname);
-       if (namelen >= sizeof(locname))
+       if (namelen >= (int)sizeof(locname))
                namelen = sizeof(locname) - 1;
        rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
        dp = rst_readdir(dirp); /* "." */
                namelen = sizeof(locname) - 1;
        rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
        dp = rst_readdir(dirp); /* "." */
@@ -296,7 +296,7 @@ treescan(char *pname, dump_ino_t ino, long (*todo) __P((char *, dump_ino_t, int)
         */
        while (dp != NULL) {
                locname[namelen] = '\0';
         */
        while (dp != NULL) {
                locname[namelen] = '\0';
-               if (namelen + dp->d_namlen >= sizeof(locname)) {
+               if (namelen + dp->d_namlen >= (int)sizeof(locname)) {
                        fprintf(stderr, "%s%s: name exceeds %ld char\n",
                                locname, dp->d_name, (long)sizeof(locname) - 1);
                } else {
                        fprintf(stderr, "%s%s: name exceeds %ld char\n",
                                locname, dp->d_name, (long)sizeof(locname) - 1);
                } else {
@@ -381,7 +381,7 @@ putdir(char *buf, size_t size)
                                putent(&cvtbuf);
                        }
        } else {
                                putent(&cvtbuf);
                        }
        } else {
-               for (loc = 0; loc < size; ) {
+               for (loc = 0; loc < (long)size; ) {
                        dp = (struct direct *)(buf + loc);
 #ifdef DIRDEBUG
                        printf ("reclen = %d, namlen = %d, type = %d\n",
                        dp = (struct direct *)(buf + loc);
 #ifdef DIRDEBUG
                        printf ("reclen = %d, namlen = %d, type = %d\n",
index 1f00b2a022ebb43b60a02343835fd7f2e717a9f8..c1b8aa2a2a064821108ef69281768dbc3544e7e8 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: interactive.c,v 1.24 2002/06/08 07:10:37 stelian Exp $";
+       "$Id: interactive.c,v 1.25 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -510,7 +510,7 @@ canon(char *rawname, char *canonname, int len)
                (void) strcpy(canonname, ".");
        else
                (void) strcpy(canonname, "./");
                (void) strcpy(canonname, ".");
        else
                (void) strcpy(canonname, "./");
-       if (strlen(canonname) + strlen(rawname) >= len)
+       if (strlen(canonname) + strlen(rawname) >= (unsigned)len)
                errx(1, "canonname: not enough buffer space");
                
        (void) strcat(canonname, rawname);
                errx(1, "canonname: not enough buffer space");
                
        (void) strcat(canonname, rawname);
@@ -570,7 +570,7 @@ printlist(char *name, char *basename)
                list = &single;
                mkentry(name, dp, list);
                len = strlen(basename) + 1;
                list = &single;
                mkentry(name, dp, list);
                len = strlen(basename) + 1;
-               if (strlen(name) - len > single.len) {
+               if (strlen(name) - len > (unsigned)single.len) {
                        freename(single.fname);
                        single.fname = savename(&name[len]);
                        single.len = strlen(single.fname);
                        freename(single.fname);
                        single.fname = savename(&name[len]);
                        single.len = strlen(single.fname);
@@ -591,7 +591,7 @@ printlist(char *name, char *basename)
                entries = 0;
                listp = list;
                namelen = snprintf(locname, sizeof(locname), "%s/", name);
                entries = 0;
                listp = list;
                namelen = snprintf(locname, sizeof(locname), "%s/", name);
-               if (namelen >= sizeof(locname))
+               if (namelen >= (int)sizeof(locname))
                        namelen = sizeof(locname) - 1;
                while ((dp = rst_readdir(dirp))) {
                        if (dp == NULL)
                        namelen = sizeof(locname) - 1;
                while ((dp = rst_readdir(dirp))) {
                        if (dp == NULL)
@@ -709,7 +709,7 @@ formatf(struct afile *list, int nentry)
        bigino = ROOTINO;
        endlist = &list[nentry];
        for (fp = &list[0]; fp < endlist; fp++) {
        bigino = ROOTINO;
        endlist = &list[nentry];
        for (fp = &list[0]; fp < endlist; fp++) {
-               if (bigino < fp->fnum)
+               if (bigino < (int)fp->fnum)
                        bigino = fp->fnum;
                if (width < fp->len)
                        width = fp->len;
                        bigino = fp->fnum;
                if (width < fp->len)
                        width = fp->len;
@@ -822,7 +822,7 @@ fcmp(const void *f1, const void *f2)
  * respond to interrupts
  */
 void
  * respond to interrupts
  */
 void
-onintr(int signo)
+onintr(UNUSED(int signo))
 {
        int save_errno = errno;
 
 {
        int save_errno = errno;
 
@@ -1010,7 +1010,7 @@ filename_generator(const char *text, int state)
 }
 
 static char **
 }
 
 static char **
-restore_completion (const char *text, int start, int end)
+restore_completion (const char *text, int start, UNUSED(int end))
 {
        char **matches;
 
 {
        char **matches;
 
index 2f2db7a192c832aae6683f15246884f266eb98e6..723a88f00ebf98348fb626b8b7569df99d343faf 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.40 2002/06/08 07:10:37 stelian Exp $";
+       "$Id: main.c,v 1.41 2002/07/19 14:57:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -554,10 +554,10 @@ main(int argc, char *argv[])
                        errx(1, "can't create tapeposfile\n");
                /* print QFA-file header */
                sprintf(gTps, "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION,(unsigned long)spcl.c_date);
                        errx(1, "can't create tapeposfile\n");
                /* print QFA-file header */
                sprintf(gTps, "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION,(unsigned long)spcl.c_date);
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        errx(1, "can't write tapeposfile\n");
                sprintf(gTps, "ino\ttapeno\ttapepos\n");
                        errx(1, "can't write tapeposfile\n");
                sprintf(gTps, "ino\ttapeno\ttapepos\n");
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        errx(1, "can't write tapeposfile\n");
 
                extractdirs(1);
                        errx(1, "can't write tapeposfile\n");
 
                extractdirs(1);
index 854c3fcd392a9880807c8173bb8e12e4c954c13f..7c897eceeb4301a1380b8a2c1f9359fdc2f42aec 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: restore.c,v 1.29 2002/04/04 08:20:23 stelian Exp $";
+       "$Id: restore.c,v 1.30 2002/07/19 14:57:40 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -159,7 +159,7 @@ addfile(char *name, dump_ino_t ino, int type)
  */
 /* ARGSUSED */
 long
  */
 /* ARGSUSED */
 long
-deletefile(char *name, dump_ino_t ino, int type)
+deletefile(char *name, dump_ino_t ino, UNUSED(int type))
 {
        long descend = hflag ? GOOD : FAIL;
        struct entry *ep;
 {
        long descend = hflag ? GOOD : FAIL;
        struct entry *ep;
@@ -951,7 +951,7 @@ createfiles(void)
                        if (volinfo[1] == ROOTINO) {
                                int i, goodvol = 1;
 
                        if (volinfo[1] == ROOTINO) {
                                int i, goodvol = 1;
 
-                               for (i = 1; i < TP_NINOS && volinfo[i] != 0; ++i)
+                               for (i = 1; i < (int)TP_NINOS && volinfo[i] != 0; ++i)
                                        if (volinfo[i] < next)
                                                goodvol = i;
 
                                        if (volinfo[i] < next)
                                                goodvol = i;
 
@@ -1023,7 +1023,7 @@ createfiles(void)
                                msg("inode %ld at tapepos %ld\n", curfile.ino, curtapepos);
 #endif
                                sprintf(gTps, "%ld\t%ld\t%lld\n", (unsigned long)curfile.ino, volno, curtapepos);
                                msg("inode %ld at tapepos %ld\n", curfile.ino, curtapepos);
 #endif
                                sprintf(gTps, "%ld\t%ld\t%lld\n", (unsigned long)curfile.ino, volno, curtapepos);
-                               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+                               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                                        warn("error writing tapepos file.\n");
                                skipfile();
                        }
                                        warn("error writing tapepos file.\n");
                                skipfile();
                        }
index 99312acaeb83a3172d4ebabd41933bab690a78a1..96dee35b32ef44d5d10b898ec6fae81b0d36b52b 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: symtab.c,v 1.18 2002/01/25 15:09:00 stelian Exp $";
+       "$Id: symtab.c,v 1.19 2002/07/19 14:57:40 stelian Exp $";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -518,7 +518,7 @@ dumpsymtable(char *filename, long checkpt)
        /*
         * Convert entry pointers to indexes, and output
         */
        /*
         * Convert entry pointers to indexes, and output
         */
-       for (i = 0; i < entrytblsize; i++) {
+       for (i = 0; (long)i < entrytblsize; i++) {
                if (entry[i] == NULL)
                        tentry = NULL;
                else
                if (entry[i] == NULL)
                        tentry = NULL;
                else
index 558e8f3680a9ecbacdf0cf2e196cb197d25da2d4..b9d0b02635f2c9d3629083a38ce4d3e2bfb30c07 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.62 2002/05/21 15:48:46 stelian Exp $";
+       "$Id: tape.c,v 1.63 2002/07/19 14:57:40 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -334,7 +334,7 @@ setup(void)
        if (vflag || command == 't' || command == 'C')
                printdumpinfo();
 #ifdef USE_QFA
        if (vflag || command == 't' || command == 'C')
                printdumpinfo();
 #ifdef USE_QFA
-       if (tapeposflag && spcl.c_date != qfadumpdate)
+       if (tapeposflag && (unsigned long)spcl.c_date != qfadumpdate)
                errx(1, "different QFA/dumpdates detected\n");
 #endif
        if (filesys[0] == '\0') {
                errx(1, "different QFA/dumpdates detected\n");
 #endif
        if (filesys[0] == '\0') {
@@ -705,7 +705,7 @@ printvolinfo(void)
 
        if (volinfo[1] == ROOTINO) {
                printf("Starting inode numbers by volume:\n");
 
        if (volinfo[1] == ROOTINO) {
                printf("Starting inode numbers by volume:\n");
-               for (i = 1; i < TP_NINOS && volinfo[i] != 0; ++i)
+               for (i = 1; i < (int)TP_NINOS && volinfo[i] != 0; ++i)
                        printf("\tVolume %d: %lu\n", i, (unsigned long)volinfo[i]);
        }
 }
                        printf("\tVolume %d: %lu\n", i, (unsigned long)volinfo[i]);
        }
 }
@@ -1020,7 +1020,7 @@ xtrfile(char *buf, size_t size)
  */
 /* ARGSUSED */
 static void
  */
 /* ARGSUSED */
 static void
-xtrskip(char *buf, size_t size)
+xtrskip(UNUSED(char *buf), size_t size)
 {
 
        if (LSEEK(ofile, (off_t)size, SEEK_CUR) == -1)
 {
 
        if (LSEEK(ofile, (off_t)size, SEEK_CUR) == -1)
@@ -1047,7 +1047,7 @@ xtrlnkfile(char *buf, size_t size)
  */
 /* ARGSUSED */
 static void
  */
 /* ARGSUSED */
 static void
-xtrlnkskip(char *buf, size_t size)
+xtrlnkskip(UNUSED(char *buf), UNUSED(size_t size))
 {
 
        errx(1, "unallocated block in symbolic link %s", curfile.name);
 {
 
        errx(1, "unallocated block in symbolic link %s", curfile.name);
@@ -1069,7 +1069,7 @@ xtrmap(char *buf, size_t size)
  */
 /* ARGSUSED */
 static void
  */
 /* ARGSUSED */
 static void
-xtrmapskip(char *buf, size_t size)
+xtrmapskip(UNUSED(char *buf), size_t size)
 {
 
        panic("hole in map\n");
 {
 
        panic("hole in map\n");
@@ -1081,7 +1081,7 @@ xtrmapskip(char *buf, size_t size)
  */
 /* ARGSUSED */
 void
  */
 /* ARGSUSED */
 void
-xtrnull(char *buf, size_t size)
+xtrnull(UNUSED(char *buf), UNUSED(size_t size))
 {
 
        return;
 {
 
        return;
@@ -1099,7 +1099,7 @@ xtrcmpfile(char *buf, size_t size)
        if (cmperror)
                return;
        
        if (cmperror)
                return;
        
-       if (read(ifile, cmpbuf, size) != size) {
+       if (read(ifile, cmpbuf, size) != (ssize_t)size) {
                fprintf(stderr, "%s: size has changed.\n", 
                        curfile.name);
                cmperror = 1;
                fprintf(stderr, "%s: size has changed.\n", 
                        curfile.name);
                cmperror = 1;
@@ -1118,7 +1118,7 @@ xtrcmpfile(char *buf, size_t size)
  * Skip over a hole in a file.
  */
 static void
  * Skip over a hole in a file.
  */
 static void
-xtrcmpskip(char *buf, size_t size)
+xtrcmpskip(UNUSED(char *buf), size_t size)
 {
        static char cmpbuf[MAXBSIZE];
        int i;
 {
        static char cmpbuf[MAXBSIZE];
        int i;
@@ -1126,14 +1126,14 @@ xtrcmpskip(char *buf, size_t size)
        if (cmperror)
                return;
        
        if (cmperror)
                return;
        
-       if (read(ifile, cmpbuf, size) != size) {
+       if (read(ifile, cmpbuf, size) != (ssize_t)size) {
                fprintf(stderr, "%s: size has changed.\n", 
                        curfile.name);
                cmperror = 1;
                return;
        }
 
                fprintf(stderr, "%s: size has changed.\n", 
                        curfile.name);
                cmperror = 1;
                return;
        }
 
-       for (i = 0; i < size; ++i)
+       for (i = 0; i < (int)size; ++i)
                if (cmpbuf[i] != '\0') {
                        fprintf(stderr, "%s: tape and disk copies are different\n",
                                curfile.name);
                if (cmpbuf[i] != '\0') {
                        fprintf(stderr, "%s: tape and disk copies are different\n",
                                curfile.name);
@@ -1262,7 +1262,7 @@ static char tmpfilename[MAXPATHLEN];
 void
 comparefile(char *name)
 {
 void
 comparefile(char *name)
 {
-       int mode;
+       unsigned int mode;
        struct STAT sb;
        int r;
 #if !COMPARE_ONTHEFLY
        struct STAT sb;
        int r;
 #if !COMPARE_ONTHEFLY
@@ -1352,7 +1352,7 @@ comparefile(char *name)
                        return;
                }
 
                        return;
                }
 
-               if (sb.st_rdev != (int)curfile.dip->di_rdev) {
+               if (sb.st_rdev != (dev_t)curfile.dip->di_rdev) {
                        fprintf(stderr,
                                "%s: device changed from %d,%d to %d,%d.\n",
                                name,
                        fprintf(stderr,
                                "%s: device changed from %d,%d to %d,%d.\n",
                                name,
@@ -1614,7 +1614,7 @@ readtape_comprfile(char *buf)
        /* read the block prefix */
        ret = read_a_block(mt, tapebuf, PREFIXSIZE, &rl);
 
        /* read the block prefix */
        ret = read_a_block(mt, tapebuf, PREFIXSIZE, &rl);
 
-       if (Vflag && (ret == 0 || rl < PREFIXSIZE  ||  tpb->length == 0))
+       if (Vflag && (ret == 0 || rl < (int)PREFIXSIZE  ||  tpb->length == 0))
                ret = 0;
        if (ret <= 0)
                goto readerr;
                ret = 0;
        if (ret <= 0)
                goto readerr;
@@ -1781,10 +1781,10 @@ decompress_tapebuf(struct tapebuf *tpbin, int readsize)
        
        /* build a length error message */
        blocklen = tpbin->length;
        
        /* build a length error message */
        blocklen = tpbin->length;
-       if (readsize < blocklen + PREFIXSIZE)
+       if (readsize < blocklen + (int)PREFIXSIZE)
                lengtherr = "short";
        else
                lengtherr = "short";
        else
-               if (readsize > blocklen + PREFIXSIZE)
+               if (readsize > blocklen + (int)PREFIXSIZE)
                        lengtherr = "long";
 
        worklen = comprlen;
                        lengtherr = "long";
 
        worklen = comprlen;
@@ -1954,7 +1954,7 @@ findtapeblksize(void)
                        len = bufsize - TP_BSIZE;
                }
                if (read_a_block(mt, tapebuf+TP_BSIZE, len, &i) < 0
                        len = bufsize - TP_BSIZE;
                }
                if (read_a_block(mt, tapebuf+TP_BSIZE, len, &i) < 0
-                   || (i != len && i % TP_BSIZE != 0))
+                   || (i != (long)len && i % TP_BSIZE != 0))
                        errx(1,"Error reading dump file header");
                tbufptr = tapebuf;
                numtrec = ntrec;
                        errx(1,"Error reading dump file header");
                tbufptr = tapebuf;
                numtrec = ntrec;