Wed Apr 1 10:17:04 2009 UTC ()
fix sign-compare issue


(lukem)
diff -r1.45 -r1.46 src/sys/sys/bootblock.h

cvs diff -r1.45 -r1.46 src/sys/sys/bootblock.h (expand / switch to unified diff)

--- src/sys/sys/bootblock.h 2008/04/28 20:24:10 1.45
+++ src/sys/sys/bootblock.h 2009/04/01 10:17:04 1.46
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bootblock.h,v 1.45 2008/04/28 20:24:10 martin Exp $ */ 1/* $NetBSD: bootblock.h,v 1.46 2009/04/01 10:17:04 lukem Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002-2004 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -777,27 +777,27 @@ struct alpha_boot_block { @@ -777,27 +777,27 @@ struct alpha_boot_block {
777#define bb_secstart bb_data[61] /* secondary start (blocks) */ 777#define bb_secstart bb_data[61] /* secondary start (blocks) */
778#define bb_flags bb_data[62] /* unknown flags (set to zero) */ 778#define bb_flags bb_data[62] /* unknown flags (set to zero) */
779 779
780#define ALPHA_BOOT_BLOCK_OFFSET 0 /* offset of boot block. */ 780#define ALPHA_BOOT_BLOCK_OFFSET 0 /* offset of boot block. */
781#define ALPHA_BOOT_BLOCK_BLOCKSIZE 512 /* block size for sector 781#define ALPHA_BOOT_BLOCK_BLOCKSIZE 512 /* block size for sector
782 * size/start, and for boot 782 * size/start, and for boot
783 * block itself. 783 * block itself.
784 */ 784 */
785 785
786#define ALPHA_BOOT_BLOCK_CKSUM(bb,cksum) \ 786#define ALPHA_BOOT_BLOCK_CKSUM(bb,cksum) \
787 do { \ 787 do { \
788 const struct alpha_boot_block *_bb = (bb); \ 788 const struct alpha_boot_block *_bb = (bb); \
789 uint64_t _cksum; \ 789 uint64_t _cksum; \
790 int _i; \ 790 size_t _i; \
791 \ 791 \
792 _cksum = 0; \ 792 _cksum = 0; \
793 for (_i = 0; \ 793 for (_i = 0; \
794 _i < (sizeof _bb->bb_data / sizeof _bb->bb_data[0]); \ 794 _i < (sizeof _bb->bb_data / sizeof _bb->bb_data[0]); \
795 _i++) \ 795 _i++) \
796 _cksum += _bb->bb_data[_i]; \ 796 _cksum += _bb->bb_data[_i]; \
797 *(cksum) = _cksum; \ 797 *(cksum) = _cksum; \
798 } while (/*CONSTCOND*/ 0) 798 } while (/*CONSTCOND*/ 0)
799 799
800/* ------------------------------------------ 800/* ------------------------------------------
801 * apple -- 801 * apple --
802 * Apple computers boot block related information 802 * Apple computers boot block related information
803 */ 803 */