From 656849c6842fbb2305fa4793dea55b32328de214 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 16 Feb 2009 04:58:55 +0100 Subject: [PATCH] Unbreak kernel build and fix some warnings. --- sys/kern/kern_memio.c | 2 +- sys/kern/kern_msfbuf.c | 2 +- sys/kern/kern_physio.c | 2 +- sys/kern/kern_subr.c | 11 +++++++---- sys/kern/libmchain/subr_mchain.c | 4 ++-- sys/kern/sys_pipe.c | 2 +- sys/vfs/isofs/cd9660/cd9660_vnops.c | 2 +- sys/vfs/nfs/nfs_subs.c | 4 ++-- sys/vfs/nfs/nfs_vnops.c | 18 +++++++++--------- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_memio.c b/sys/kern/kern_memio.c index 14788ee318..d345d9085f 100644 --- a/sys/kern/kern_memio.c +++ b/sys/kern/kern_memio.c @@ -298,7 +298,7 @@ mmrw(cdev_t dev, struct uio *uio, int flags) } if (error) break; - iov->iov_base += c; + iov->iov_base = (char *)iov->iov_base + c; iov->iov_len -= c; uio->uio_offset += c; uio->uio_resid -= c; diff --git a/sys/kern/kern_msfbuf.c b/sys/kern/kern_msfbuf.c index 8a73e58c1f..4f26358c5e 100644 --- a/sys/kern/kern_msfbuf.c +++ b/sys/kern/kern_msfbuf.c @@ -362,7 +362,7 @@ msf_uio_iterate(struct uio *uio, bytes = iov->iov_len - offset; if (bytes + pgoff > XIO_INTERNAL_SIZE) bytes = XIO_INTERNAL_SIZE - pgoff; - error = msf_map_ubuf(&msf, iov->iov_base + offset, bytes, 0); + error = msf_map_ubuf(&msf, (char *)iov->iov_base + offset, bytes, 0); if (error) break; error = callback(info, msf_buf_kva(msf), bytes); diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index fec0e7fa09..58e66d1e64 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -156,7 +156,7 @@ physio(cdev_t dev, struct uio *uio, int ioflag) if (iolen == 0 && !(bp->b_flags & B_ERROR)) goto doerror; /* EOF */ uio->uio_iov[i].iov_len -= iolen; - uio->uio_iov[i].iov_base += iolen; + uio->uio_iov[i].iov_base = (char *)uio->uio_iov[i].iov_base + iolen; uio->uio_resid -= iolen; uio->uio_offset += iolen; if (bp->b_flags & B_ERROR) { diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 6678eabc1c..87c68f4bbf 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -123,7 +123,7 @@ uiomove(caddr_t cp, int n, struct uio *uio) case UIO_NOCOPY: break; } - iov->iov_base += cnt; + iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; uio->uio_offset += cnt; @@ -206,7 +206,7 @@ uiomoveco(caddr_t cp, int n, struct uio *uio, struct vm_object *obj) case UIO_NOCOPY: break; } - iov->iov_base += cnt; + iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; uio->uio_offset += cnt; @@ -223,6 +223,7 @@ int ureadc(int c, struct uio *uio) { struct iovec *iov; + char *iov_base; again: if (uio->uio_iovcnt == 0 || uio->uio_resid == 0) @@ -241,13 +242,15 @@ again: break; case UIO_SYSSPACE: - *iov->iov_base = c; + iov_base = iov->iov_base; + *iov_base = c; + iov->iov_base = iov_base; break; case UIO_NOCOPY: break; } - iov->iov_base++; + iov->iov_base = (char *)iov->iov_base + 1; iov->iov_len--; uio->uio_resid--; uio->uio_offset++; diff --git a/sys/kern/libmchain/subr_mchain.c b/sys/kern/libmchain/subr_mchain.c index 8a41a888b5..ac008bfa8b 100644 --- a/sys/kern/libmchain/subr_mchain.c +++ b/sys/kern/libmchain/subr_mchain.c @@ -295,7 +295,7 @@ mb_put_uio(struct mbchain *mbp, struct uio *uiop, int size) return error; uiop->uio_offset += left; uiop->uio_resid -= left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; size -= left; } @@ -546,7 +546,7 @@ md_get_uio(struct mdchain *mdp, struct uio *uiop, int size) return error; uiop->uio_offset += left; uiop->uio_resid -= left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; size -= left; } diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 0292f19cf2..a256737a3b 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -703,7 +703,7 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio) */ size = wpipe->pipe_map.xio_bytes; uio->uio_iov->iov_len -= size; - uio->uio_iov->iov_base += size; + uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + size; if (uio->uio_iov->iov_len == 0) uio->uio_iov++; uio->uio_resid -= size; diff --git a/sys/vfs/isofs/cd9660/cd9660_vnops.c b/sys/vfs/isofs/cd9660/cd9660_vnops.c index c27ccb08af..bc8bca6826 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vnops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vnops.c @@ -736,7 +736,7 @@ cd9660_readlink(struct vop_readlink_args *ap) return (error); } uio->uio_resid -= symlen; - uio->uio_iov->iov_base += symlen; + uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + symlen; uio->uio_iov->iov_len -= symlen; return (0); } diff --git a/sys/vfs/nfs/nfs_subs.c b/sys/vfs/nfs/nfs_subs.c index 3e67bc3aa7..5c65067e24 100644 --- a/sys/vfs/nfs/nfs_subs.c +++ b/sys/vfs/nfs/nfs_subs.c @@ -782,7 +782,7 @@ nfsm_mbuftouio(struct mbuf **mrep, struct uio *uiop, int siz, caddr_t *dpos) uiop->uio_iovcnt--; uiop->uio_iov++; } else { - uiop->uio_iov->iov_base += uiosiz; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + uiosiz; uiop->uio_iov->iov_len -= uiosiz; } siz -= uiosiz; @@ -859,7 +859,7 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos) uiop->uio_offset += xfer; uiop->uio_resid -= xfer; } - uiop->uio_iov->iov_base += uiosiz; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + uiosiz; uiop->uio_iov->iov_len -= uiosiz; siz -= uiosiz; } diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index 5434c7fb52..1e1e284da9 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -1328,7 +1328,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, int *iomode, int *must_commit) break; } else if (rlen < len) { backup = len - rlen; - uiop->uio_iov->iov_base -= backup; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base - backup; uiop->uio_iov->iov_len += backup; uiop->uio_offset -= backup; uiop->uio_resid += backup; @@ -2279,7 +2279,7 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop) left = DIRBLKSIZ - blksiz; if ((tlen + sizeof(struct nfs_dirent)) > left) { dp->nfs_reclen += left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; uiop->uio_offset += left; uiop->uio_resid -= left; @@ -2298,7 +2298,7 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop) blksiz = 0; uiop->uio_offset += sizeof(struct nfs_dirent); uiop->uio_resid -= sizeof(struct nfs_dirent); - uiop->uio_iov->iov_base += sizeof(struct nfs_dirent); + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + sizeof(struct nfs_dirent); uiop->uio_iov->iov_len -= sizeof(struct nfs_dirent); nfsm_mtouio(uiop, len); @@ -2310,7 +2310,7 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop) cp = uiop->uio_iov->iov_base; tlen -= len; *cp = '\0'; /* null terminate */ - uiop->uio_iov->iov_base += tlen; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + tlen; uiop->uio_iov->iov_len -= tlen; uiop->uio_offset += tlen; uiop->uio_resid -= tlen; @@ -2362,7 +2362,7 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop) if (blksiz > 0) { left = DIRBLKSIZ - blksiz; dp->nfs_reclen += left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; uiop->uio_offset += left; uiop->uio_resid -= left; @@ -2485,7 +2485,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop) left = DIRBLKSIZ - blksiz; if ((tlen + sizeof(struct nfs_dirent)) > left) { dp->nfs_reclen += left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; uiop->uio_offset += left; uiop->uio_resid -= left; @@ -2504,7 +2504,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop) blksiz = 0; uiop->uio_offset += sizeof(struct nfs_dirent); uiop->uio_resid -= sizeof(struct nfs_dirent); - uiop->uio_iov->iov_base += sizeof(struct nfs_dirent); + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + sizeof(struct nfs_dirent); uiop->uio_iov->iov_len -= sizeof(struct nfs_dirent); nlc.nlc_nameptr = uiop->uio_iov->iov_base; nlc.nlc_namelen = len; @@ -2512,7 +2512,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop) cp = uiop->uio_iov->iov_base; tlen -= len; *cp = '\0'; - uiop->uio_iov->iov_base += tlen; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + tlen; uiop->uio_iov->iov_len -= tlen; uiop->uio_offset += tlen; uiop->uio_resid -= tlen; @@ -2610,7 +2610,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop) if (blksiz > 0) { left = DIRBLKSIZ - blksiz; dp->nfs_reclen += left; - uiop->uio_iov->iov_base += left; + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + left; uiop->uio_iov->iov_len -= left; uiop->uio_offset += left; uiop->uio_resid -= left; -- 2.11.4.GIT