Module Name: src Committed By: dsl Date: Sat Jan 2 18:06:58 UTC 2010
Modified Files: src/distrib/utils/sysinst: aout2elf.c disks.c util.c wskbd.c src/distrib/utils/sysinst/arch/acorn32: md.c src/distrib/utils/sysinst/arch/cobalt: md.c src/distrib/utils/sysinst/arch/hp300: md.c src/distrib/utils/sysinst/arch/i386: md.c src/distrib/utils/sysinst/arch/mac68k: md.c menus.md.en Log Message: Fix some of the sign-compare fubar. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/sysinst/aout2elf.c cvs rdiff -u -r1.109 -r1.110 src/distrib/utils/sysinst/disks.c cvs rdiff -u -r1.161 -r1.162 src/distrib/utils/sysinst/util.c cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/sysinst/wskbd.c cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/sysinst/arch/acorn32/md.c cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/sysinst/arch/cobalt/md.c cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/sysinst/arch/hp300/md.c cvs rdiff -u -r1.123 -r1.124 src/distrib/utils/sysinst/arch/i386/md.c cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/sysinst/arch/mac68k/md.c cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/sysinst/arch/mac68k/menus.md.en Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/utils/sysinst/aout2elf.c diff -u src/distrib/utils/sysinst/aout2elf.c:1.14 src/distrib/utils/sysinst/aout2elf.c:1.15 --- src/distrib/utils/sysinst/aout2elf.c:1.14 Sun Aug 16 17:12:48 2009 +++ src/distrib/utils/sysinst/aout2elf.c Sat Jan 2 18:06:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: aout2elf.c,v 1.14 2009/08/16 17:12:48 pgoyette Exp $ +/* $NetBSD: aout2elf.c,v 1.15 2010/01/02 18:06:57 dsl Exp $ * * Copyright 1997 Piermont Information Systems Inc. * All rights reserved. @@ -100,7 +100,7 @@ if (fd < 0) { return 0; } - if (read(fd, &ex, sizeof ex) < sizeof ex) { + if (read(fd, &ex, sizeof ex) - sizeof ex != 0) { close(fd); return 0; } @@ -116,7 +116,7 @@ handle_aout_x_libs(const char *srcdir, const char *tgtdir) { char src[MAXPATHLEN]; - int i; + unsigned int i; for (i = 0; i < (sizeof x_libs / sizeof (const char *)); i++) { snprintf(src, MAXPATHLEN, "%s/%s", srcdir, x_libs[i]); Index: src/distrib/utils/sysinst/disks.c diff -u src/distrib/utils/sysinst/disks.c:1.109 src/distrib/utils/sysinst/disks.c:1.110 --- src/distrib/utils/sysinst/disks.c:1.109 Sun Oct 18 12:09:48 2009 +++ src/distrib/utils/sysinst/disks.c Sat Jan 2 18:06:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.109 2009/10/18 12:09:48 ahoka Exp $ */ +/* $NetBSD: disks.c,v 1.110 2010/01/02 18:06:57 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -518,11 +518,11 @@ int make_filesystems(void) { - int i; + unsigned int i; int ptn; int ptn_order[nelem(bsdlabel)]; int error = 0; - int maxpart = getmaxpartitions(); + unsigned int maxpart = getmaxpartitions(); char *newfs; const char *mnt_opts; const char *fsname; Index: src/distrib/utils/sysinst/util.c diff -u src/distrib/utils/sysinst/util.c:1.161 src/distrib/utils/sysinst/util.c:1.162 --- src/distrib/utils/sysinst/util.c:1.161 Fri Oct 9 21:11:31 2009 +++ src/distrib/utils/sysinst/util.c Sat Jan 2 18:06:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.161 2009/10/09 21:11:31 snj Exp $ */ +/* $NetBSD: util.c,v 1.162 2010/01/02 18:06:57 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -157,7 +157,7 @@ static const uint8_t sets_selected_full[] = {MD_SETS_SELECTED}; static const uint8_t sets_selected_minimal[] = {MD_SETS_SELECTED_MINIMAL}; static const uint8_t *sets_selected; - int nelem_selected; + unsigned int nelem_selected; unsigned int i, len; const char *longest; Index: src/distrib/utils/sysinst/wskbd.c diff -u src/distrib/utils/sysinst/wskbd.c:1.7 src/distrib/utils/sysinst/wskbd.c:1.8 --- src/distrib/utils/sysinst/wskbd.c:1.7 Wed Sep 3 08:52:36 2008 +++ src/distrib/utils/sysinst/wskbd.c Sat Jan 2 18:06:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbd.c,v 1.7 2008/09/03 08:52:36 ghen Exp $ */ +/* $NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: wskbd.c,v 1.7 2008/09/03 08:52:36 ghen Exp $"); +__RCSID("$NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $"); #include <unistd.h> #include <stdlib.h> @@ -89,7 +89,7 @@ get_kb_encoding(void) { int fd; - int i; + unsigned int i; int kb_menu; kbd_t kbdencoding; menu_ent opt[nelem(kb_types)]; Index: src/distrib/utils/sysinst/arch/acorn32/md.c diff -u src/distrib/utils/sysinst/arch/acorn32/md.c:1.24 src/distrib/utils/sysinst/arch/acorn32/md.c:1.25 --- src/distrib/utils/sysinst/arch/acorn32/md.c:1.24 Sat Sep 19 14:57:27 2009 +++ src/distrib/utils/sysinst/arch/acorn32/md.c Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.24 2009/09/19 14:57:27 abs Exp $ */ +/* $NetBSD: md.c,v 1.25 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -98,7 +98,7 @@ } if (lseek(fd, (off_t)FILECORE_BOOT_SECTOR * DEV_BSIZE, SEEK_SET) < 0 - || read(fd, bb, sizeof(bb)) < sizeof(bb)) { + || read(fd, bb, sizeof(bb)) - sizeof(bb) != 0) { endwin(); fprintf(stderr, msg_string(MSG_badreadbb)); close(fd); @@ -131,7 +131,7 @@ int loop; if (lseek(fd, (off_t)offset * DEV_BSIZE, SEEK_SET) < 0 - || read(fd, bb, sizeof(bb)) < sizeof(bb)) { + || read(fd, bb, sizeof(bb)) - sizeof(bb) != 0) { endwin(); fprintf(stderr, msg_string(MSG_badreadriscix)); close(fd); Index: src/distrib/utils/sysinst/arch/cobalt/md.c diff -u src/distrib/utils/sysinst/arch/cobalt/md.c:1.5 src/distrib/utils/sysinst/arch/cobalt/md.c:1.6 --- src/distrib/utils/sysinst/arch/cobalt/md.c:1.5 Sat Sep 19 14:57:28 2009 +++ src/distrib/utils/sysinst/arch/cobalt/md.c Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.5 2009/09/19 14:57:28 abs Exp $ */ +/* $NetBSD: md.c,v 1.6 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -274,7 +274,7 @@ }; static const char *bootfile = "boot.gz"; char bootdir[64]; - int i; + unsigned int i; if (!nobootfs) { msg_display(msg_string(MSG_copybootloader), diskdev); Index: src/distrib/utils/sysinst/arch/hp300/md.c diff -u src/distrib/utils/sysinst/arch/hp300/md.c:1.27 src/distrib/utils/sysinst/arch/hp300/md.c:1.28 --- src/distrib/utils/sysinst/arch/hp300/md.c:1.27 Sat Sep 19 14:57:28 2009 +++ src/distrib/utils/sysinst/arch/hp300/md.c Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.27 2009/09/19 14:57:28 abs Exp $ */ +/* $NetBSD: md.c,v 1.28 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -135,7 +135,8 @@ md_check_partitions(void) { /* hp300 partitions must be in order of the range. */ - int part, start, last; + int part, last; + uint32_t start; start = 0; last = PART_A - 1; Index: src/distrib/utils/sysinst/arch/i386/md.c diff -u src/distrib/utils/sysinst/arch/i386/md.c:1.123 src/distrib/utils/sysinst/arch/i386/md.c:1.124 --- src/distrib/utils/sysinst/arch/i386/md.c:1.123 Sat Sep 19 14:57:28 2009 +++ src/distrib/utils/sysinst/arch/i386/md.c Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.123 2009/09/19 14:57:28 abs Exp $ */ +/* $NetBSD: md.c,v 1.124 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -335,7 +335,7 @@ process_menu(MENU_getboottype, &boottype); msg_display(MSG_dobootblks, diskdev); - if (bp.bp_consdev == ~0) + if (bp.bp_consdev == ~0u) return 0; ret = cp_to_target("/usr/mdec/boot", "/boot"); @@ -368,7 +368,7 @@ if (pwrite(td, bootxx, 512, 0) != 512) goto bad_bootxx; len -= 512 * 2; - if (pwrite(td, bootxx + 512 * 2, len, 2 * (off_t)512) != len) + if (pwrite(td, bootxx + 512 * 2, len, 2 * (off_t)512) - len != 0) goto bad_bootxx; ret = 0; Index: src/distrib/utils/sysinst/arch/mac68k/md.c diff -u src/distrib/utils/sysinst/arch/mac68k/md.c:1.55 src/distrib/utils/sysinst/arch/mac68k/md.c:1.56 --- src/distrib/utils/sysinst/arch/mac68k/md.c:1.55 Sat Sep 19 14:57:29 2009 +++ src/distrib/utils/sysinst/arch/mac68k/md.c Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.55 2009/09/19 14:57:29 abs Exp $ */ +/* $NetBSD: md.c,v 1.56 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -200,7 +200,7 @@ * to see if the disk have a Boot Block */ if (lseek(fd, (off_t)0 * blk_size, SEEK_SET) < 0 || - read(fd, &block, sizeof(block)) < sizeof(block) || + read(fd, &block, sizeof(block)) - sizeof(block) != 0 || block.pmSig != 0x4552) { process_menu(MENU_nodiskmap, NULL); } @@ -626,7 +626,7 @@ if (part->pmSig != APPLE_PART_MAP_ENTRY_MAGIC) return 0; maxsiz = sizeof(part->pmPartType); - if (maxsiz > sizeof(partyp)) + if (maxsiz > (int)sizeof(partyp)) maxsiz = sizeof(partyp); strncpy(partyp, (char *)part->pmPartType, maxsiz); partyp[maxsiz-1] = '\0'; Index: src/distrib/utils/sysinst/arch/mac68k/menus.md.en diff -u src/distrib/utils/sysinst/arch/mac68k/menus.md.en:1.22 src/distrib/utils/sysinst/arch/mac68k/menus.md.en:1.23 --- src/distrib/utils/sysinst/arch/mac68k/menus.md.en:1.22 Sat Jan 2 17:15:07 2010 +++ src/distrib/utils/sysinst/arch/mac68k/menus.md.en Sat Jan 2 18:06:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.22 2010/01/02 17:15:07 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.23 2010/01/02 18:06:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -89,7 +89,7 @@ msg_display(MSG_split_part, map.blk[j].pmPartBlkCnt); msg_prompt_add (MSG_scratch_size, NULL, buf, sizeof(buf)); size = atoi(buf); - if (size > 0 && size < map.blk[j].pmPartBlkCnt) { + if (size > 0 && size < (int)map.blk[j].pmPartBlkCnt) { k = map.in_use_cnt+1; if (k <= map.size) { memcpy (&map.blk[k], &map.blk[j],