From 72dcf6e5b05b24084ab39438048baab9782fa05c Mon Sep 17 00:00:00 2001 From: pavalos Date: Sat, 21 Oct 2006 04:10:02 +0000 Subject: [PATCH] Add some casts to bring us up to WARNS2. This is almost WARNS6 except for 1 warning coming from the dblksize macro in . --- sbin/dump/Makefile | 4 ++-- sbin/dump/cache.c | 4 ++-- sbin/dump/itime.c | 4 ++-- sbin/dump/main.c | 6 +++--- sbin/dump/traverse.c | 13 +++++++------ 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sbin/dump/Makefile b/sbin/dump/Makefile index 469b514f69..9cb8bab76e 100644 --- a/sbin/dump/Makefile +++ b/sbin/dump/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD: src/sbin/dump/Makefile,v 1.12.2.4 2003/01/25 18:54:59 dillon Exp $ -# $DragonFly: src/sbin/dump/Makefile,v 1.5 2006/10/17 00:55:39 pavalos Exp $ +# $DragonFly: src/sbin/dump/Makefile,v 1.6 2006/10/21 04:10:02 pavalos Exp $ # dump.h header file # itime.c reads /etc/dumpdates @@ -21,6 +21,6 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rlogind SRCS= itime.c main.c optr.c dumprmt.c tape.c traverse.c unctime.c cache.c MAN= dump.8 MLINKS+=dump.8 rdump.8 -WARNS?= 0 +WARNS?= 2 .include diff --git a/sbin/dump/cache.c b/sbin/dump/cache.c index 51a82d92b9..ef5126b941 100644 --- a/sbin/dump/cache.c +++ b/sbin/dump/cache.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/dump/cache.c,v 1.1.2.1 2003/01/25 18:54:59 dillon Exp $ - * $DragonFly: src/sbin/dump/cache.c,v 1.4 2005/02/24 19:45:17 dillon Exp $ + * $DragonFly: src/sbin/dump/cache.c,v 1.5 2006/10/21 04:10:02 pavalos Exp $ */ /* * Block cache for dump @@ -136,7 +136,7 @@ cread(int fd, void *buf, size_t nbytes, off_t offset) * one-time calls and caching would be detrimental. */ mask = ~(off_t)(BlockSize - 1); - if (nbytes >= BlockSize || + if (nbytes >= (unsigned)BlockSize || ((offset ^ (offset + nbytes - 1)) & mask) != 0) { return(pread(fd, buf, nbytes, offset)); } diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index ce1242bdb6..10444d97e5 100644 --- a/sbin/dump/itime.c +++ b/sbin/dump/itime.c @@ -32,7 +32,7 @@ * * @(#)itime.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dump/itime.c,v 1.3.2.1 2001/08/01 06:29:35 obrien Exp $ - * $DragonFly: src/sbin/dump/itime.c,v 1.10 2006/04/03 01:58:48 dillon Exp $ + * $DragonFly: src/sbin/dump/itime.c,v 1.11 2006/10/21 04:10:02 pavalos Exp $ */ #include @@ -208,7 +208,7 @@ putdumptime(void) quit("ftruncate (%s): %s\n", dumpdates, strerror(errno)); fclose(df); msg("level %c dump on %s", level, - spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date)); + spcl.c_date == 0 ? "the epoch\n" : ctime((const time_t *)&spcl.c_date)); } static void diff --git a/sbin/dump/main.c b/sbin/dump/main.c index e05a7f9633..461f242be9 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/main.c,v 1.20.2.9 2003/01/25 18:54:59 dillon Exp $ - * $DragonFly: src/sbin/dump/main.c,v 1.14 2006/04/03 01:58:48 dillon Exp $ + * $DragonFly: src/sbin/dump/main.c,v 1.15 2006/10/21 04:10:02 pavalos Exp $ */ #include @@ -316,9 +316,9 @@ main(int argc, char **argv) getdumptime(); /* /etc/dumpdates snarfed */ msg("Date of this level %c dump: %s", level, - spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date)); + spcl.c_date == 0 ? "the epoch\n" : ctime((const time_t *)&spcl.c_date)); msg("Date of last level %c dump: %s", lastlevel, - spcl.c_ddate == 0 ? "the epoch\n" : ctime(&spcl.c_ddate)); + spcl.c_ddate == 0 ? "the epoch\n" : ctime((const time_t *)&spcl.c_ddate)); msg("Dumping %s ", disk); if (dt != NULL) msgtail("(%s) ", dt->fs_file); diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 6aedc679d3..cecc6a5a09 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -32,7 +32,7 @@ * * @(#)traverse.c 8.7 (Berkeley) 6/15/95 * $FreeBSD: src/sbin/dump/traverse.c,v 1.10.2.6 2003/04/14 20:10:35 johan Exp $ - * $DragonFly: src/sbin/dump/traverse.c,v 1.14 2006/04/03 01:58:48 dillon Exp $ + * $DragonFly: src/sbin/dump/traverse.c,v 1.15 2006/10/21 04:10:02 pavalos Exp $ */ #include @@ -104,7 +104,7 @@ blockest(struct ufs1_dinode *dp) sizeest = howmany(dp->di_size, TP_BSIZE); if (blkest > sizeest) blkest = sizeest; - if (dp->di_size > sblock->fs_bsize * NDADDR) { + if (dp->di_size > (unsigned)sblock->fs_bsize * NDADDR) { /* calculate the number of indirect blocks on the dump tape */ blkest += howmany(sizeest - NDADDR * sblock->fs_bsize / TP_BSIZE, @@ -192,7 +192,8 @@ int mapdirs(ufs1_ino_t maxino, long *tape_size) { struct ufs1_dinode *dp; - int i, isdir, nodump; + int isdir, nodump; + unsigned int i; char *map; ufs1_ino_t ino; struct ufs1_dinode di; @@ -390,7 +391,7 @@ dumpino(struct ufs1_dinode *dp, ufs1_ino_t ino) */ #ifdef FS_44INODEFMT if (dp->di_size > 0 && - dp->di_size < sblock->fs_maxsymlinklen) { + dp->di_size < (unsigned)sblock->fs_maxsymlinklen) { spcl.c_addr[0] = 1; spcl.c_count = 1; writeheader(ino); @@ -419,7 +420,7 @@ dumpino(struct ufs1_dinode *dp, ufs1_ino_t ino) msg("Warning: undefined file type 0%o\n", dp->di_mode & IFMT); return; } - if (dp->di_size > NDADDR * sblock->fs_bsize) + if (dp->di_size > NDADDR * (unsigned)sblock->fs_bsize) cnt = NDADDR * sblock->fs_frag; else cnt = howmany(dp->di_size, sblock->fs_fsize); @@ -545,7 +546,7 @@ getino(ufs1_ino_t inum) static struct ufs1_dinode inoblock[MAXINOPB]; curino = inum; - if (inum >= minino && inum < maxino) + if (inum >= (unsigned)minino && inum < (unsigned)maxino) return (&inoblock[inum - minino]); bread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), (char *)inoblock, (int)sblock->fs_bsize); -- 2.11.4.GIT