Module Name: src Committed By: christos Date: Sat Oct 19 01:09:59 UTC 2013
Modified Files: src/sbin/apmlabel: apmlabel.c src/sbin/dmctl: dmctl.c src/sbin/fsck_ffs: pass1.c utilities.c src/sbin/fsck_lfs: bufcache.c lfs.c pass6.c segwrite.c src/sbin/fsirand: fsirand.c src/sbin/mount_lfs: mount_lfs.c src/sbin/mount_nilfs: mount_nilfs.c src/sbin/mount_portal: pt_file.c src/sbin/newfs_ext2fs: newfs_ext2fs.c src/sbin/newfs_lfs: make_lfs.c src/sbin/newfs_msdos: mkfs_msdos.c src/sbin/newfs_udf: udf_create.c src/sbin/raidctl: raidctl.c src/sbin/rcorder: rcorder.c Log Message: fix unused variable warnings. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/apmlabel/apmlabel.c cvs rdiff -u -r1.3 -r1.4 src/sbin/dmctl/dmctl.c cvs rdiff -u -r1.55 -r1.56 src/sbin/fsck_ffs/pass1.c cvs rdiff -u -r1.63 -r1.64 src/sbin/fsck_ffs/utilities.c cvs rdiff -u -r1.13 -r1.14 src/sbin/fsck_lfs/bufcache.c cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck_lfs/lfs.c cvs rdiff -u -r1.31 -r1.32 src/sbin/fsck_lfs/pass6.c cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_lfs/segwrite.c cvs rdiff -u -r1.31 -r1.32 src/sbin/fsirand/fsirand.c cvs rdiff -u -r1.34 -r1.35 src/sbin/mount_lfs/mount_lfs.c cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_nilfs/mount_nilfs.c cvs rdiff -u -r1.17 -r1.18 src/sbin/mount_portal/pt_file.c cvs rdiff -u -r1.8 -r1.9 src/sbin/newfs_ext2fs/newfs_ext2fs.c cvs rdiff -u -r1.28 -r1.29 src/sbin/newfs_lfs/make_lfs.c cvs rdiff -u -r1.7 -r1.8 src/sbin/newfs_msdos/mkfs_msdos.c cvs rdiff -u -r1.23 -r1.24 src/sbin/newfs_udf/udf_create.c cvs rdiff -u -r1.55 -r1.56 src/sbin/raidctl/raidctl.c cvs rdiff -u -r1.16 -r1.17 src/sbin/rcorder/rcorder.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/apmlabel/apmlabel.c diff -u src/sbin/apmlabel/apmlabel.c:1.2 src/sbin/apmlabel/apmlabel.c:1.3 --- src/sbin/apmlabel/apmlabel.c:1.2 Sat Aug 27 12:10:51 2011 +++ src/sbin/apmlabel/apmlabel.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: apmlabel.c,v 1.2 2011/08/27 16:10:51 joerg Exp $ */ +/* $NetBSD: apmlabel.c,v 1.3 2013/10/19 01:09:58 christos Exp $ */ /* * Copyright (C) 1998 Wolfgang Solfrank. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: apmlabel.c,v 1.2 2011/08/27 16:10:51 joerg Exp $"); +__RCSID("$NetBSD: apmlabel.c,v 1.3 2013/10/19 01:09:58 christos Exp $"); #endif /* not lint */ #include <stdio.h> @@ -104,7 +104,7 @@ getparts(int sd, int verbose) struct apple_drvr_map *drvr; struct apple_part_map_entry *part; struct partition npe; - uint16_t blksize, blkcnt, partcnt; + uint16_t blksize, partcnt; int i, j, unused, changed; uint64_t temp; @@ -123,7 +123,6 @@ getparts(int sd, int verbose) if (drvr->sbSig != APPLE_DRVR_MAP_MAGIC) return (changed); blksize = drvr->sbBlockSize; - blkcnt = drvr->sbBlkCount; partcnt = 1; Index: src/sbin/dmctl/dmctl.c diff -u src/sbin/dmctl/dmctl.c:1.3 src/sbin/dmctl/dmctl.c:1.4 --- src/sbin/dmctl/dmctl.c:1.3 Sat Aug 27 13:07:28 2011 +++ src/sbin/dmctl/dmctl.c Fri Oct 18 21:09:58 2013 @@ -213,16 +213,16 @@ main(int argc, char *argv[]) static int dmctl_get_version(int argc __unused, char *argv[] __unused, libdm_task_t task) { - uint32_t ver[3], size; + uint32_t ver[3]; - size = libdm_task_get_cmd_version(task, ver, sizeof(ver)); + (void)libdm_task_get_cmd_version(task, ver, sizeof(ver)); printf("Library protocol version %d:%d:%d\n", ver[0], ver[1], ver[2]); if (libdm_task_run(task) != 0) err(EXIT_FAILURE, "dmctl_get_version: libdm_task_run failed."); - size = libdm_task_get_cmd_version(task, ver, 3); + (void)libdm_task_get_cmd_version(task, ver, 3); printf("Kernel protocol version %d:%d:%d\n",ver[0], ver[1], ver[2]); libdm_task_destroy(task); Index: src/sbin/fsck_ffs/pass1.c diff -u src/sbin/fsck_ffs/pass1.c:1.55 src/sbin/fsck_ffs/pass1.c:1.56 --- src/sbin/fsck_ffs/pass1.c:1.55 Sun Jun 23 03:28:36 2013 +++ src/sbin/fsck_ffs/pass1.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.55 2013/06/23 07:28:36 dholland Exp $ */ +/* $NetBSD: pass1.c,v 1.56 2013/10/19 01:09:58 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: pass1.c,v 1.55 2013/06/23 07:28:36 dholland Exp $"); +__RCSID("$NetBSD: pass1.c,v 1.56 2013/10/19 01:09:58 christos Exp $"); #endif #endif /* not lint */ @@ -235,15 +235,11 @@ checkinode(ino_t inumber, struct inodesc int64_t blocks; char symbuf[MAXBSIZE]; struct inostat *info; - uid_t uid; - gid_t gid; dp = getnextinode(inumber); info = inoinfo(inumber); mode = iswap16(DIP(dp, mode)) & IFMT; size = iswap64(DIP(dp, size)); - uid = iswap32(DIP(dp, uid)); - gid = iswap32(DIP(dp, gid)); if (mode == 0) { if ((is_ufs2 && (memcmp(dp->dp2.di_db, ufs2_zino.di_db, Index: src/sbin/fsck_ffs/utilities.c diff -u src/sbin/fsck_ffs/utilities.c:1.63 src/sbin/fsck_ffs/utilities.c:1.64 --- src/sbin/fsck_ffs/utilities.c:1.63 Sun Jun 23 18:03:34 2013 +++ src/sbin/fsck_ffs/utilities.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.63 2013/06/23 22:03:34 dholland Exp $ */ +/* $NetBSD: utilities.c,v 1.64 2013/10/19 01:09:58 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95"; #else -__RCSID("$NetBSD: utilities.c,v 1.63 2013/06/23 22:03:34 dholland Exp $"); +__RCSID("$NetBSD: utilities.c,v 1.64 2013/10/19 01:09:58 christos Exp $"); #endif #endif /* not lint */ @@ -263,7 +263,7 @@ void ckfini(int noint) { struct bufarea *bp, *nbp; - int ofsmodified, cnt = 0; + int cnt = 0; if (!noint) { if (doinglevel2) @@ -314,11 +314,7 @@ ckfini(int noint) sblock->fs_pendingblocks = 0; sblock->fs_pendinginodes = 0; sbdirty(); - ofsmodified = fsmodified; flush(fswritefd, &sblk); -#if LITE2BORKEN - fsmodified = ofsmodified; -#endif if (!preen) printf( "\n***** FILE SYSTEM MARKED CLEAN *****\n"); Index: src/sbin/fsck_lfs/bufcache.c diff -u src/sbin/fsck_lfs/bufcache.c:1.13 src/sbin/fsck_lfs/bufcache.c:1.14 --- src/sbin/fsck_lfs/bufcache.c:1.13 Fri May 16 05:21:59 2008 +++ src/sbin/fsck_lfs/bufcache.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bufcache.c,v 1.13 2008/05/16 09:21:59 hannken Exp $ */ +/* $NetBSD: bufcache.c,v 1.14 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. @@ -344,7 +344,6 @@ bread(struct uvnode * vp, daddr_t lbn, i { struct ubuf *bp; daddr_t daddr; - int error; bp = getblk(vp, lbn, size); *bpp = bp; @@ -359,7 +358,7 @@ bread(struct uvnode * vp, daddr_t lbn, i * and load it in. */ daddr = -1; - error = VOP_BMAP(vp, lbn, &daddr); + (void)VOP_BMAP(vp, lbn, &daddr); bp->b_blkno = daddr; if (daddr >= 0) { bp->b_flags |= B_READ; Index: src/sbin/fsck_lfs/lfs.c diff -u src/sbin/fsck_lfs/lfs.c:1.40 src/sbin/fsck_lfs/lfs.c:1.41 --- src/sbin/fsck_lfs/lfs.c:1.40 Tue Jun 18 14:18:58 2013 +++ src/sbin/fsck_lfs/lfs.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs.c,v 1.40 2013/06/18 18:18:58 christos Exp $ */ +/* $NetBSD: lfs.c,v 1.41 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. @@ -451,7 +451,6 @@ lfs_init(int devfd, daddr_t sblkno, dadd struct ubuf *bp; int tryalt; struct lfs *fs, *altfs; - int error; vfs_init(); @@ -480,7 +479,7 @@ lfs_init(int devfd, daddr_t sblkno, dadd dev_bsize = DEV_BSIZE; - error = bread(devvp, sblkno, LFS_SBPAD, NOCRED, 0, &bp); + (void)bread(devvp, sblkno, LFS_SBPAD, NOCRED, 0, &bp); fs = ecalloc(1, sizeof(*fs)); fs->lfs_dlfs = *((struct dlfs *) bp->b_data); fs->lfs_devvp = devvp; @@ -490,7 +489,7 @@ lfs_init(int devfd, daddr_t sblkno, dadd dev_bsize = fs->lfs_fsize >> fs->lfs_fsbtodb; if (tryalt) { - error = bread(devvp, LFS_FSBTODB(fs, fs->lfs_sboffs[1]), + (void)bread(devvp, LFS_FSBTODB(fs, fs->lfs_sboffs[1]), LFS_SBPAD, NOCRED, 0, &bp); altfs = ecalloc(1, sizeof(*altfs)); altfs->lfs_dlfs = *((struct dlfs *) bp->b_data); @@ -744,17 +743,13 @@ check_summary(struct lfs *fs, SEGSUM *sp FINFO *fp; int bc; /* Bytes in partial segment */ int nblocks; - ulfs_daddr_t seg_addr, daddr; + ulfs_daddr_t daddr; ulfs_daddr_t *dp, *idp; struct ubuf *bp; int i, j, k, datac, len; - long sn; u_int32_t *datap; u_int32_t ccksum; - sn = lfs_dtosn(fs, pseg_addr); - seg_addr = lfs_sntod(fs, sn); - /* We've already checked the sumsum, just do the data bounds and sum */ /* Count the blocks. */ @@ -864,7 +859,6 @@ lfs_valloc(struct lfs *fs, ino_t ino) struct ifile *ifp; ino_t new_ino; int error; - int new_gen; CLEANERINFO *cip; /* Get the head of the freelist. */ @@ -879,7 +873,6 @@ lfs_valloc(struct lfs *fs, ino_t ino) panic("lfs_valloc: inuse inode %d on the free list", new_ino); LFS_PUT_HEADFREE(fs, cip, cbp, ifp->if_nextfree); - new_gen = ifp->if_version; /* version was updated by vfree */ brelse(bp, 0); /* Extend IFILE so that the next lfs_valloc will succeed. */ @@ -1195,7 +1188,6 @@ lfs_fragextend(struct uvnode *vp, int os struct lfs *fs; int frags; int error; - size_t obufsize; ip = VTOI(vp); fs = ip->i_lfs; @@ -1218,7 +1210,6 @@ lfs_fragextend(struct uvnode *vp, int os ip->i_flag |= IN_CHANGE | IN_UPDATE; if (bpp) { - obufsize = (*bpp)->b_bufsize; (*bpp)->b_data = erealloc((*bpp)->b_data, nsize); (void)memset((*bpp)->b_data + osize, 0, nsize - osize); } Index: src/sbin/fsck_lfs/pass6.c diff -u src/sbin/fsck_lfs/pass6.c:1.31 src/sbin/fsck_lfs/pass6.c:1.32 --- src/sbin/fsck_lfs/pass6.c:1.31 Tue Jun 18 14:18:58 2013 +++ src/sbin/fsck_lfs/pass6.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pass6.c,v 1.31 2013/06/18 18:18:58 christos Exp $ */ +/* $NetBSD: pass6.c,v 1.32 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -214,12 +214,10 @@ remove_ino(struct uvnode *vp, ino_t ino) struct ubuf *bp, *sbp, *cbp; struct inodesc idesc; ulfs_daddr_t daddr; - int obfree; if (debug) pwarn("remove ino %d\n", (int)ino); - obfree = fs->lfs_bfree; LFS_IENTRY(ifp, fs, ino, bp); daddr = ifp->if_daddr; if (daddr > 0) { @@ -543,7 +541,7 @@ alloc_inode(ino_t thisino, ulfs_daddr_t void pass6(void) { - ulfs_daddr_t daddr, ibdaddr, odaddr, lastgood, nextseg, *idaddrp; + ulfs_daddr_t daddr, ibdaddr, odaddr, lastgood, *idaddrp; struct uvnode *vp, *devvp; CLEANERINFO *cip; SEGUSE *sup; @@ -588,7 +586,6 @@ pass6(void) ibbuf = emalloc(fs->lfs_ibsize); nnewfiles = ndelfiles = nmvfiles = nnewblocks = 0; daddr = fs->lfs_offset; - nextseg = fs->lfs_nextseg; hassuper = 0; lastserial = 0; while (daddr != lastgood) { @@ -628,7 +625,6 @@ pass6(void) fs->lfs_bfree -= lfs_btofsb(fs, fs->lfs_sumsize); fs->lfs_dmeta += lfs_btofsb(fs, fs->lfs_sumsize); sbdirty(); - nextseg = sp->ss_next; if (lfs_sntod(fs, lfs_dtosn(fs, daddr)) == daddr + hassuper * lfs_btofsb(fs, LFS_SBPAD) && lfs_dtosn(fs, daddr) != lfs_dtosn(fs, fs->lfs_offset)) { Index: src/sbin/fsck_lfs/segwrite.c diff -u src/sbin/fsck_lfs/segwrite.c:1.26 src/sbin/fsck_lfs/segwrite.c:1.27 --- src/sbin/fsck_lfs/segwrite.c:1.26 Tue Jun 18 14:18:58 2013 +++ src/sbin/fsck_lfs/segwrite.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: segwrite.c,v 1.26 2013/06/18 18:18:58 christos Exp $ */ +/* $NetBSD: segwrite.c,v 1.27 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. @@ -243,7 +243,7 @@ lfs_writeinode(struct lfs * fs, struct s SEGUSE *sup; daddr_t daddr; ino_t ino; - int error, i, ndx, fsb = 0; + int i, ndx, fsb = 0; int redo_ifile = 0; struct timespec ts; int gotblk = 0; @@ -333,7 +333,7 @@ lfs_writeinode(struct lfs * fs, struct s LFS_IENTRY(ifp, fs, ino, ibp); daddr = ifp->if_daddr; ifp->if_daddr = LFS_DBTOFSB(fs, bp->b_blkno) + fsb; - error = LFS_BWRITE_LOG(ibp); /* Ifile */ + (void)LFS_BWRITE_LOG(ibp); /* Ifile */ } /* Index: src/sbin/fsirand/fsirand.c diff -u src/sbin/fsirand/fsirand.c:1.31 src/sbin/fsirand/fsirand.c:1.32 --- src/sbin/fsirand/fsirand.c:1.31 Sat Jun 22 22:06:05 2013 +++ src/sbin/fsirand/fsirand.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: fsirand.c,v 1.31 2013/06/23 02:06:05 dholland Exp $ */ +/* $NetBSD: fsirand.c,v 1.32 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fsirand.c,v 1.31 2013/06/23 02:06:05 dholland Exp $"); +__RCSID("$NetBSD: fsirand.c,v 1.32 2013/10/19 01:09:58 christos Exp $"); #endif /* lint */ #include <sys/param.h> @@ -204,10 +204,9 @@ statussig(int dummy) { char msgbuf[256]; int len, deltat; - time_t tnow, elapsed; + time_t tnow; (void)time(&tnow); - elapsed = tnow - tstart; len = snprintf(msgbuf, sizeof(msgbuf), "fsirand: completed inode %d of %d (%3.2f%%)", ino, imax, (ino * 100.0) / imax); Index: src/sbin/mount_lfs/mount_lfs.c diff -u src/sbin/mount_lfs/mount_lfs.c:1.34 src/sbin/mount_lfs/mount_lfs.c:1.35 --- src/sbin/mount_lfs/mount_lfs.c:1.34 Mon Aug 29 10:35:01 2011 +++ src/sbin/mount_lfs/mount_lfs.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_lfs.c,v 1.34 2011/08/29 14:35:01 joerg Exp $ */ +/* $NetBSD: mount_lfs.c,v 1.35 2013/10/19 01:09:58 christos Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 19 #if 0 static char sccsid[] = "@(#)mount_lfs.c 8.4 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_lfs.c,v 1.34 2011/08/29 14:35:01 joerg Exp $"); +__RCSID("$NetBSD: mount_lfs.c,v 1.35 2013/10/19 01:09:58 christos Exp $"); #endif #endif /* not lint */ @@ -98,11 +98,9 @@ mount_lfs_parseargs(int argc, char *argv char *canon_dev, char *canon_dir) { int ch; - char *options; mntoptparse_t mp; memset(args, 0, sizeof(*args)); - options = NULL; nsegs = "4"; *mntflags = noclean = 0; cleaner_bytes = 1; Index: src/sbin/mount_nilfs/mount_nilfs.c diff -u src/sbin/mount_nilfs/mount_nilfs.c:1.1 src/sbin/mount_nilfs/mount_nilfs.c:1.2 --- src/sbin/mount_nilfs/mount_nilfs.c:1.1 Sat Jul 18 12:31:42 2009 +++ src/sbin/mount_nilfs/mount_nilfs.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_nilfs.c,v 1.1 2009/07/18 16:31:42 reinoud Exp $ */ +/* $NetBSD: mount_nilfs.c,v 1.2 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 2008, 2009 Reinoud Zandijk @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: mount_nilfs.c,v 1.1 2009/07/18 16:31:42 reinoud Exp $"); +__RCSID("$NetBSD: mount_nilfs.c,v 1.2 2013/10/19 01:09:59 christos Exp $"); #endif /* not lint */ @@ -110,14 +110,12 @@ mount_nilfs_parseargs(int argc, char **a struct tm *tm; time_t now; int ch, set_gmtoff; - uint32_t sector_size; mntoptparse_t mp; /* initialise */ (void)memset(args, 0, sizeof(*args)); set_gmtoff = *mntflags = 0; - sector_size = 0; while ((ch = getopt(argc, argv, "c:o:t:")) != -1) { switch (ch) { Index: src/sbin/mount_portal/pt_file.c diff -u src/sbin/mount_portal/pt_file.c:1.17 src/sbin/mount_portal/pt_file.c:1.18 --- src/sbin/mount_portal/pt_file.c:1.17 Mon Jul 2 14:07:45 2007 +++ src/sbin/mount_portal/pt_file.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pt_file.c,v 1.17 2007/07/02 18:07:45 pooka Exp $ */ +/* $NetBSD: pt_file.c,v 1.18 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: pt_file.c,v 1.17 2007/07/02 18:07:45 pooka Exp $"); +__RCSID("$NetBSD: pt_file.c,v 1.18 2013/10/19 01:09:59 christos Exp $"); #endif /* not lint */ #include <stdio.h> @@ -133,10 +133,9 @@ portal_file(struct portal_cred *pcr, cha int fd; char pbuf[MAXPATHLEN]; int error; - int origuid, origgid; + int origuid; origuid = getuid(); - origgid = getgid(); pbuf[0] = '/'; strlcpy(pbuf + 1, key + (v[1] ? strlen(v[1]) : 0), sizeof(pbuf) - 1); DEBUG_SYSLOG(LOG_DEBUG, "path = %s, uid = %d, gid = %d", Index: src/sbin/newfs_ext2fs/newfs_ext2fs.c diff -u src/sbin/newfs_ext2fs/newfs_ext2fs.c:1.8 src/sbin/newfs_ext2fs/newfs_ext2fs.c:1.9 --- src/sbin/newfs_ext2fs/newfs_ext2fs.c:1.8 Mon Mar 2 05:38:13 2009 +++ src/sbin/newfs_ext2fs/newfs_ext2fs.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_ext2fs.c,v 1.8 2009/03/02 10:38:13 tsutsui Exp $ */ +/* $NetBSD: newfs_ext2fs.c,v 1.9 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 1983, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: newfs_ext2fs.c,v 1.8 2009/03/02 10:38:13 tsutsui Exp $"); +__RCSID("$NetBSD: newfs_ext2fs.c,v 1.9 2013/10/19 01:09:59 christos Exp $"); #endif #endif /* not lint */ @@ -126,12 +126,11 @@ main(int argc, char *argv[]) struct statvfs *mp; struct stat sb; int ch, fsi, fso, len, n, Fflag, Iflag, Zflag; - char *cp, *s1, *s2, *special; + char *s1, *s2, *special; const char *opstring; int byte_sized; uint blocks; /* number of blocks */ - cp = NULL; fsi = fso = -1; Fflag = Iflag = Zflag = 0; verbosity = -1; Index: src/sbin/newfs_lfs/make_lfs.c diff -u src/sbin/newfs_lfs/make_lfs.c:1.28 src/sbin/newfs_lfs/make_lfs.c:1.29 --- src/sbin/newfs_lfs/make_lfs.c:1.28 Tue Jun 18 14:18:58 2013 +++ src/sbin/newfs_lfs/make_lfs.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: make_lfs.c,v 1.28 2013/06/18 18:18:58 christos Exp $ */ +/* $NetBSD: make_lfs.c,v 1.29 2013/10/19 01:09:59 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ #if 0 static char sccsid[] = "@(#)lfs.c 8.5 (Berkeley) 5/24/95"; #else -__RCSID("$NetBSD: make_lfs.c,v 1.28 2013/06/18 18:18:58 christos Exp $"); +__RCSID("$NetBSD: make_lfs.c,v 1.29 2013/10/19 01:09:59 christos Exp $"); #endif #endif /* not lint */ @@ -221,7 +221,7 @@ maxfilesize(int bshift) static void make_dinode(ino_t ino, struct ulfs1_dinode *dip, int nfrags, struct lfs *fs) { - int fsb_per_blk, i; + int i; int nblocks, bb, base, factor, lvl; nblocks = howmany(nfrags, fs->lfs_frag); @@ -237,8 +237,6 @@ make_dinode(ino_t ino, struct ulfs1_dino dip->di_inumber = ino; dip->di_gen = 1; - fsb_per_blk = lfs_blkstofrags(fs, 1); - if (ULFS_NDADDR < nblocks) { /* Count up how many indirect blocks we need, recursively */ /* XXX We are only called with nblocks > 1 for Ifile */ Index: src/sbin/newfs_msdos/mkfs_msdos.c diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.7 src/sbin/newfs_msdos/mkfs_msdos.c:1.8 --- src/sbin/newfs_msdos/mkfs_msdos.c:1.7 Sat Feb 2 22:21:42 2013 +++ src/sbin/newfs_msdos/mkfs_msdos.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: mkfs_msdos.c,v 1.7 2013/02/03 03:21:42 christos Exp $ */ +/* $NetBSD: mkfs_msdos.c,v 1.8 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 1998 Robert Nordier @@ -37,7 +37,7 @@ static const char rcsid[] = "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $"; #else -__RCSID("$NetBSD: mkfs_msdos.c,v 1.7 2013/02/03 03:21:42 christos Exp $"); +__RCSID("$NetBSD: mkfs_msdos.c,v 1.8 2013/10/19 01:09:59 christos Exp $"); #endif #endif /* not lint */ @@ -274,7 +274,6 @@ mkfs_msdos(const char *fname, const char return -1; } if (o.create_size) { - off_t pos; if (o.no_create) { warnx("create (-C) is incompatible with -N"); return -1; @@ -286,12 +285,12 @@ mkfs_msdos(const char *fname, const char warnx("failed to create %s", fname); return -1; } - pos = lseek(fd, o.create_size - 1, SEEK_SET); + (void)lseek(fd, o.create_size - 1, SEEK_SET); if (write(fd, "\0", 1) != 1) { warn("failed to set file size"); return -1; } - pos = lseek(fd, 0, SEEK_SET); + (void)lseek(fd, 0, SEEK_SET); } else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1 || fstat(fd, &sb)) { warn("%s", fname); Index: src/sbin/newfs_udf/udf_create.c diff -u src/sbin/newfs_udf/udf_create.c:1.23 src/sbin/newfs_udf/udf_create.c:1.24 --- src/sbin/newfs_udf/udf_create.c:1.23 Sat Aug 10 19:25:35 2013 +++ src/sbin/newfs_udf/udf_create.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_create.c,v 1.23 2013/08/10 23:25:35 tron Exp $ */ +/* $NetBSD: udf_create.c,v 1.24 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -30,7 +30,7 @@ #endif #include <sys/cdefs.h> -__RCSID("$NetBSD: udf_create.c,v 1.23 2013/08/10 23:25:35 tron Exp $"); +__RCSID("$NetBSD: udf_create.c,v 1.24 2013/10/19 01:09:59 christos Exp $"); #include <stdio.h> #include <stdlib.h> @@ -183,7 +183,7 @@ udf_calculate_disc_layout(int format_fla uint32_t pos, mpos; /* clear */ - bzero(&layout, sizeof(struct udf_disclayout)); + memset(&layout, 0, sizeof(layout)); /* fill with parameters */ layout.wrtrack_skew = wrtrack_skew; @@ -498,7 +498,7 @@ udf_create_anchor(int num) void udf_create_terminator(union dscrptr *dscr, uint32_t loc) { - bzero(dscr, context.sector_size); + memset(dscr, 0, context.sector_size); udf_inittag(&dscr->tag, TAGID_TERM, loc); /* CRC length for an anchor is 512 - tag length; defined in Ecma 167 */ @@ -509,7 +509,7 @@ udf_create_terminator(union dscrptr *dsc void udf_osta_charset(struct charspec *charspec) { - bzero(charspec, sizeof(struct charspec)); + memset(charspec, 0, sizeof(*charspec)); charspec->type = 0; strcpy((char *) charspec->inf, "OSTA Compressed Unicode"); } @@ -522,10 +522,10 @@ udf_encode_osta_id(char *osta_id, uint16 uint8_t *pos; uint16_t *pos16; - bzero(osta_id, len); + memset(osta_id, 0, len); if (!text || (strlen(text) == 0)) return; - bzero(u16_name, sizeof(uint16_t) * 1023); + memset(u16_name, 0, sizeof(uint16_t) * 1023); /* convert ascii to 16 bits unicode */ pos = (uint8_t *) text; @@ -547,7 +547,7 @@ udf_encode_osta_id(char *osta_id, uint16 void udf_set_regid(struct regid *regid, char const *name) { - bzero(regid, sizeof(struct regid)); + memset(regid, 0, sizeof(*regid)); regid->flags = 0; /* not dirty and not protected */ strcpy((char *) regid->id, name); } @@ -604,7 +604,7 @@ udf_timespec_to_timestamp(struct timespe struct tm tm; uint64_t husec, usec, csec; - bzero(timestamp, sizeof(struct timestamp)); + memset(timestamp, 0, sizeof(*timestamp)); gmtime_r(×pec->tv_sec, &tm); /* @@ -701,7 +701,7 @@ udf_create_primaryd(void) if (pri == NULL) return ENOMEM; - bzero(pri, context.sector_size); + memset(pri, 0, context.sector_size); udf_inittag(&pri->tag, TAGID_PRI_VOL, /* loc */ 0); pri->seq_num = udf_rw32(context.vds_seq); context.vds_seq++; @@ -1928,7 +1928,6 @@ udf_create_new_efe(struct extfile_entry { struct extfile_entry *efe; struct icb_tag *icb; - uint32_t fidsize; uint32_t crclen; /* XXX: should be 16; need to detect overflow */ uint16_t icbflags; @@ -1990,7 +1989,6 @@ udf_create_new_efe(struct extfile_entry udf_set_regid(&efe->imp_id, context.impl_name); udf_add_impl_regid(&efe->imp_id); - fidsize = 0; efe->unique_id = udf_rw64(context.unique_id); udf_advance_uniqueid(); @@ -2092,7 +2090,7 @@ udf_create_meta_files(void) sector_size = context.sector_size; - bzero(&meta_icb, sizeof(struct long_ad)); + memset(&meta_icb, 0, sizeof(meta_icb)); meta_icb.len = udf_rw32(sector_size); meta_icb.loc.part_num = udf_rw16(context.data_part); @@ -2159,7 +2157,7 @@ udf_create_new_rootdir(union dscrptr **d struct long_ad root_icb; int filetype, error; - bzero(&root_icb, sizeof(struct long_ad)); + memset(&root_icb, 0, sizeof(root_icb)); root_icb.len = udf_rw32(context.sector_size); root_icb.loc.lb_num = udf_rw32(layout.rootdir); root_icb.loc.part_num = udf_rw16(context.metadata_part); Index: src/sbin/raidctl/raidctl.c diff -u src/sbin/raidctl/raidctl.c:1.55 src/sbin/raidctl/raidctl.c:1.56 --- src/sbin/raidctl/raidctl.c:1.55 Wed Oct 12 12:45:37 2011 +++ src/sbin/raidctl/raidctl.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $ */ +/* $NetBSD: raidctl.c,v 1.56 2013/10/19 01:09:59 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $"); +__RCSID("$NetBSD: raidctl.c,v 1.56 2013/10/19 01:09:59 christos Exp $"); #endif @@ -104,7 +104,6 @@ main(int argc,char *argv[]) int do_output; int do_recon; int do_rewrite; - int is_clean; int raidID; int serial_number; struct stat st; @@ -117,7 +116,6 @@ main(int argc,char *argv[]) do_output = 0; do_recon = 0; do_rewrite = 0; - is_clean = 0; serial_number = 0; force = 0; openmode = O_RDWR; /* default to read/write */ Index: src/sbin/rcorder/rcorder.c diff -u src/sbin/rcorder/rcorder.c:1.16 src/sbin/rcorder/rcorder.c:1.17 --- src/sbin/rcorder/rcorder.c:1.16 Sun Aug 3 03:49:46 2008 +++ src/sbin/rcorder/rcorder.c Fri Oct 18 21:09:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rcorder.c,v 1.16 2008/08/03 07:49:46 lukem Exp $ */ +/* $NetBSD: rcorder.c,v 1.17 2013/10/19 01:09:59 christos Exp $ */ /* * Copyright (c) 1998, 1999 Matthew R. Green @@ -668,7 +668,7 @@ keep_ok(filenode *fnode) void do_file(filenode *fnode) { - f_reqnode *r, *r_tmp; + f_reqnode *r; f_provnode *p, *p_tmp; provnode *pnode; int was_set; @@ -695,7 +695,9 @@ do_file(filenode *fnode) */ r = fnode->req_list; while (r != NULL) { - r_tmp = r; +#if 0 + f_reqnode *r_tmp = r; +#endif satisfy_req(r, fnode->filename); r = r->next; #if 0