r22747: Fix some C++ warnings
authorVolker Lendecke <vlendec@samba.org>
Mon, 7 May 2007 15:07:49 +0000 (15:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:21:54 +0000 (12:21 -0500)
source/librpc/ndr/ndr.c
source/libsmb/clikrb5.c
source/libsmb/smb_seal.c
source/nsswitch/winbindd_cache.c
source/printing/printing.c
source/smbd/seal.c
source/smbd/sesssetup.c
source/utils/net_rpc_registry.c

index a692f398df543c236698c2d841b66d585600f448..6d174d38c3f47397c3c08c782302dfc693593150 100644 (file)
@@ -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");
 }
 
 /*
index 64cfe6e952c56b6ea07a3328dc69636d1e44fc93..a668d3b55cb2f16b73a88a40e75e2028944027fc 100644 (file)
@@ -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;
        }
 
index dde69570ab5e601350f70420aeea4e679cab23a7..81c6ff1bac210599271c67ac3517f2673473a655 100644 (file)
@@ -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;
index ed0d4131f618179f0157b6f2af8ec6d21063c41b..8464b41deb5e9e06984e2fb507f9fe50ac06884e 100644 (file)
@@ -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;
                        }
index 92e0ba658583aaa5bb39cec0d5cdff3014024744..2e259a8f510bf8f307a4acafae63a899a4c49667 100644 (file)
@@ -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,
index 07ef186e2ede1097c1ad3ec4beb94f6500d063e6..c4d60b0a60bf4000cfa6dc9570a29bfd70e99066 100644 (file)
@@ -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);
index 188b7bfb8182bc76f7a0218b916454a2b0847240..7dbf20a189ecd6be0e3a6cabb960e13767708a4e 100644 (file)
@@ -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;
index f1c046c1817af2490cecb20582a8babaccebb070..b439f50ee44d1b040d69b2870c0be5f26907dd8d 100644 (file)
@@ -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,