Module Name:    src
Committed By:   lukem
Date:           Sun Apr 19 00:56:32 UTC 2009

Modified Files:
        src/usr.sbin/vnconfig: vnconfig.c

Log Message:
Fix -Wcast-qual and -Wshadow issues


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/vnconfig/vnconfig.c

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

Modified files:

Index: src/usr.sbin/vnconfig/vnconfig.c
diff -u src/usr.sbin/vnconfig/vnconfig.c:1.36 src/usr.sbin/vnconfig/vnconfig.c:1.37
--- src/usr.sbin/vnconfig/vnconfig.c:1.36	Mon Dec 29 03:49:17 2008
+++ src/usr.sbin/vnconfig/vnconfig.c	Sun Apr 19 00:56:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnconfig.c,v 1.36 2008/12/29 03:49:17 christos Exp $	*/
+/*	$NetBSD: vnconfig.c,v 1.37 2009/04/19 00:56:32 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -199,7 +199,8 @@
 			usage();
 		rv = config(argv[0], NULL, NULL, action);
 	} else { /* VND_GET */
-		char *vn, path[64];
+		const char *vn;
+		char path[64];
 		struct vnd_user vnu;
 		int v, n;
 
@@ -227,19 +228,19 @@
 			else {
 				char *dev;
 				struct statvfs *mnt = NULL;
-				int i, n;
+				int i, nmount;
 
-				n = 0;	/* XXXGCC -Wuninitialized */
+				nmount = 0;	/* XXXGCC -Wuninitialized */
 
 				printf("vnd%d: ", vnu.vnu_unit);
 
 				dev = devname(vnu.vnu_dev, S_IFBLK);
 				if (dev != NULL)
-					n = getmntinfo(&mnt, MNT_NOWAIT);
+					nmount = getmntinfo(&mnt, MNT_NOWAIT);
 				else
 					mnt = NULL;
 				if (mnt != NULL) {
-					for (i = 0; i < n; i++) {
+					for (i = 0; i < nmount; i++) {
 						if (strncmp(
 						    mnt[i].f_mntfromname,
 						    "/dev/", 5) == 0 &&
@@ -248,7 +249,7 @@
 						    dev) == 0)
 							break;
 					}
-					if (i < n)
+					if (i < nmount)
 						printf("%s (%s) ",
 						    mnt[i].f_mntonname,
 						    mnt[i].f_mntfromname);

Reply via email to