summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-05-12 11:45:37 -0700
committerJeremy Allison <jra@samba.org>2009-05-12 11:45:37 -0700
commitad9d64ee1b9e4cd4324b62c2bb2fd2eec9743e30 (patch)
tree0e96079ae72d9e24fcfd10cb54ce71fd002fb206
parent196084d641bf5ede94373c3681835d28b3ac9ee3 (diff)
downloadsamba-ad9d64ee1b9e4cd4324b62c2bb2fd2eec9743e30.tar.gz
samba-ad9d64ee1b9e4cd4324b62c2bb2fd2eec9743e30.tar.bz2
samba-ad9d64ee1b9e4cd4324b62c2bb2fd2eec9743e30.zip
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.
-rw-r--r--source3/lib/sendfile.c8
-rw-r--r--source3/lib/util_sock.c4
-rw-r--r--source3/lib/wb_reqtrans.c8
-rw-r--r--source3/libsmb/async_smb.c12
-rw-r--r--source3/libsmb/cliconnect.c4
-rw-r--r--source3/libsmb/clientgen.c4
-rw-r--r--source3/libsmb/clifile.c2
-rw-r--r--source3/libsmb/clireadwrite.c4
-rw-r--r--source3/libsmb/clitrans.c10
-rw-r--r--source3/modules/onefs_system.c4
-rw-r--r--source3/modules/vfs_aio_fork.c4
11 files changed, 32 insertions, 32 deletions
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;
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 17040b8c9f..9fdd14793f 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -496,11 +496,11 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
SSVAL(state->bytecount_buf, 0, iov_len(bytes_iov, iov_count));
- state->iov[0].iov_base = state->header;
+ state->iov[0].iov_base = (void *)state->header;
state->iov[0].iov_len = sizeof(state->header);
- state->iov[1].iov_base = state->vwv;
+ state->iov[1].iov_base = (void *)state->vwv;
state->iov[1].iov_len = wct * sizeof(uint16_t);
- state->iov[2].iov_base = state->bytecount_buf;
+ state->iov[2].iov_base = (void *)state->bytecount_buf;
state->iov[2].iov_len = sizeof(uint16_t);
if (iov_count != 0) {
@@ -584,7 +584,7 @@ static bool cli_smb_req_iov_send(struct tevent_req *req,
if (buf == NULL) {
return false;
}
- iov[0].iov_base = buf;
+ iov[0].iov_base = (void *)buf;
iov[0].iov_len = talloc_get_size(buf);
subreq = writev_send(state, state->ev, state->cli->outgoing,
state->cli->fd, iov, 1);
@@ -623,7 +623,7 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req;
struct iovec iov;
- iov.iov_base = CONST_DISCARD(char *, bytes);
+ iov.iov_base = CONST_DISCARD(void *, bytes);
iov.iov_len = num_bytes;
req = cli_smb_req_create(mem_ctx, ev, cli, smb_command,
@@ -1023,7 +1023,7 @@ bool cli_smb_chain_send(struct tevent_req **reqs, int num_reqs)
* last byte.
*/
this_iov[0].iov_len = chain_padding+1;
- this_iov[0].iov_base = &state->header[
+ this_iov[0].iov_base = (void *)&state->header[
sizeof(state->header) - this_iov[0].iov_len];
memset(this_iov[0].iov_base, 0, this_iov[0].iov_len-1);
}
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 7a8a93078d..38985363c2 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -219,7 +219,7 @@ struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
return NULL;
}
- state->bytes.iov_base = bytes;
+ state->bytes.iov_base = (void *)bytes;
state->bytes.iov_len = talloc_get_size(bytes);
subreq = cli_smb_req_create(state, ev, cli, SMBsesssetupX, 0, 13, vwv,
@@ -1367,7 +1367,7 @@ struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
return NULL;
}
- state->bytes.iov_base = bytes;
+ state->bytes.iov_base = (void *)bytes;
state->bytes.iov_len = talloc_get_size(bytes);
subreq = cli_smb_req_create(state, ev, cli, SMBtconX, 0, 4, vwv,
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index b06a6fa187..bc2a092de3 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -422,9 +422,9 @@ bool cli_send_smb_direct_writeX(struct cli_state *cli,
return false;
}
- iov[0].iov_base = cli->outbuf;
+ iov[0].iov_base = (void *)cli->outbuf;
iov[0].iov_len = len;
- iov[1].iov_base = CONST_DISCARD(char *, p);
+ iov[1].iov_base = CONST_DISCARD(void *, p);
iov[1].iov_len = extradata;
nwritten = write_data_iov(cli->fd, iov, 2);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index fdfa257ec8..63e6c474db 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1465,7 +1465,7 @@ struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- state->bytes.iov_base = bytes;
+ state->bytes.iov_base = (void *)bytes;
state->bytes.iov_len = talloc_get_size(bytes);
subreq = cli_smb_req_create(state, ev, cli, SMBopenX, additional_flags,
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 07d438fd25..4e256ede57 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -848,9 +848,9 @@ struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
}
state->pad = 0;
- state->iov[0].iov_base = &state->pad;
+ state->iov[0].iov_base = (void *)&state->pad;
state->iov[0].iov_len = 1;
- state->iov[1].iov_base = CONST_DISCARD(uint8_t *, buf);
+ state->iov[1].iov_base = CONST_DISCARD(void *, buf);
state->iov[1].iov_len = size;
subreq = cli_smb_req_create(state, ev, cli, SMBwriteX, 0, wct, vwv,
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index 8fc7a5269f..d6d78cc6c3 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -860,9 +860,9 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
switch (cmd) {
case SMBtrans:
pad[0] = 0;
- iov[0].iov_base = pad;
+ iov[0].iov_base = (void *)pad;
iov[0].iov_len = 1;
- iov[1].iov_base = state->pipe_name_conv;
+ iov[1].iov_base = (void *)state->pipe_name_conv;
iov[1].iov_len = state->pipe_name_conv_len;
wct = 14 + state->num_setup;
param_offset += iov[0].iov_len + iov[1].iov_len;
@@ -872,7 +872,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
pad[0] = 0;
pad[1] = 'D'; /* Copy this from "old" 3.0 behaviour */
pad[2] = ' ';
- iov[0].iov_base = pad;
+ iov[0].iov_base = (void *)pad;
iov[0].iov_len = 3;
wct = 14 + state->num_setup;
param_offset += 3;
@@ -897,7 +897,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
if (state->param_sent < state->num_param) {
this_param = MIN(state->num_param - state->param_sent,
useable_space);
- iov[0].iov_base = state->param + state->param_sent;
+ iov[0].iov_base = (void *)(state->param + state->param_sent);
iov[0].iov_len = this_param;
iov += 1;
}
@@ -905,7 +905,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
if (state->data_sent < state->num_data) {
this_data = MIN(state->num_data - state->data_sent,
useable_space - this_param);
- iov[0].iov_base = state->data + state->data_sent;
+ iov[0].iov_base = (void *)(state->data + state->data_sent);
iov[0].iov_len = this_data;
iov += 1;
}
diff --git a/source3/modules/onefs_system.c b/source3/modules/onefs_system.c
index cf99a27a87..22ef2f481b 100644
--- a/source3/modules/onefs_system.c
+++ b/source3/modules/onefs_system.c
@@ -231,7 +231,7 @@ static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd,
/* 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;
@@ -293,7 +293,7 @@ static ssize_t onefs_sys_do_sendfile(int tofd, int fromfd,
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/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index e29ce5e7a8..8568ec3916 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -135,7 +135,7 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
msg.msg_name = NULL;
msg.msg_namelen = 0;
- iov[0].iov_base = ptr;
+ iov[0].iov_base = (void *)ptr;
iov[0].iov_len = nbytes;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
@@ -206,7 +206,7 @@ static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd)
msg.msg_namelen = 0;
ZERO_STRUCT(iov);
- iov[0].iov_base = ptr;
+ iov[0].iov_base = (void *)ptr;
iov[0].iov_len = nbytes;
msg.msg_iov = iov;
msg.msg_iovlen = 1;