NetBSD Problem Report #46004

From www@NetBSD.org  Sun Feb 12 11:54:08 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id BC9D263E02D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 12 Feb 2012 11:54:07 +0000 (UTC)
Message-Id: <20120212115407.155A263E028@www.NetBSD.org>
Date: Sun, 12 Feb 2012 11:54:07 +0000 (UTC)
From: henning.petersen@t-online.de
Reply-To: henning.petersen@t-online.de
To: gnats-bugs@NetBSD.org
Subject: Remove unused variables.
X-Send-Pr-Version: www-1.0

>Number:         46004
>Category:       bin
>Synopsis:       Remove unused variables.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 12 11:55:00 +0000 2012
>Closed-Date:    Mon Feb 13 13:00:24 +0000 2012
>Last-Modified:  Mon Feb 13 13:20:02 +0000 2012
>Originator:     Henning Petersen
>Release:        NetBSD-current
>Organization:
>Environment:
Remove unused variables.
Found by cppcheck.
>Description:

>How-To-Repeat:

>Fix:
diff -u -p -r1.110 mkfs.c
--- sbin/newfs/mkfs.c	25 Aug 2011 16:17:58 -0000	1.110
+++ sbin/newfs/mkfs.c	11 Jan 2012 07:21:54 -0000
@@ -1335,11 +1335,10 @@ static void
 iput(union dinode *ip, ino_t ino)
 {
 	daddr_t d;
-	int c, i;
+	int i;
 	struct ufs1_dinode *dp1;
 	struct ufs2_dinode *dp2;

-	c = ino_to_cg(&sblock, ino);
 	rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize, &acg);
 	/* fs -> host byte order */
 	if (needswap)
===================================================================
diff -u -p -r1.109 newfs.c
--- sbin/newfs/newfs.c	6 Mar 2011 17:08:17 -0000	1.109
+++ sbin/newfs/newfs.c	11 Jan 2012 07:21:54 -0000
@@ -239,7 +239,7 @@ 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 = 0;
 #ifdef MFS
@@ -255,7 +255,6 @@ main(int argc, char *argv[])
 	gid_t mfsgid = 0;	/* group wheel */
 	mntoptparse_t mo;

-	cp = NULL;
 	fsi = fso = -1;
 	Fflag = Iflag = Zflag = 0;
 	verbosity = -1;

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 13 Feb 2012 13:00:24 +0000
State-Changed-Why:
Committed, thanks!


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46004 CVS commit: src/sbin/newfs
Date: Mon, 13 Feb 2012 12:59:56 +0000

 Module Name:	src
 Committed By:	wiz
 Date:		Mon Feb 13 12:59:56 UTC 2012

 Modified Files:
 	src/sbin/newfs: mkfs.c newfs.c

 Log Message:
 Remove unused variables.
 From cppcheck via Henning Petersen in PR 46004.


 To generate a diff of this commit:
 cvs rdiff -u -r1.111 -r1.112 src/sbin/newfs/mkfs.c
 cvs rdiff -u -r1.109 -r1.110 src/sbin/newfs/newfs.c

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.