CVS commit: src/sbin/svhlabel

2009-04-06 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon Apr  6 12:33:11 UTC 2009

Modified Files:
src/sbin/svhlabel: svhlabel.c

Log Message:
fix sign-compare issue


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/svhlabel/svhlabel.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/svhlabel/svhlabel.c
diff -u src/sbin/svhlabel/svhlabel.c:1.4 src/sbin/svhlabel/svhlabel.c:1.5
--- src/sbin/svhlabel/svhlabel.c:1.4	Sat Jun 30 02:05:27 2007
+++ src/sbin/svhlabel/svhlabel.c	Mon Apr  6 12:33:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: svhlabel.c,v 1.4 2007/06/30 02:05:27 rumble Exp $	*/
+/*	$NetBSD: svhlabel.c,v 1.5 2009/04/06 12:33:11 lukem Exp $	*/
 
 /*
  * Copyright (C) 2007 Stephen M. Rumble.
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: svhlabel.c,v 1.4 2007/06/30 02:05:27 rumble Exp $);
+__RCSID($NetBSD: svhlabel.c,v 1.5 2009/04/06 12:33:11 lukem Exp $);
 #endif /* not lint */
 
 #include stdio.h
@@ -153,7 +153,7 @@
 			break;
 
 		case SGI_PTYPE_VOLUME:
-			if (label.d_secperunit != vh-partitions[i].blocks)
+			if (label.d_secperunit != (uint32_t)vh-partitions[i].blocks)
 changed++;
 			label.d_secperunit = vh-partitions[i].blocks; 
 			continue;



CVS commit: src/sbin/wsconsctl

2009-04-06 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon Apr  6 12:35:21 UTC 2009

Modified Files:
src/sbin/wsconsctl: keysym.c map_parse.y util.c

Log Message:
fix sign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/wsconsctl/keysym.c
cvs rdiff -u -r1.7 -r1.8 src/sbin/wsconsctl/map_parse.y
cvs rdiff -u -r1.27 -r1.28 src/sbin/wsconsctl/util.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/wsconsctl/keysym.c
diff -u src/sbin/wsconsctl/keysym.c:1.8 src/sbin/wsconsctl/keysym.c:1.9
--- src/sbin/wsconsctl/keysym.c:1.8	Mon Apr 28 20:23:09 2008
+++ src/sbin/wsconsctl/keysym.c	Mon Apr  6 12:35:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: keysym.c,v 1.8 2008/04/28 20:23:09 martin Exp $ */
+/*	$NetBSD: keysym.c,v 1.9 2009/04/06 12:35:20 lukem Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -122,7 +122,7 @@
 static void
 sort_ksym_tab(void)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i  NUMKSYMS; i++)
 		ksym_tab_by_ksym[i] = ksym_tab_by_name[i];

Index: src/sbin/wsconsctl/map_parse.y
diff -u src/sbin/wsconsctl/map_parse.y:1.7 src/sbin/wsconsctl/map_parse.y:1.8
--- src/sbin/wsconsctl/map_parse.y:1.7	Mon Apr 28 20:23:09 2008
+++ src/sbin/wsconsctl/map_parse.y	Mon Apr  6 12:35:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: map_parse.y,v 1.7 2008/04/28 20:23:09 martin Exp $ */
+/*	$NetBSD: map_parse.y,v 1.8 2009/04/06 12:35:20 lukem Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -63,12 +63,12 @@
 struct wskbd_map_data newkbmap;		/* used in util.c */
 static struct wscons_keymap *cur_mp;
 
-static int ksym_lookup(keysym_t);
+static size_t ksym_lookup(keysym_t);
 
-static int
+static size_t
 ksym_lookup(keysym_t ksym)
 {
-	int i;
+	size_t i;
 	struct wscons_keymap *mp;
 
 	for (i = 0; i  kbmap.maplen; i++) {
@@ -124,7 +124,7 @@
 		;
 
 keysym_expr	: T_KEYSYM keysym_var = keysym_var = {
-			int src, dst;
+			size_t src, dst;
 
 			dst = ksym_lookup($2);
 			src = ksym_lookup($4);
@@ -137,7 +137,7 @@
 keycode_expr	: T_KEYCODE T_NUMBER = = {
 			if ($2 = KS_NUMKEYCODES)
 errx(EXIT_FAILURE, %d: keycode too large, $2);
-			if ($2 = newkbmap.maplen)
+			if ((unsigned int)$2 = newkbmap.maplen)
 newkbmap.maplen = $2 + 1;
 			cur_mp = mapdata + $2;
 		} keysym_cmd keysym_list

Index: src/sbin/wsconsctl/util.c
diff -u src/sbin/wsconsctl/util.c:1.27 src/sbin/wsconsctl/util.c:1.28
--- src/sbin/wsconsctl/util.c:1.27	Mon Apr 28 20:23:09 2008
+++ src/sbin/wsconsctl/util.c	Mon Apr  6 12:35:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.27 2008/04/28 20:23:09 martin Exp $ */
+/*	$NetBSD: util.c,v 1.28 2009/04/06 12:35:20 lukem Exp $ */
 
 /*-
  * Copyright (c) 1998, 2006 The NetBSD Foundation, Inc.
@@ -330,11 +330,12 @@
 	if (f == 0)
 		(void)printf(none);
 	else {
-		int i, first, mask;
+		unsigned int i;
+		int first, mask;
 
 		for (i = 0, first = 1, mask = 1; i  sizeof(f) * 8; i++) {
 			if (f  mask) {
-(void)printf(%s%d, first ?  :  , i);
+(void)printf(%s%u, first ?  :  , i);
 first = 0;
 			}
 			mask = mask  1;
@@ -396,14 +397,14 @@
 		if (merge) {
 			if (newkbmap.maplen  kbmap.maplen)
 newkbmap.maplen = kbmap.maplen;
-			for (i = 0; i  kbmap.maplen; i++) {
-mp = newkbmap.map + i;
+			for (u = 0; u  kbmap.maplen; u++) {
+mp = newkbmap.map + u;
 if (mp-command == KS_voidSymbol 
 mp-group1[0] == KS_voidSymbol 
 mp-group1[1] == KS_voidSymbol 
 mp-group2[0] == KS_voidSymbol 
 mp-group2[1] == KS_voidSymbol)
-	*mp = kbmap.map[i];
+	*mp = kbmap.map[u];
 			}
 		}
 		kbmap.maplen = newkbmap.maplen;
@@ -455,7 +456,7 @@
 			errx(EXIT_FAILURE, %s: not a valid number list, str);
 		if (errno == ERANGE  (lval == LONG_MAX || lval == LONG_MIN))
 			errx(EXIT_FAILURE, %s: not a valid number list, str);
-		if (lval = sizeof(result) * 8)
+		if (lval = (long)sizeof(result) * 8)
 			errx(EXIT_FAILURE, %ld: number out of range, lval);
 		result |= (1  lval);
 
@@ -470,7 +471,7 @@
 static void
 print_kmap(struct wskbd_map_data *map)
 {
-	int i;
+	unsigned int i;
 	struct wscons_keymap *mp;
 
 	for (i = 0; i  map-maplen; i++) {



CVS commit: src/sbin/fsck_ffs

2009-04-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr  7 05:50:11 UTC 2009

Modified Files:
src/sbin/fsck_ffs: setup.c

Log Message:
fix a logic error in the previous, as point out by frank kardel.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sbin/fsck_ffs/setup.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/fsck_ffs/setup.c
diff -u src/sbin/fsck_ffs/setup.c:1.86 src/sbin/fsck_ffs/setup.c:1.87
--- src/sbin/fsck_ffs/setup.c:1.86	Wed Mar 25 03:42:41 2009
+++ src/sbin/fsck_ffs/setup.c	Tue Apr  7 05:50:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.86 2009/03/25 03:42:41 mrg Exp $	*/
+/*	$NetBSD: setup.c,v 1.87 2009/04/07 05:50:11 mrg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)setup.c	8.10 (Berkeley) 5/9/95;
 #else
-__RCSID($NetBSD: setup.c,v 1.86 2009/03/25 03:42:41 mrg Exp $);
+__RCSID($NetBSD: setup.c,v 1.87 2009/04/07 05:50:11 mrg Exp $);
 #endif
 #endif /* not lint */
 
@@ -174,7 +174,7 @@
 		pwarn(USING ALTERNATE SUPERBLOCK AT %d\n, bflag);
 	}
 	if (sblock-fs_flags  FS_DOWAPBL) {
-		if (preen  !skipclean) {
+		if (preen  skipclean) {
 			if (!quiet)
 pwarn(file system is journaled; not checking\n);
 			return (-1);