mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
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.
This commit is contained in:
parent
196084d641
commit
ad9d64ee1b
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user