summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-07-31 21:40:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:27 -0500
commit430fa0eba08cbf180d83740a895a0018af1c7f21 (patch)
tree0f51b6635f456a800a7fe609f30fdbd537460ee8 /source3/rpc_server
parente7952e9c14218d0c8c13973056ab8762876e5a79 (diff)
downloadsamba-430fa0eba08cbf180d83740a895a0018af1c7f21.tar.gz
samba-430fa0eba08cbf180d83740a895a0018af1c7f21.tar.bz2
samba-430fa0eba08cbf180d83740a895a0018af1c7f21.zip
r17348: Some C++ warnings
(This used to be commit ae6b9b34e59167e3958bfdb9997fa25340b9a0a3)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_echo_nt.c4
-rw-r--r--source3/rpc_server/srv_pipe.c7
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c20
3 files changed, 18 insertions, 13 deletions
diff --git a/source3/rpc_server/srv_echo_nt.c b/source3/rpc_server/srv_echo_nt.c
index 86fcce28c7..c861c74cc6 100644
--- a/source3/rpc_server/srv_echo_nt.c
+++ b/source3/rpc_server/srv_echo_nt.c
@@ -44,7 +44,7 @@ void _echo_data(pipes_struct *p, ECHO_Q_ECHO_DATA *q_u,
{
DEBUG(10, ("_echo_data\n"));
- r_u->data = TALLOC(p->mem_ctx, q_u->size);
+ r_u->data = (char *)TALLOC(p->mem_ctx, q_u->size);
r_u->size = q_u->size;
memcpy(r_u->data, q_u->data, q_u->size);
}
@@ -68,7 +68,7 @@ void _source_data(pipes_struct *p, ECHO_Q_SOURCE_DATA *q_u,
DEBUG(10, ("_source_data\n"));
- r_u->data = TALLOC(p->mem_ctx, q_u->size);
+ r_u->data = (char *)TALLOC(p->mem_ctx, q_u->size);
r_u->size = q_u->size;
for (i = 0; i < r_u->size; i++)
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index e2c5e865ed..74583f075b 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -679,8 +679,9 @@ static BOOL pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob)
p->pipe_user.ut.ngroups = a->server_info->n_groups;
if (p->pipe_user.ut.ngroups) {
- if (!(p->pipe_user.ut.groups = memdup(a->server_info->groups,
- sizeof(gid_t) * p->pipe_user.ut.ngroups))) {
+ if (!(p->pipe_user.ut.groups = (gid_t *)
+ memdup(a->server_info->groups,
+ sizeof(gid_t) * p->pipe_user.ut.ngroups))) {
DEBUG(0,("pipe_ntlmssp_verify_final: failed to memdup group list to p->pipe_user.groups\n"));
data_blob_free(&p->session_key);
return False;
@@ -2322,7 +2323,7 @@ BOOL api_rpcTNP(pipes_struct *p, const char *rpc_name,
if ((DEBUGLEVEL >= 10) &&
(prs_offset(&p->in_data.data) != prs_data_size(&p->in_data.data))) {
size_t data_len = prs_data_size(&p->in_data.data) - prs_offset(&p->in_data.data);
- char *data = SMB_MALLOC(data_len);
+ char *data = (char *)SMB_MALLOC(data_len);
DEBUG(10, ("api_rpcTNP: rpc input buffer underflow (parse error?)\n"));
if (data) {
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index cd0a4f2bb3..fc25614963 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -719,7 +719,8 @@ static void notify_system_time(struct spoolss_notify_msg *msg,
}
data->notify_data.data.length = prs_offset(&ps);
- data->notify_data.data.string = TALLOC(mem_ctx, prs_offset(&ps));
+ data->notify_data.data.string = (uint16 *)
+ TALLOC(mem_ctx, prs_offset(&ps));
if (!data->notify_data.data.string) {
prs_mem_free(&ps);
return;
@@ -911,7 +912,8 @@ static int notify_msg_ctr_addmsg( SPOOLSS_NOTIFY_MSG_CTR *ctr, SPOOLSS_NOTIFY_MS
/* need to allocate own copy of data */
if ( msg->len != 0 )
- msg_grp->msgs[new_slot].notify.data = TALLOC_MEMDUP( ctr->ctx, msg->notify.data, msg->len );
+ msg_grp->msgs[new_slot].notify.data = (char *)
+ TALLOC_MEMDUP( ctr->ctx, msg->notify.data, msg->len );
return ctr->num_groups;
}
@@ -1220,7 +1222,7 @@ void do_drv_upgrade_printer(int msg_type, struct process_id src, void *buf, size
int n_services = lp_numservices();
len = MIN(len,sizeof(drivername)-1);
- strncpy(drivername, buf, len);
+ strncpy(drivername, (const char *)buf, len);
DEBUG(10,("do_drv_upgrade_printer: Got message for new driver [%s]\n", drivername ));
@@ -1318,7 +1320,7 @@ void reset_all_printerdata(int msg_type, struct process_id src,
int n_services = lp_numservices();
len = MIN( len, sizeof(drivername)-1 );
- strncpy( drivername, buf, len );
+ strncpy( drivername, (const char *)buf, len );
DEBUG(10,("reset_all_printerdata: Got message for new driver [%s]\n", drivername ));
@@ -1381,7 +1383,7 @@ static DEVICEMODE* dup_devicemode(TALLOC_CTX *ctx, DEVICEMODE *devmode)
/* bulk copy first */
- d = TALLOC_MEMDUP(ctx, devmode, sizeof(DEVICEMODE));
+ d = (DEVICEMODE *)TALLOC_MEMDUP(ctx, devmode, sizeof(DEVICEMODE));
if (!d)
return NULL;
@@ -1408,7 +1410,8 @@ static DEVICEMODE* dup_devicemode(TALLOC_CTX *ctx, DEVICEMODE *devmode)
return NULL;
}
- d->dev_private = TALLOC_MEMDUP(ctx, devmode->dev_private, devmode->driverextra);
+ d->dev_private = (uint8 *)TALLOC_MEMDUP(ctx, devmode->dev_private,
+ devmode->driverextra);
if (!d->dev_private) {
return NULL;
}
@@ -9046,7 +9049,8 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u,
*/
set_printer_dataex( printer, keyname, valuename,
- REG_SZ, (void*)oid_string, strlen(oid_string)+1 );
+ REG_SZ, (uint8 *)oid_string,
+ strlen(oid_string)+1 );
}
status = mod_a_printer(printer, 2);
@@ -9336,7 +9340,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
data_len = regval_size( val );
if ( data_len ) {
- if ( !(enum_values[i].data = TALLOC_MEMDUP(p->mem_ctx, regval_data_p(val), data_len)) )
+ if ( !(enum_values[i].data = (uint8 *)TALLOC_MEMDUP(p->mem_ctx, regval_data_p(val), data_len)) )
{
DEBUG(0,("talloc_memdup failed to allocate memory [data_len=%d] for data!\n",
data_len ));