Avoid using void pointers in additive expressions.
PR: 56653
This commit is contained in:
parent
6cbea71c82
commit
4eae39bfdf
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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: */
|
||||
|
Loading…
Reference in New Issue
Block a user