From 9ebf1fa4d289270412412c1971d9ca6c74d76780 Mon Sep 17 00:00:00 2001 From: he Date: Thu, 8 Mar 2007 21:50:25 +0000 Subject: [PATCH] Cast to char* to be able to do pointer arithmetic. --- sys/arch/newsmips/newsmips/disksubr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/arch/newsmips/newsmips/disksubr.c b/sys/arch/newsmips/newsmips/disksubr.c index f43e8d67e731..23f8ff2a9d24 100644 --- a/sys/arch/newsmips/newsmips/disksubr.c +++ b/sys/arch/newsmips/newsmips/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.24 2006/11/25 11:59:57 scw Exp $ */ +/* $NetBSD: disksubr.c,v 1.25 2007/03/08 21:50:25 he Exp $ */ /* * Copyright (c) 1982, 1986, 1988 Regents of the University of California. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.24 2006/11/25 11:59:57 scw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.25 2007/03/08 21:50:25 he Exp $"); #include #include @@ -87,7 +87,8 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, if (biowait(bp)) msg = "I/O error"; else for (dlp = (struct disklabel *)bp->b_data; - dlp <= (struct disklabel *)(bp->b_data + DEV_BSIZE - sizeof(*dlp)); + dlp <= (struct disklabel *)((char *)bp->b_data + DEV_BSIZE - + sizeof(*dlp)); dlp = (struct disklabel *)((char *)dlp + sizeof(long))) { if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) { if (msg == NULL) @@ -172,7 +173,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, goto done; for (dlp = (struct disklabel *)bp->b_data; dlp <= (struct disklabel *) - (bp->b_data + lp->d_secsize - sizeof(*dlp)); + ((char *)bp->b_data + lp->d_secsize - sizeof(*dlp)); dlp = (struct disklabel *)((char *)dlp + sizeof(long))) { if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC && dkcksum(dlp) == 0) {