From 6cf69fee189857ae6f85cd3f81a6a58364839942 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 13:31:15 +0000 Subject: r24994: Fix some C++ warnings. (This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39) --- source4/librpc/rpc/dcerpc.c | 2 +- source4/librpc/rpc/dcerpc_smb.c | 20 ++++++++++---------- source4/librpc/rpc/dcerpc_smb2.c | 12 ++++++------ source4/librpc/rpc/dcerpc_sock.c | 10 +++++----- source4/librpc/tools/ndrdump.c | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source4/librpc') diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 984cc20fbc..160b9772f4 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -959,7 +959,7 @@ static struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p, req->recv_handler = NULL; if (object != NULL) { - req->object = talloc_memdup(req, object, sizeof(*object)); + req->object = talloc_memdup(req, (void *)object, sizeof(*object)); if (req->object == NULL) { talloc_free(req); return NULL; diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c index 5064e998dd..f629410bf1 100644 --- a/source4/librpc/rpc/dcerpc_smb.c +++ b/source4/librpc/rpc/dcerpc_smb.c @@ -39,7 +39,7 @@ struct smb_private { */ static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; if (smb->dead) { return; @@ -141,7 +141,7 @@ static void smb_read_callback(struct smbcli_request *req) */ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; union smb_read *io; struct smb_read_state *state; struct smbcli_request *req; @@ -197,7 +197,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO */ static NTSTATUS send_read_request(struct dcerpc_connection *c) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; if (smb->dead) { return NT_STATUS_CONNECTION_DISCONNECTED; @@ -220,7 +220,7 @@ struct smb_trans_state { */ static void smb_trans_callback(struct smbcli_request *req) { - struct smb_trans_state *state = req->async.private; + struct smb_trans_state *state = (struct smb_trans_state *)req->async.private; struct dcerpc_connection *c = state->c; NTSTATUS status; @@ -249,7 +249,7 @@ static void smb_trans_callback(struct smbcli_request *req) */ static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *blob) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; struct smb_trans2 *trans; uint16_t setup[2]; struct smb_trans_state *state; @@ -297,7 +297,7 @@ static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *b */ static void smb_write_callback(struct smbcli_request *req) { - struct dcerpc_connection *c = req->async.private; + struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private; if (!NT_STATUS_IS_OK(req->status)) { DEBUG(0,("dcerpc_smb: write callback error\n")); @@ -312,7 +312,7 @@ static void smb_write_callback(struct smbcli_request *req) */ static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, BOOL trigger_read) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; union smb_write io; struct smbcli_request *req; @@ -356,7 +356,7 @@ static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, B */ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; union smb_close io; struct smbcli_request *req; @@ -382,7 +382,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status) */ static const char *smb_peer_name(struct dcerpc_connection *c) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; return smb->server_name; } @@ -400,7 +400,7 @@ static const char *smb_target_hostname(struct dcerpc_connection *c) */ static NTSTATUS smb_session_key(struct dcerpc_connection *c, DATA_BLOB *session_key) { - struct smb_private *smb = c->transport.private_data; + struct smb_private *smb = (struct smb_private *)c->transport.private_data; if (smb->tree->session->user_session_key.data) { *session_key = smb->tree->session->user_session_key; diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c index dcfee1f223..615c96c905 100644 --- a/source4/librpc/rpc/dcerpc_smb2.c +++ b/source4/librpc/rpc/dcerpc_smb2.c @@ -41,7 +41,7 @@ struct smb2_private { */ static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status) { - struct smb2_private *smb = c->transport.private_data; + struct smb2_private *smb = (struct smb2_private *)c->transport.private_data; if (smb->dead) { return; @@ -145,7 +145,7 @@ static void smb2_read_callback(struct smb2_request *req) */ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob) { - struct smb2_private *smb = c->transport.private_data; + struct smb2_private *smb = (struct smb2_private *)c->transport.private_data; struct smb2_read io; struct smb2_read_state *state; struct smb2_request *req; @@ -190,7 +190,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO */ static NTSTATUS send_read_request(struct dcerpc_connection *c) { - struct smb2_private *smb = c->transport.private_data; + struct smb2_private *smb = (struct smb2_private *)c->transport.private_data; if (smb->dead) { return NT_STATUS_CONNECTION_DISCONNECTED; @@ -280,7 +280,7 @@ static NTSTATUS smb2_send_trans_request(struct dcerpc_connection *c, DATA_BLOB * */ static void smb2_write_callback(struct smb2_request *req) { - struct dcerpc_connection *c = req->async.private; + struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private; if (!NT_STATUS_IS_OK(req->status)) { DEBUG(0,("dcerpc_smb2: write callback error\n")); @@ -296,7 +296,7 @@ static void smb2_write_callback(struct smb2_request *req) static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, BOOL trigger_read) { - struct smb2_private *smb = c->transport.private_data; + struct smb2_private *smb = (struct smb2_private *)c->transport.private_data; struct smb2_write io; struct smb2_request *req; @@ -328,7 +328,7 @@ static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, */ static NTSTATUS smb2_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status) { - struct smb2_private *smb = c->transport.private_data; + struct smb2_private *smb = (struct smb2_private *)c->transport.private_data; struct smb2_close io; struct smb2_request *req; diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index a5abf9b4be..974cbd2692 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -45,7 +45,7 @@ struct sock_private { */ static void sock_dead(struct dcerpc_connection *p, NTSTATUS status) { - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; if (!sock) return; @@ -111,7 +111,7 @@ static NTSTATUS sock_process_recv(void *private, DATA_BLOB blob) { struct dcerpc_connection *p = talloc_get_type(private, struct dcerpc_connection); - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; sock->pending_reads--; if (sock->pending_reads == 0) { packet_recv_disable(sock->packet); @@ -128,7 +128,7 @@ static void sock_io_handler(struct event_context *ev, struct fd_event *fde, { struct dcerpc_connection *p = talloc_get_type(private, struct dcerpc_connection); - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; if (flags & EVENT_FD_WRITE) { packet_queue_run(sock->packet); @@ -149,7 +149,7 @@ static void sock_io_handler(struct event_context *ev, struct fd_event *fde, */ static NTSTATUS sock_send_read(struct dcerpc_connection *p) { - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; sock->pending_reads++; if (sock->pending_reads == 1) { packet_recv_enable(sock->packet); @@ -163,7 +163,7 @@ static NTSTATUS sock_send_read(struct dcerpc_connection *p) static NTSTATUS sock_send_request(struct dcerpc_connection *p, DATA_BLOB *data, BOOL trigger_read) { - struct sock_private *sock = p->transport.private_data; + struct sock_private *sock = (struct sock_private *)p->transport.private_data; DATA_BLOB blob; NTSTATUS status; diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c index 8a5e55f91e..bd9d860c84 100644 --- a/source4/librpc/tools/ndrdump.c +++ b/source4/librpc/tools/ndrdump.c @@ -50,7 +50,7 @@ static const struct ndr_interface_call *find_function( #if (_SAMBA_BUILD_ >= 4) -static void show_pipes(void) +_NORETURN_ static void show_pipes(void) { const struct ndr_interface_list *l; printf("\nYou must specify a pipe\n"); @@ -67,7 +67,7 @@ static void show_pipes(void) #endif -static void show_functions(const struct ndr_interface_table *p) +_NORETURN_ static void show_functions(const struct ndr_interface_table *p) { int i; printf("\nYou must specify a function\n"); -- cgit