summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-07 15:07:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:54 -0500
commit71921605995fa95d84301534760a6bc2db3fa74b (patch)
tree58676f522882b36e188e2e689b10d6e63f447037 /source3
parentb1e866c3b7c2ef92599b5801ac8c174cfd404319 (diff)
downloadsamba-71921605995fa95d84301534760a6bc2db3fa74b.tar.gz
samba-71921605995fa95d84301534760a6bc2db3fa74b.tar.bz2
samba-71921605995fa95d84301534760a6bc2db3fa74b.zip
r22747: Fix some C++ warnings
(This used to be commit a66a04e9f11f6c4462f2b56b447bae4eca7b177c)
Diffstat (limited to 'source3')
-rw-r--r--source3/librpc/ndr/ndr.c9
-rw-r--r--source3/libsmb/clikrb5.c2
-rw-r--r--source3/libsmb/smb_seal.c6
-rw-r--r--source3/nsswitch/winbindd_cache.c4
-rw-r--r--source3/printing/printing.c2
-rw-r--r--source3/smbd/seal.c9
-rw-r--r--source3/smbd/sesssetup.c3
-rw-r--r--source3/utils/net_rpc_registry.c2
8 files changed, 18 insertions, 19 deletions
diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c
index a692f398df..6d174d38c3 100644
--- a/source3/librpc/ndr/ndr.c
+++ b/source3/librpc/ndr/ndr.c
@@ -213,13 +213,16 @@ static void ndr_print_string_helper(struct ndr_print *ndr, const char *format, .
int i;
for (i=0;i<ndr->depth;i++) {
- ndr->private_data = talloc_asprintf_append(ndr->private_data, " ");
+ ndr->private_data = talloc_asprintf_append(
+ (char *)ndr->private_data, " ");
}
va_start(ap, format);
- ndr->private_data = talloc_vasprintf_append(ndr->private_data, format, ap);
+ ndr->private_data = talloc_vasprintf_append(
+ (char *)ndr->private_data, format, ap);
va_end(ap);
- ndr->private_data = talloc_asprintf_append(ndr->private_data, "\n");
+ ndr->private_data = talloc_asprintf_append(
+ (char *)ndr->private_data, "\n");
}
/*
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 64cfe6e952..a668d3b55c 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -1450,7 +1450,7 @@ done:
*opt = NULL;
- if ((my_opt = SMB_MALLOC(sizeof(krb5_get_init_creds_opt))) == NULL) {
+ if ((my_opt = SMB_MALLOC_P(krb5_get_init_creds_opt)) == NULL) {
return ENOMEM;
}
diff --git a/source3/libsmb/smb_seal.c b/source3/libsmb/smb_seal.c
index dde69570ab..81c6ff1bac 100644
--- a/source3/libsmb/smb_seal.c
+++ b/source3/libsmb/smb_seal.c
@@ -72,7 +72,7 @@ NTSTATUS common_ntlm_decrypt_buffer(NTLMSSP_STATE *ntlmssp_state, char *buf)
return NT_STATUS_BUFFER_TOO_SMALL;
}
- inbuf = smb_xmemdup(buf, buf_len);
+ inbuf = (char *)smb_xmemdup(buf, buf_len);
/* Adjust for the signature. */
data_len = buf_len - 8 - NTLMSSP_SIG_SIZE;
@@ -204,7 +204,7 @@ static NTSTATUS common_gss_decrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
}
memcpy(buf + 8, out_buf.value, out_buf.length);
- smb_setlen(out_buf.value, buf, out_buf.length + 4);
+ smb_setlen((char *)out_buf.value, buf, out_buf.length + 4);
gss_release_buffer(&minor, &out_buf);
return NT_STATUS_OK;
@@ -269,7 +269,7 @@ static NTSTATUS common_gss_encrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
* bother :-*(. JRA.
*/
- *ppbuf_out = SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
+ *ppbuf_out = (char *)SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
if (!*ppbuf_out) {
gss_release_buffer(&minor, &out_buf);
return NT_STATUS_NO_MEMORY;
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index ed0d4131f6..8464b41deb 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -2318,7 +2318,7 @@ void cache_store_response(pid_t pid, struct winbindd_response *response)
fstr_sprintf(key_str, "DE/%d", pid);
if (tdb_store(wcache->tdb, string_tdb_data(key_str),
- make_tdb_data(response->extra_data.data,
+ make_tdb_data((uint8 *)response->extra_data.data,
response->length - sizeof(*response)),
TDB_REPLACE) == 0)
return;
@@ -3193,7 +3193,7 @@ static int cache_traverse_validate_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_D
char *keystr;
int ret;
- keystr = SMB_MALLOC(kbuf.dsize+1);
+ keystr = SMB_MALLOC_ARRAY(char, kbuf.dsize+1);
if (!keystr) {
return 1;
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 92e0ba6585..2e259a8f51 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1357,7 +1357,7 @@ static void print_queue_receive(int msg_type, struct server_id src,
int printing_type;
size_t len;
- len = tdb_unpack( buf, msglen, "fdPP",
+ len = tdb_unpack( (uint8 *)buf, msglen, "fdPP",
sharename,
&printing_type,
lpqcommand,
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index 07ef186e2e..c4d60b0a60 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -492,8 +492,7 @@ static NTSTATUS srv_enc_spnego_negotiate(connection_struct *conn,
if (NT_STATUS_IS_OK(status)) {
/* Return the context we're using for this encryption state. */
- *pparam = SMB_MALLOC(2);
- if (!*pparam) {
+ if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
return NT_STATUS_NO_MEMORY;
}
SSVAL(*pparam,0,partial_srv_trans_enc_ctx->es->enc_ctx_num);
@@ -542,8 +541,7 @@ static NTSTATUS srv_enc_spnego_ntlm_auth(connection_struct *conn,
if (NT_STATUS_IS_OK(status)) {
/* Return the context we're using for this encryption state. */
- *pparam = SMB_MALLOC(2);
- if (!*pparam) {
+ if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
return NT_STATUS_NO_MEMORY;
}
SSVAL(*pparam,0,ec->es->enc_ctx_num);
@@ -593,8 +591,7 @@ static NTSTATUS srv_enc_raw_ntlm_auth(connection_struct *conn,
if (NT_STATUS_IS_OK(status)) {
/* Return the context we're using for this encryption state. */
- *pparam = SMB_MALLOC(2);
- if (!*pparam) {
+ if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
return NT_STATUS_NO_MEMORY;
}
SSVAL(*pparam,0,ec->es->enc_ctx_num);
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 188b7bfb81..7dbf20a189 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -990,8 +990,7 @@ static NTSTATUS check_spnego_blob_complete(uint16 smbpid, uint16 vuid, DATA_BLOB
}
/* We must store this blob until complete. */
- pad = SMB_MALLOC(sizeof(struct pending_auth_data));
- if (!pad) {
+ if (!(pad = SMB_MALLOC_P(struct pending_auth_data))) {
return NT_STATUS_NO_MEMORY;
}
pad->needed_len = needed_len - pblob->length;
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index f1c046c181..b439f50ee4 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -263,7 +263,7 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx,
name_buf.size = max_valnamelen + 2;
data_size = max_valbufsize;
- data = TALLOC(mem_ctx, data_size);
+ data = (uint8 *)TALLOC(mem_ctx, data_size);
value_length = 0;
status = rpccli_winreg_EnumValue(pipe_hnd, mem_ctx, key_hnd,