From ad9d64ee1b9e4cd4324b62c2bb2fd2eec9743e30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 2009 11:45:37 -0700 Subject: Clean up assignments to iov_base, ensure it's always cast to void *. This should quieten some warnings with picky compilers on the buildfarm. Jeremy. --- source3/lib/sendfile.c | 8 ++++---- source3/lib/util_sock.c | 4 ++-- source3/lib/wb_reqtrans.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/sendfile.c b/source3/lib/sendfile.c index 59a18ce6e1..3003246dd0 100644 --- a/source3/lib/sendfile.c +++ b/source3/lib/sendfile.c @@ -274,7 +274,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of if (header) { /* Set up the header/trailer iovec. */ - hdtrl[0].iov_base = header->data; + hdtrl[0].iov_base = (void *)header->data; hdtrl[0].iov_len = hdr_len = header->length; } else { hdtrl[0].iov_base = NULL; @@ -320,7 +320,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl[0].iov_len = 0; } else { /* iov_base is defined as a void *... */ - hdtrl[0].iov_base = ((char *)hdtrl[0].iov_base) + nwritten; + hdtrl[0].iov_base = (void *)(((char *)hdtrl[0].iov_base) + nwritten); hdtrl[0].iov_len -= nwritten; nwritten = 0; } @@ -351,7 +351,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of /* Set up the header iovec. */ if (header) { - hdtrl.iov_base = header->data; + hdtrl.iov_base = (void *)header->data; hdtrl.iov_len = hdr_len = header->length; } else { hdtrl.iov_base = NULL; @@ -392,7 +392,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl.iov_len = 0; } else { hdtrl.iov_base = - (caddr_t)hdtrl.iov_base + nwritten; + (void *)((caddr_t)hdtrl.iov_base + nwritten); hdtrl.iov_len -= nwritten; nwritten = 0; } diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 3fd0cc4ad3..92e373b4ea 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -680,7 +680,7 @@ ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt) if (thistime < iov[0].iov_len) { char *new_base = (char *)iov[0].iov_base + thistime; - iov[0].iov_base = new_base; + iov[0].iov_base = (void *)new_base; iov[0].iov_len -= thistime; break; } @@ -709,7 +709,7 @@ ssize_t write_data(int fd, const char *buffer, size_t N) ssize_t ret; struct iovec iov; - iov.iov_base = CONST_DISCARD(char *, buffer); + iov.iov_base = CONST_DISCARD(void *, buffer); iov.iov_len = N; ret = write_data_iov(fd, &iov, 1); diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c index c11561f14e..df92ecf8b0 100644 --- a/source3/lib/wb_reqtrans.c +++ b/source3/lib/wb_reqtrans.c @@ -143,11 +143,11 @@ struct tevent_req *wb_req_write_send(TALLOC_CTX *mem_ctx, return NULL; } - state->iov[0].iov_base = wb_req; + state->iov[0].iov_base = (void *)wb_req; state->iov[0].iov_len = sizeof(struct winbindd_request); if (wb_req->extra_len != 0) { - state->iov[1].iov_base = wb_req->extra_data.data; + state->iov[1].iov_base = (void *)wb_req->extra_data.data; state->iov[1].iov_len = wb_req->extra_len; count = 2; } @@ -299,11 +299,11 @@ struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx, return NULL; } - state->iov[0].iov_base = wb_resp; + state->iov[0].iov_base = (void *)wb_resp; state->iov[0].iov_len = sizeof(struct winbindd_response); if (wb_resp->length > sizeof(struct winbindd_response)) { - state->iov[1].iov_base = wb_resp->extra_data.data; + state->iov[1].iov_base = (void *)wb_resp->extra_data.data; state->iov[1].iov_len = wb_resp->length - sizeof(struct winbindd_response); count = 2; -- cgit