Don't add integers to void pointers.

This commit is contained in:
Stefan Farfeleder 2004-10-03 15:58:20 +00:00
parent 4c86f66f52
commit 5a9e72a72b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136093
6 changed files with 7 additions and 7 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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? */

View File

@ -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);

View File

@ -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 */

View File

@ -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;