From owner-svn-src-head@freebsd.org Thu May 18 14:05:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9B9D73C14; Thu, 18 May 2017 14:05:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40366D29; Thu, 18 May 2017 14:05:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4IE5UNt052867; Thu, 18 May 2017 14:05:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4IE5TEi052861; Thu, 18 May 2017 14:05:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705181405.v4IE5TEi052861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 May 2017 14:05:29 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 14:05:31 -0000 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 #include #include -#define panic(x) printf("%s\n", (x)), abort() #endif #include #include "ffs/ufs_bswap.h" #include +#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 {