diff options
author | stefanf <stefanf@FreeBSD.org> | 2004-08-14 17:46:10 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2004-08-14 17:46:10 +0000 |
commit | bcdeb8e73ca7fe84a2caa06a504cae1e779e25af (patch) | |
tree | be6242cdf28f91c19a82810c41a57128a3771413 | |
parent | c7e2313e865d292a348f00799e7c73cb552cda10 (diff) | |
download | FreeBSD-src-bcdeb8e73ca7fe84a2caa06a504cae1e779e25af.zip FreeBSD-src-bcdeb8e73ca7fe84a2caa06a504cae1e779e25af.tar.gz |
Avoid using void pointers in additive expressions.
PR: 56653
-rw-r--r-- | lib/libc/gen/opendir.c | 2 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_write.c | 3 | ||||
-rw-r--r-- | lib/libc_r/uthread/uthread_writev.c | 4 | ||||
-rw-r--r-- | sbin/ldconfig/ldconfig.c | 4 | ||||
-rw-r--r-- | sbin/ping/ping.c | 2 |
5 files changed, 9 insertions, 6 deletions
diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index 3b6f1a0..c076abb 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -97,7 +97,7 @@ __opendir2(name, flags) (dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) goto fail; - dirp->dd_td = (void *)dirp + sizeof(DIR); + dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); LIST_INIT(&dirp->dd_td->td_locq); dirp->dd_td->td_loccnt = 0; diff --git a/lib/libc_r/uthread/uthread_write.c b/lib/libc_r/uthread/uthread_write.c index 573e78e..0b1e4a0 100644 --- a/lib/libc_r/uthread/uthread_write.c +++ b/lib/libc_r/uthread/uthread_write.c @@ -78,7 +78,8 @@ _write(int fd, const void *buf, size_t nbytes) */ while (ret == 0) { /* Perform a non-blocking write syscall: */ - n = __sys_write(fd, buf + num, nbytes - num); + n = __sys_write(fd, (const char *)buf + num, + nbytes - num); /* Check if one or more bytes were written: */ if (n > 0) diff --git a/lib/libc_r/uthread/uthread_writev.c b/lib/libc_r/uthread/uthread_writev.c index 77046d5..31d2b8c 100644 --- a/lib/libc_r/uthread/uthread_writev.c +++ b/lib/libc_r/uthread/uthread_writev.c @@ -134,7 +134,9 @@ _writev(int fd, const struct iovec * iov, int iovcnt) * for the next write: */ p_iov[idx].iov_len -= cnt; - p_iov[idx].iov_base += cnt; + p_iov[idx].iov_base = + (char *)p_iov[idx].iov_base + + cnt; cnt = 0; } } diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 5c0eb1d..d6c889b 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -578,8 +578,8 @@ readhints() } close(fd); - blist = (struct hints_bucket *)(addr + hdr->hh_hashtab); - strtab = (char *)(addr + hdr->hh_strtab); + blist = (struct hints_bucket *)((char *)addr + hdr->hh_hashtab); + strtab = (char *)addr + hdr->hh_strtab; if (hdr->hh_version >= LD_HINTS_VERSION_2) add_search_path(strtab + hdr->hh_dirlist); diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 12b8dad..d312721 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -947,7 +947,7 @@ pr_pack(buf, cc, from, tv) #else tp = icp->icmp_data; #endif - tp += phdr_len; + tp = (const char *)tp + phdr_len; if (cc - ICMP_MINLEN - phdr_len >= sizeof(tv1)) { /* Copy to avoid alignment problems: */ |