Module Name:    src
Committed By:   christos
Date:           Thu Apr 19 17:28:26 UTC 2012

Modified Files:
        src/usr.sbin/makefs: Makefile chfs.c ffs.c walk.c
        src/usr.sbin/makefs/cd9660: cd9660_eltorito.c
        src/usr.sbin/makefs/chfs: chfs_mkfs.c
        src/usr.sbin/makefs/ffs: ffs_alloc.c mkfs.c
        src/usr.sbin/makefs/v7fs: v7fs_estimate.c

Log Message:
WARNS=5


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/makefs/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/chfs.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/makefs/walk.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/chfs/chfs_mkfs.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/makefs/ffs/ffs_alloc.c
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/makefs/ffs/mkfs.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/v7fs/v7fs_estimate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/Makefile
diff -u src/usr.sbin/makefs/Makefile:1.30 src/usr.sbin/makefs/Makefile:1.31
--- src/usr.sbin/makefs/Makefile:1.30	Thu Apr 19 11:36:06 2012
+++ src/usr.sbin/makefs/Makefile	Thu Apr 19 13:28:25 2012
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.30 2012/04/19 15:36:06 ttoth Exp $
+#	$NetBSD: Makefile,v 1.31 2012/04/19 17:28:25 christos Exp $
 #
 
-WARNS?=	3	# XXX -Wsign-compare
+WARNS?=	5
 
 .include <bsd.own.mk>
 

Index: src/usr.sbin/makefs/chfs.c
diff -u src/usr.sbin/makefs/chfs.c:1.2 src/usr.sbin/makefs/chfs.c:1.3
--- src/usr.sbin/makefs/chfs.c:1.2	Thu Apr 19 13:09:53 2012
+++ src/usr.sbin/makefs/chfs.c	Thu Apr 19 13:28:25 2012
@@ -98,7 +98,6 @@ chfs_parse_opts(const char *option, fsin
 	}
 	*val++ = '\0';
 
-/*###101 [cc] error: passing argument 1 of 'set_option' discards qualifiers from pointer target type%%%*/
 	retval = set_option(chfs_options, var, val);
 	
 leave_chfs_parse_opts:
@@ -217,8 +216,8 @@ chfs_populate_dir(const char *dir, fsnod
 		if (cur->child == NULL) {
 			continue;
 		}
-		if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name)
-		    >= sizeof(path)) {
+		if ((size_t)snprintf(path, sizeof(path), "%s/%s", dir,
+		    cur->name) >= sizeof(path)) {
 			errx(EXIT_FAILURE, "Pathname too long");
 		}
 		if (!chfs_populate_dir(path, cur->child, cur, fsopts)) {

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.46 src/usr.sbin/makefs/ffs.c:1.47
--- src/usr.sbin/makefs/ffs.c:1.46	Fri Jan 27 21:35:46 2012
+++ src/usr.sbin/makefs/ffs.c	Thu Apr 19 13:28:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.46 2012/01/28 02:35:46 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.47 2012/04/19 17:28:25 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.46 2012/01/28 02:35:46 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.47 2012/04/19 17:28:25 christos Exp $");
 #endif	/* !__lint */
 
 #include <sys/param.h>
@@ -536,7 +536,7 @@ ffs_create_image(const char *image, fsin
 		    (long long)fs->fs_cstotal.cs_ndir);
 	}
 
-	if (fs->fs_cstotal.cs_nifree + ROOTINO < fsopts->inodes) {
+	if ((off_t)(fs->fs_cstotal.cs_nifree + ROOTINO) < fsopts->inodes) {
 		warnx(
 		"Image file `%s' has %lld free inodes; %lld are required.",
 		    image,
@@ -603,7 +603,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso
 			if (node->type == S_IFREG)
 				ADDSIZE(node->inode->st.st_size);
 			if (node->type == S_IFLNK) {
-				int	slen;
+				size_t	slen;
 
 				slen = strlen(node->symlink) + 1;
 				if (slen >= (ffs_opts->version == 1 ?
@@ -626,7 +626,7 @@ static void *
 ffs_build_dinode1(struct ufs1_dinode *dinp, dirbuf_t *dbufp, fsnode *cur,
 		 fsnode *root, fsinfo_t *fsopts)
 {
-	int slen;
+	size_t slen;
 	void *membuf;
 
 	memset(dinp, 0, sizeof(*dinp));
@@ -674,7 +674,7 @@ static void *
 ffs_build_dinode2(struct ufs2_dinode *dinp, dirbuf_t *dbufp, fsnode *cur,
 		 fsnode *root, fsinfo_t *fsopts)
 {
-	int slen;
+	size_t slen;
 	void *membuf;
 
 	memset(dinp, 0, sizeof(*dinp));
@@ -825,8 +825,8 @@ ffs_populate_dir(const char *dir, fsnode
 	for (cur = root; cur != NULL; cur = cur->next) {
 		if (cur->child == NULL)
 			continue;
-		if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name)
-		    >= sizeof(path))
+		if ((size_t)snprintf(path, sizeof(path), "%s/%s", dir,
+		    cur->name) >= sizeof(path))
 			errx(1, "Pathname too long.");
 		if (! ffs_populate_dir(path, cur->child, fsopts))
 			return (0);
@@ -1047,7 +1047,7 @@ ffs_write_inode(union dinode *dp, uint32
 	int		cg, cgino, i;
 	daddr_t		d;
 	char		sbbuf[FFS_MAXBSIZE];
-	int32_t		initediblk;
+	uint32_t	initediblk;
 	ffs_opt_t	*ffs_opts = fsopts->fs_specific;
 
 	assert (dp != NULL);
@@ -1098,7 +1098,8 @@ ffs_write_inode(union dinode *dp, uint32
 	 * Initialize inode blocks on the fly for UFS2.
 	 */
 	initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap);
-	if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk &&
+	if (ffs_opts->version == 2 &&
+	    (uint32_t)(cgino + INOPB(fs)) > initediblk &&
 	    initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
 		memset(buf, 0, fs->fs_bsize);
 		dip = (struct ufs2_dinode *)buf;

Index: src/usr.sbin/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.25 src/usr.sbin/makefs/walk.c:1.26
--- src/usr.sbin/makefs/walk.c:1.25	Fri Jan 27 21:35:46 2012
+++ src/usr.sbin/makefs/walk.c	Thu Apr 19 13:28:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.25 2012/01/28 02:35:46 christos Exp $	*/
+/*	$NetBSD: walk.c,v 1.26 2012/04/19 17:28:25 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.25 2012/01/28 02:35:46 christos Exp $");
+__RCSID("$NetBSD: walk.c,v 1.26 2012/04/19 17:28:25 christos Exp $");
 #endif	/* !__lint */
 
 #include <sys/param.h>
@@ -387,7 +387,7 @@ apply_specdir(const char *dir, NODE *spe
 			if (strcmp(curnode->name, curfsnode->name) == 0)
 				break;
 		}
-		if (snprintf(path, sizeof(path), "%s/%s",
+		if ((size_t)snprintf(path, sizeof(path), "%s/%s",
 		    dir, curnode->name) >= sizeof(path))
 			errx(1, "Pathname too long.");
 		if (curfsnode == NULL) {	/* need new entry */

Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.18 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.19
--- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.18	Mon Apr  2 15:01:21 2012
+++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Thu Apr 19 13:28:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.c,v 1.18 2012/04/02 19:01:21 christos Exp $	*/
+/*	$NetBSD: cd9660_eltorito.c,v 1.19 2012/04/19 17:28:25 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_eltorito.c,v 1.18 2012/04/02 19:01:21 christos Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.19 2012/04/19 17:28:25 christos Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -244,7 +244,7 @@ cd9660_boot_setup_validation_entry(char 
 	boot_catalog_validation_entry *ve;
 	int16_t checksum;
 	unsigned char *csptr;
-	int i;
+	size_t i;
 	entry = cd9660_init_boot_catalog_entry();
 
 	if (entry == NULL) {

Index: src/usr.sbin/makefs/chfs/chfs_mkfs.c
diff -u src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.2 src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.3
--- src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.2	Thu Apr 19 13:09:53 2012
+++ src/usr.sbin/makefs/chfs/chfs_mkfs.c	Thu Apr 19 13:28:26 2012
@@ -100,7 +100,8 @@ padword(fsinfo_t *fsopts)
 static void
 pad_block_if_less_than(fsinfo_t *fsopts, int req)
 {
-	if ((img_ofs % chfs_opts.eraseblock) + req > chfs_opts.eraseblock) {
+	if ((img_ofs % chfs_opts.eraseblock) + req >
+	    (uint32_t)chfs_opts.eraseblock) {
 		padblock(fsopts);
 		write_eb_header(fsopts);
 	}
@@ -117,7 +118,7 @@ write_eb_header(fsinfo_t *fsopts)
 
 #define MINSIZE MAX(MAX(CHFS_EB_EC_HDR_SIZE, CHFS_EB_HDR_NOR_SIZE), \
     CHFS_EB_HDR_NAND_SIZE)
-	if (opts->pagesize < MINSIZE)
+	if ((uint32_t)opts->pagesize < MINSIZE)
 		errx(EXIT_FAILURE, "pagesize cannot be less than %zu", MINSIZE);
 	if ((buf = malloc(opts->pagesize)) == NULL)
 		err(EXIT_FAILURE, "Memory allocation failed");

Index: src/usr.sbin/makefs/ffs/ffs_alloc.c
diff -u src/usr.sbin/makefs/ffs/ffs_alloc.c:1.18 src/usr.sbin/makefs/ffs/ffs_alloc.c:1.19
--- src/usr.sbin/makefs/ffs/ffs_alloc.c:1.18	Sun Mar  6 12:08:42 2011
+++ src/usr.sbin/makefs/ffs/ffs_alloc.c	Thu Apr 19 13:28:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.18 2011/03/06 17:08:42 bouyer Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.19 2012/04/19 17:28:26 christos Exp $	*/
 /* From: NetBSD: ffs_alloc.c,v 1.50 2001/09/06 02:16:01 lukem Exp */
 
 /*
@@ -47,7 +47,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs_alloc.c,v 1.18 2011/03/06 17:08:42 bouyer Exp $");
+__RCSID("$NetBSD: ffs_alloc.c,v 1.19 2012/04/19 17:28:26 christos Exp $");
 #endif	/* !__lint */
 
 #include <sys/param.h>
@@ -106,7 +106,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn 
 	int cg;
 	
 	*bnp = 0;
-	if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
+	if (size > fs->fs_bsize || fragoff(fs, size) != 0) {
 		errx(1, "ffs_alloc: bad size: bsize %d size %d",
 		    fs->fs_bsize, size);
 	}
@@ -195,11 +195,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr
 }
 
 daddr_t
-ffs_blkpref_ufs2(ip, lbn, indx, bap)
-	struct inode *ip;
-	daddr_t lbn;
-	int indx;
-	int64_t *bap;
+ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap)
 {
 	struct fs *fs;
 	int cg;
@@ -444,7 +440,7 @@ ffs_blkfree(struct inode *ip, daddr_t bn
 	struct fs *fs = ip->i_fs;
 	const int needswap = UFS_FSNEEDSWAP(fs);
 
-	if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
+	if (size > fs->fs_bsize || fragoff(fs, size) != 0 ||
 	    fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) {
 		errx(1, "blkfree: bad size: bno %lld bsize %d size %ld",
 		    (long long)bno, fs->fs_bsize, size);

Index: src/usr.sbin/makefs/ffs/mkfs.c
diff -u src/usr.sbin/makefs/ffs/mkfs.c:1.22 src/usr.sbin/makefs/ffs/mkfs.c:1.23
--- src/usr.sbin/makefs/ffs/mkfs.c:1.22	Sun Oct  9 17:33:43 2011
+++ src/usr.sbin/makefs/ffs/mkfs.c	Thu Apr 19 13:28:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.22 2011/10/09 21:33:43 christos Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.23 2012/04/19 17:28:26 christos Exp $	*/
 
 /*
  * Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -48,7 +48,7 @@
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
 #ifdef __RCSID
-__RCSID("$NetBSD: mkfs.c,v 1.22 2011/10/09 21:33:43 christos Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.23 2012/04/19 17:28:26 christos Exp $");
 #endif
 #endif
 #endif /* not lint */
@@ -599,7 +599,7 @@ static void
 initcg(int cylno, time_t utime, const fsinfo_t *fsopts)
 {
 	daddr_t cbase, dmax;
-	int32_t i, j, d, dlower, dupper, blkno;
+	int i, j, d, dlower, dupper, blkno;
 	struct ufs1_dinode *dp1;
 	struct ufs2_dinode *dp2;
 	int start;
@@ -667,8 +667,8 @@ initcg(int cylno, time_t utime, const fs
 	}
 	acg.cg_cs.cs_nifree += sblock.fs_ipg;
 	if (cylno == 0)
-		for (i = 0; i < ROOTINO; i++) {
-			setbit(cg_inosused(&acg, 0), i);
+		for (size_t r = 0; r < ROOTINO; r++) {
+			setbit(cg_inosused(&acg, 0), r);
 			acg.cg_cs.cs_nifree--;
 		}
 	if (cylno > 0) {

Index: src/usr.sbin/makefs/v7fs/v7fs_estimate.c
diff -u src/usr.sbin/makefs/v7fs/v7fs_estimate.c:1.2 src/usr.sbin/makefs/v7fs/v7fs_estimate.c:1.3
--- src/usr.sbin/makefs/v7fs/v7fs_estimate.c:1.2	Wed Aug 10 07:31:49 2011
+++ src/usr.sbin/makefs/v7fs/v7fs_estimate.c	Thu Apr 19 13:28:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs_estimate.c,v 1.2 2011/08/10 11:31:49 uch Exp $	*/
+/*	$NetBSD: v7fs_estimate.c,v 1.3 2012/04/19 17:28:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: v7fs_estimate.c,v 1.2 2011/08/10 11:31:49 uch Exp $");
+__RCSID("$NetBSD: v7fs_estimate.c,v 1.3 2012/04/19 17:28:26 christos Exp $");
 #endif	/* !__lint */
 
 #include <stdio.h>
@@ -192,9 +192,8 @@ static void
 determine_fs_size(fsinfo_t *fsopts, struct v7fs_geometry *geom)
 {
 	v7fs_daddr_t nblk = geom->ndatablock;
-	v7fs_daddr_t fsblk;
+	v7fs_daddr_t fsblk, n;
 	int32_t	nfiles = geom->ninode;
-	int n;
 
 	VPRINTF("size=%lld inodes=%lld fd=%d superb=%p onlyspec=%d\n",
 	    (long long)fsopts->size, (long long)fsopts->inodes, fsopts->fd,

Reply via email to