Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2017 14:05:29 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318451 - in head/usr.sbin/makefs: . ffs
Message-ID:  <201705181405.v4IE5TEi052861@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu May 18 14:05:29 2017
New Revision: 318451
URL: https://svnweb.freebsd.org/changeset/base/318451

Log:
  makefs: clean up signedness warnings and bump WARNS to 3
  
  Reviewed by:	kib
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D10650

Modified:
  head/usr.sbin/makefs/Makefile
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs/ffs_alloc.c
  head/usr.sbin/makefs/ffs/ffs_balloc.c
  head/usr.sbin/makefs/ffs/ffs_bswap.c
  head/usr.sbin/makefs/mtree.c

Modified: head/usr.sbin/makefs/Makefile
==============================================================================
--- head/usr.sbin/makefs/Makefile	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/Makefile	Thu May 18 14:05:29 2017	(r318451)
@@ -14,7 +14,7 @@ SRCS=	cd9660.c ffs.c \
 	walk.c
 MAN=	makefs.8
 
-WARNS?=	2
+WARNS?=	3
 
 .include "${SRCDIR}/cd9660/Makefile.inc"
 .include "${SRCDIR}/ffs/Makefile.inc"

Modified: head/usr.sbin/makefs/ffs.c
==============================================================================
--- head/usr.sbin/makefs/ffs.c	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/ffs.c	Thu May 18 14:05:29 2017	(r318451)
@@ -1065,10 +1065,11 @@ ffs_write_inode(union dinode *dp, uint32
 	struct ufs2_dinode *dp2, *dip;
 	struct cg	*cgp;
 	struct fs	*fs;
-	int		cg, cgino, i;
+	int		cg, cgino;
+	uint32_t	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);

Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu May 18 14:05:29 2017	(r318451)
@@ -64,7 +64,7 @@ static int scanc(u_int, const u_char *, 
 
 static daddr_t ffs_alloccg(struct inode *, int, daddr_t, int);
 static daddr_t ffs_alloccgblk(struct inode *, struct buf *, daddr_t);
-static daddr_t ffs_hashalloc(struct inode *, int, daddr_t, int,
+static daddr_t ffs_hashalloc(struct inode *, u_int, daddr_t, int,
 		     daddr_t (*)(struct inode *, int, daddr_t, int));
 static int32_t ffs_mapsearch(struct fs *, struct cg *, daddr_t, int);
 
@@ -152,8 +152,8 @@ daddr_t
 ffs_blkpref_ufs1(struct inode *ip, daddr_t lbn, int indx, int32_t *bap)
 {
 	struct fs *fs;
-	int cg;
-	int avgbfree, startcg;
+	u_int cg, startcg;
+	int avgbfree;
 
 	fs = ip->i_fs;
 	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
@@ -191,8 +191,8 @@ daddr_t
 ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap)
 {
 	struct fs *fs;
-	int cg;
-	int avgbfree, startcg;
+	u_int cg, startcg;
+	int avgbfree;
 
 	fs = ip->i_fs;
 	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
@@ -240,12 +240,12 @@ ffs_blkpref_ufs2(struct inode *ip, daddr
  */
 /*VARARGS5*/
 static daddr_t
-ffs_hashalloc(struct inode *ip, int cg, daddr_t pref, int size,
+ffs_hashalloc(struct inode *ip, u_int cg, daddr_t pref, int size,
     daddr_t (*allocator)(struct inode *, int, daddr_t, int))
 {
 	struct fs *fs;
 	daddr_t result;
-	int i, icg = cg;
+	u_int i, icg = cg;
 
 	fs = ip->i_fs;
 	/*

Modified: head/usr.sbin/makefs/ffs/ffs_balloc.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_balloc.c	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/ffs/ffs_balloc.c	Thu May 18 14:05:29 2017	(r318451)
@@ -123,7 +123,8 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
 
 	if (lbn < UFS_NDADDR) {
 		nb = ufs_rw32(ip->i_ffs1_db[lbn], needswap);
-		if (nb != 0 && ip->i_ffs1_size >= lblktosize(fs, lbn + 1)) {
+		if (nb != 0 && ip->i_ffs1_size >=
+		    (uint64_t)lblktosize(fs, lbn + 1)) {
 
 			/*
 			 * The block is an already-allocated direct block
@@ -178,7 +179,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t 
 			 * allocate a new block or fragment.
 			 */
 
-			if (ip->i_ffs1_size < lblktosize(fs, lbn + 1))
+			if (ip->i_ffs1_size < (uint64_t)lblktosize(fs, lbn + 1))
 				nsize = fragroundup(fs, size);
 			else
 				nsize = fs->fs_bsize;
@@ -373,7 +374,8 @@ ffs_balloc_ufs2(struct inode *ip, off_t 
 
 	if (lbn < UFS_NDADDR) {
 		nb = ufs_rw64(ip->i_ffs2_db[lbn], needswap);
-		if (nb != 0 && ip->i_ffs2_size >= lblktosize(fs, lbn + 1)) {
+		if (nb != 0 && ip->i_ffs2_size >=
+		    (uint64_t)lblktosize(fs, lbn + 1)) {
 
 			/*
 			 * The block is an already-allocated direct block
@@ -428,7 +430,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t 
 			 * allocate a new block or fragment.
 			 */
 
-			if (ip->i_ffs2_size < lblktosize(fs, lbn + 1))
+			if (ip->i_ffs2_size < (uint64_t)lblktosize(fs, lbn + 1))
 				nsize = fragroundup(fs, size);
 			else
 				nsize = fs->fs_bsize;

Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu May 18 14:05:29 2017	(r318451)
@@ -39,12 +39,12 @@ __FBSDID("$FreeBSD$");
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#define panic(x)	printf("%s\n", (x)), abort()
 #endif
 
 #include <ufs/ufs/dinode.h>
 #include "ffs/ufs_bswap.h"
 #include <ufs/ffs/fs.h>
+#include "ffs/ffs_extern.h"
 
 #define	fs_old_postbloff	fs_spare5[0]
 #define	fs_old_rotbloff		fs_spare5[1]

Modified: head/usr.sbin/makefs/mtree.c
==============================================================================
--- head/usr.sbin/makefs/mtree.c	Thu May 18 13:49:53 2017	(r318450)
+++ head/usr.sbin/makefs/mtree.c	Thu May 18 14:05:29 2017	(r318451)
@@ -505,7 +505,8 @@ read_mtree_keywords(FILE *fp, fsnode *no
 	struct stat *st, sb;
 	intmax_t num;
 	u_long flset, flclr;
-	int error, istemp, type;
+	int error, istemp;
+	uint32_t type;
 
 	st = &node->inode->st;
 	do {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705181405.v4IE5TEi052861>