Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2001 12:05:12 -0400 (EDT)
From:      Mike Barcroft <mike@q9media.com>
To:        audit@FreeBSD.org
Cc:        mckusick@FreeBSD.org
Subject:   src/sbin/tunefs patch
Message-ID:  <200107061605.f66G5C611666@coffee.q9media.com>

next in thread | raw e-mail | index | archive | help
I would appreciate it if someone would review and commit the patch at
the end of this message.  Also available at:
http://testbed.q9media.net/freebsd/tunefs.20010706.patch

Best regards,
Mike Barcroft

-----------------------------------------------------------------------

tunefs.20010706.patch

o Constify
o Remove register storage-classes
o Set WARNS?=2
o Untested on Alpha

Index: tunefs/Makefile
===================================================================
RCS file: /home/ncvs/src/sbin/tunefs/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- tunefs/Makefile	2001/03/26 14:33:26	1.4
+++ tunefs/Makefile	2001/07/06 15:33:35
@@ -2,6 +2,7 @@
 # $FreeBSD: src/sbin/tunefs/Makefile,v 1.4 2001/03/26 14:33:26 ru Exp $
 
 PROG=	tunefs
+WARNS?=	2
 MAN=	tunefs.8
 
 .include <bsd.prog.mk>
Index: tunefs/tunefs.c
===================================================================
RCS file: /home/ncvs/src/sbin/tunefs/tunefs.c,v
retrieving revision 1.17
diff -u -r1.17 tunefs.c
--- tunefs/tunefs.c	2001/04/13 23:54:49	1.17
+++ tunefs/tunefs.c	2001/07/06 15:33:35
@@ -76,10 +76,10 @@
 int fi;
 long dev_bsize = 1;
 
-void bwrite __P((daddr_t, char *, int));
+void bwrite __P((daddr_t, const char *, int));
 int bread __P((daddr_t, char *, int));
-void getsb __P((struct fs *, char *));
-void putsb __P((struct fs *, char *, int));
+void getsb __P((struct fs *, const char *));
+void putsb __P((struct fs *, const char *, int));
 void usage __P((void));
 void printfs __P((void));
 
@@ -88,7 +88,8 @@
 	int argc;
 	char *argv[];
 {
-	char *special, *name;
+	char *special;
+	const char *name;
 	struct stat st;
 	int Aflag = 0, active = 0;
 	int aflag = 0, dflag = 0, eflag = 0, fflag = 0, mflag = 0;
@@ -97,7 +98,8 @@
 	int mvalue = 0, ovalue = 0, svalue = 0;
 	char *nvalue = NULL; 
 	struct fstab *fs;
-	char *chg[2], device[MAXPATHLEN];
+	const char *chg[2];
+	char device[MAXPATHLEN];
 	struct ufs_args args;
 	struct statfs stfs;
 	int found_arg, ch;
@@ -357,8 +359,8 @@
 
 void
 getsb(fs, file)
-	register struct fs *fs;
-	char *file;
+	struct fs *fs;
+	const char *file;
 {
 
 	fi = open(file, O_RDONLY);
@@ -373,8 +375,8 @@
 
 void
 putsb(fs, file, all)
-	register struct fs *fs;
-	char *file;
+	struct fs *fs;
+	const char *file;
 	int all;
 {
 	int i;
@@ -389,11 +391,11 @@
 	close(i);
 	if (fi < 0)
 		err(3, "cannot open %s", file);
-	bwrite((daddr_t)SBOFF / dev_bsize, (char *)fs, SBSIZE);
+	bwrite((daddr_t)SBOFF / dev_bsize, (const char *)fs, SBSIZE);
 	if (all)
 		for (i = 0; i < fs->fs_ncg; i++)
 			bwrite(fsbtodb(fs, cgsblock(fs, i)),
-			    (char *)fs, SBSIZE);
+			    (const char *)fs, SBSIZE);
 	close(fi);
 }
 
@@ -427,7 +429,7 @@
 void
 bwrite(blk, buf, size)
 	daddr_t blk;
-	char *buf;
+	const char *buf;
 	int size;
 {
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




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