Module Name:    src
Committed By:   lukem
Date:           Sat Apr 11 06:53:53 UTC 2009

Modified Files:
        src/sbin/fsdb: fsdb.c fsdb.h fsdbutil.c

Log Message:
fix sign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sbin/fsdb/fsdb.c
cvs rdiff -u -r1.10 -r1.11 src/sbin/fsdb/fsdb.h
cvs rdiff -u -r1.21 -r1.22 src/sbin/fsdb/fsdbutil.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/fsdb/fsdb.c
diff -u src/sbin/fsdb/fsdb.c:1.38 src/sbin/fsdb/fsdb.c:1.39
--- src/sbin/fsdb/fsdb.c:1.38	Sat Aug 30 10:46:16 2008
+++ src/sbin/fsdb/fsdb.c	Sat Apr 11 06:53:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsdb.c,v 1.38 2008/08/30 10:46:16 bouyer Exp $	*/
+/*	$NetBSD: fsdb.c,v 1.39 2009/04/11 06:53:53 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fsdb.c,v 1.38 2008/08/30 10:46:16 bouyer Exp $");
+__RCSID("$NetBSD: fsdb.c,v 1.39 2009/04/11 06:53:53 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -566,7 +566,7 @@
 				{
 				uint64_t size = iswap64(DIP(curinode, size));
 				if (size > 0 &&
-				    size < sblock->fs_maxsymlinklen &&
+				    size < (uint64_t)sblock->fs_maxsymlinklen &&
 				    DIP(curinode, blocks) == 0)
 					continue;
 				else
@@ -672,7 +672,7 @@
 {
 #define MAXNINDIR	(MAXBSIZE / sizeof(uint32_t))
 	uint32_t idblk[MAXNINDIR];
-	int i;
+	size_t i;
 
 	bread(fsreadfd, (char *)idblk, fsbtodb(sblock, blk),
 	    (int)sblock->fs_bsize);
@@ -718,7 +718,7 @@
 {
 #define MAXNINDIR	(MAXBSIZE / sizeof(uint64_t))
 	uint64_t idblk[MAXNINDIR];
-	int i;
+	size_t i;
 
 	bread(fsreadfd, (char *)idblk, fsbtodb(sblock, blk),
 	    (int)sblock->fs_bsize);

Index: src/sbin/fsdb/fsdb.h
diff -u src/sbin/fsdb/fsdb.h:1.10 src/sbin/fsdb/fsdb.h:1.11
--- src/sbin/fsdb/fsdb.h:1.10	Mon Apr 28 20:23:08 2008
+++ src/sbin/fsdb/fsdb.h	Sat Apr 11 06:53:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsdb.h,v 1.10 2008/04/28 20:23:08 martin Exp $	*/
+/*	$NetBSD: fsdb.h,v 1.11 2009/04/11 06:53:53 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -42,8 +42,8 @@
 struct cmdtable {
 	const char *cmd;
 	const char *helptxt;
-	unsigned int minargc;
-	unsigned int maxargc;
+	int minargc;
+	int maxargc;
 	int (*handler)(int argc, char *argv[]);
 };
 extern union dinode *curinode;

Index: src/sbin/fsdb/fsdbutil.c
diff -u src/sbin/fsdb/fsdbutil.c:1.21 src/sbin/fsdb/fsdbutil.c:1.22
--- src/sbin/fsdb/fsdbutil.c:1.21	Mon Dec 29 20:02:30 2008
+++ src/sbin/fsdb/fsdbutil.c	Sat Apr 11 06:53:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsdbutil.c,v 1.21 2008/12/29 20:02:30 mlelstv Exp $	*/
+/*	$NetBSD: fsdbutil.c,v 1.22 2009/04/11 06:53:53 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fsdbutil.c,v 1.21 2008/12/29 20:02:30 mlelstv Exp $");
+__RCSID("$NetBSD: fsdbutil.c,v 1.22 2009/04/11 06:53:53 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -124,7 +124,7 @@
 		break;
 	case IFLNK:
 		fputs("symlink", stdout);
-		if (size > 0 && size < sblock->fs_maxsymlinklen &&
+		if (size > 0 && size < (uint64_t)sblock->fs_maxsymlinklen &&
 		    DIP(dp, blocks) == 0) {
 			p = is_ufs2 ? (char *)dp->dp2.di_db :
 			    (char *)dp->dp1.di_db;

Reply via email to