Cast to char* before doing pointer arithmetic.

This commit is contained in:
he 2007-03-08 23:56:45 +00:00
parent 856d1c9da0
commit bf9a718b25
2 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf.c,v 1.13 2007/03/04 06:02:30 christos Exp $ */
/* $NetBSD: rf.c,v 1.14 2007/03/08 23:56:45 he Exp $ */
/*
* Copyright (c) 2002 Jochen Kunz.
* All rights reserved.
@ -36,7 +36,7 @@ TODO:
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.13 2007/03/04 06:02:30 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.14 2007/03/08 23:56:45 he Exp $");
/* autoconfig stuff */
#include <sys/param.h>
@ -735,7 +735,8 @@ rfc_intr(void *intarg)
}
if (rfc_sc->sc_bytesleft > i) {
rfc_sc->sc_bytesleft -= i;
rfc_sc->sc_bufidx += i;
rfc_sc->sc_bufidx =
(char *)rfc_sc->sc_bufidx + i;
} else {
biodone(rfc_sc->sc_curbuf);
rf_sc = get_new_buf( rfc_sc);
@ -777,7 +778,8 @@ rfc_intr(void *intarg)
}
if (rfc_sc->sc_bytesleft > i) {
rfc_sc->sc_bytesleft -= i;
rfc_sc->sc_bufidx += i;
rfc_sc->sc_bufidx =
(char *)rfc_sc->sc_bufidx + i;
} else {
biodone(rfc_sc->sc_curbuf);
rf_sc = get_new_buf( rfc_sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rl.c,v 1.31 2007/03/04 06:02:30 christos Exp $ */
/* $NetBSD: rl.c,v 1.32 2007/03/09 00:02:53 he Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.31 2007/03/04 06:02:30 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.32 2007/03/09 00:02:53 he Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -702,7 +702,7 @@ rlcstart(struct rlc_softc *sc, struct buf *ob)
RL_WREG(RL_BA, (sc->sc_dmam->dm_segs[0].ds_addr & 0xffff));
/* Count up vars */
sc->sc_bufaddr += (blks*DEV_BSIZE);
sc->sc_bufaddr = (char*)sc->sc_bufaddr + (blks*DEV_BSIZE);
sc->sc_diskblk += blks;
sc->sc_bytecnt -= (blks*DEV_BSIZE);