Module Name:    src
Committed By:   lukem
Date:           Sat Apr 11 07:31:21 UTC 2009

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

Log Message:
fix sign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/fsck_ffs/dir.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/dir.c
diff -u src/sbin/fsck_ffs/dir.c:1.51 src/sbin/fsck_ffs/dir.c:1.52
--- src/sbin/fsck_ffs/dir.c:1.51	Tue Jul  8 08:14:37 2008
+++ src/sbin/fsck_ffs/dir.c	Sat Apr 11 07:31:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.51 2008/07/08 08:14:37 simonb Exp $	*/
+/*	$NetBSD: dir.c,v 1.52 2009/04/11 07:31:21 lukem Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)dir.c	8.8 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: dir.c,v 1.51 2008/07/08 08:14:37 simonb Exp $");
+__RCSID("$NetBSD: dir.c,v 1.52 2009/04/11 07:31:21 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -198,7 +198,7 @@
 	idesc->id_loc = 0;
 	for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
 		dsize = iswap16(dp->d_reclen);
-		if (dsize > sizeof dbuf)
+		if (dsize > (int)sizeof dbuf)
 			dsize = sizeof dbuf;
 		memmove(dbuf, dp, (size_t)dsize);
 #		if (BYTE_ORDER == LITTLE_ENDIAN)
@@ -727,7 +727,7 @@
 		    btodb(sblock->fs_bsize));
 		dirblk = iswap32(dp1->di_db[lastbn + 1]);
 	}
-	bp = getdirblk(dirblk, sblksize(sblock, DIP(dp, size), lastbn + 1));
+	bp = getdirblk(dirblk, sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
 	if (bp->b_errs)
 		goto bad;
 	memmove(firstblk, bp->b_un.b_buf, dirblksiz);
@@ -741,7 +741,7 @@
 	     cp += dirblksiz)
 		memmove(cp, &emptydir, sizeof emptydir);
 	dirty(bp);
-	bp = getdirblk(dirblk, sblksize(sblock, DIP(dp, size), lastbn + 1));
+	bp = getdirblk(dirblk, sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
 	if (bp->b_errs)
 		goto bad;
 	memmove(bp->b_un.b_buf, &emptydir, sizeof emptydir);

Reply via email to