From 5a9e72a72bb71c430a9cac48a9694a9440082d5e Mon Sep 17 00:00:00 2001 From: Stefan Farfeleder Date: Sun, 3 Oct 2004 15:58:20 +0000 Subject: [PATCH] Don't add integers to void pointers. --- lib/libstand/dosfs.c | 2 +- lib/libstand/ext2fs.c | 2 +- lib/libstand/read.c | 2 +- lib/libstand/sbrk.c | 4 ++-- lib/libstand/splitfs.c | 2 +- lib/libstand/tftp.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libstand/dosfs.c b/lib/libstand/dosfs.c index 41547c83c727..161d33008376 100644 --- a/lib/libstand/dosfs.c +++ b/lib/libstand/dosfs.c @@ -277,7 +277,7 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid) f->offset += n; f->c = c; off = 0; - buf += n; + buf = (char *)buf + n; cnt -= n; } out: diff --git a/lib/libstand/ext2fs.c b/lib/libstand/ext2fs.c index 153f1639c789..1bd78e20acb1 100644 --- a/lib/libstand/ext2fs.c +++ b/lib/libstand/ext2fs.c @@ -834,7 +834,7 @@ ext2fs_read(struct open_file *f, void *addr, size_t size, size_t *resid) bcopy(buf, addr, csize); fp->f_seekp += csize; - addr += csize; + addr = (char *)addr + csize; size -= csize; } if (resid) diff --git a/lib/libstand/read.c b/lib/libstand/read.c index 07401c1e8341..09e24e1f6f87 100644 --- a/lib/libstand/read.c +++ b/lib/libstand/read.c @@ -108,7 +108,7 @@ read(int fd, void *dest, size_t bcount) resid -= ccount; if (resid == 0) return(bcount); - dest += ccount; + dest = (char *)dest + ccount; } /* will filling the readahead buffer again not help? */ diff --git a/lib/libstand/sbrk.c b/lib/libstand/sbrk.c index b6245f96f8fc..93d94e482451 100644 --- a/lib/libstand/sbrk.c +++ b/lib/libstand/sbrk.c @@ -42,7 +42,7 @@ setheap(void *base, void *top) { /* Align start address to 16 bytes for the malloc code. Sigh. */ heapbase = (void *)(((uintptr_t)base + 15) & ~15); - maxheap = top - heapbase; + maxheap = (char *)top - (char *)heapbase; } char * @@ -51,7 +51,7 @@ sbrk(int incr) char *ret; if ((heapsize + incr) <= maxheap) { - ret = heapbase + heapsize; + ret = (char *)heapbase + heapsize; bzero(ret, incr); heapsize += incr; return(ret); diff --git a/lib/libstand/splitfs.c b/lib/libstand/splitfs.c index 35593ad05cfd..9adcdec96f6a 100644 --- a/lib/libstand/splitfs.c +++ b/lib/libstand/splitfs.c @@ -207,7 +207,7 @@ splitfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) sf->tot_pos += nread; sf->file_pos += nread; totread += nread; - buf += nread; + buf = (char *)buf + nread; if (totread < size) { /* EOF */ if (sf->curfile == (sf->filesc - 1)) /* Last slice */ diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c index 3a6630c87c5e..0cbfa520a4ff 100644 --- a/lib/libstand/tftp.c +++ b/lib/libstand/tftp.c @@ -340,7 +340,7 @@ tftp_read(f, addr, size, resid) bcopy(tftpfile->lastdata.t.th_data + offinblock, addr, count); - addr += count; + addr = (char *)addr + count; tftpfile->off += count; size -= count;