Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs WARNS=5
details: https://anonhg.NetBSD.org/src/rev/13006ff5e826
branches: trunk
changeset: 778902:13006ff5e826
user: christos <christos%NetBSD.org@localhost>
date: Thu Apr 19 17:28:25 2012 +0000
description:
WARNS=5
diffstat:
usr.sbin/makefs/Makefile | 4 ++--
usr.sbin/makefs/cd9660/cd9660_eltorito.c | 6 +++---
usr.sbin/makefs/chfs.c | 5 ++---
usr.sbin/makefs/chfs/chfs_mkfs.c | 5 +++--
usr.sbin/makefs/ffs.c | 21 +++++++++++----------
usr.sbin/makefs/ffs/ffs_alloc.c | 14 +++++---------
usr.sbin/makefs/ffs/mkfs.c | 10 +++++-----
usr.sbin/makefs/v7fs/v7fs_estimate.c | 7 +++----
usr.sbin/makefs/walk.c | 6 +++---
9 files changed, 37 insertions(+), 41 deletions(-)
diffs (truncated from 311 to 300 lines):
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/Makefile
--- a/usr.sbin/makefs/Makefile Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/Makefile Thu Apr 19 17:28:25 2012 +0000
@@ -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>
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/cd9660/cd9660_eltorito.c
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 @@
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) {
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/chfs.c
--- a/usr.sbin/makefs/chfs.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/chfs.c Thu Apr 19 17:28:25 2012 +0000
@@ -98,7 +98,6 @@
}
*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 @@
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)) {
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/chfs/chfs_mkfs.c
--- a/usr.sbin/makefs/chfs/chfs_mkfs.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/chfs/chfs_mkfs.c Thu Apr 19 17:28:25 2012 +0000
@@ -100,7 +100,8 @@
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 @@
#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");
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/ffs.c
--- a/usr.sbin/makefs/ffs.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/ffs.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 @@
(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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
* 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;
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/ffs/ffs_alloc.c
--- a/usr.sbin/makefs/ffs/ffs_alloc.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/ffs/ffs_alloc.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 @@
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 @@
}
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 @@
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);
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/ffs/mkfs.c
--- a/usr.sbin/makefs/ffs/mkfs.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/ffs/mkfs.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 @@
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 @@
}
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) {
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/v7fs/v7fs_estimate.c
--- a/usr.sbin/makefs/v7fs/v7fs_estimate.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/v7fs/v7fs_estimate.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 @@
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,
diff -r 478d5f77f12a -r 13006ff5e826 usr.sbin/makefs/walk.c
--- a/usr.sbin/makefs/walk.c Thu Apr 19 17:25:38 2012 +0000
+++ b/usr.sbin/makefs/walk.c Thu Apr 19 17:28:25 2012 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index