svn commit: samba r22747 - in branches/SAMBA_3_0/source: librpc/ndr libsmb nsswitch printing smbd utils

vlendec at samba.org vlendec at samba.org
Mon May 7 15:07:50 GMT 2007


Author: vlendec
Date: 2007-05-07 15:07:49 +0000 (Mon, 07 May 2007)
New Revision: 22747

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22747

Log:
Fix some C++ warnings

Modified:
   branches/SAMBA_3_0/source/librpc/ndr/ndr.c
   branches/SAMBA_3_0/source/libsmb/clikrb5.c
   branches/SAMBA_3_0/source/libsmb/smb_seal.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
   branches/SAMBA_3_0/source/printing/printing.c
   branches/SAMBA_3_0/source/smbd/seal.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c
   branches/SAMBA_3_0/source/utils/net_rpc_registry.c


Changeset:
Modified: branches/SAMBA_3_0/source/librpc/ndr/ndr.c
===================================================================
--- branches/SAMBA_3_0/source/librpc/ndr/ndr.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/librpc/ndr/ndr.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -213,13 +213,16 @@
 	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");
 }
 
 /*

Modified: branches/SAMBA_3_0/source/libsmb/clikrb5.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clikrb5.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/libsmb/clikrb5.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -1450,7 +1450,7 @@
 
 	*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;
 	}
 

Modified: branches/SAMBA_3_0/source/libsmb/smb_seal.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/smb_seal.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/libsmb/smb_seal.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -72,7 +72,7 @@
 		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 @@
 	}
 
 	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 @@
 	 * 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;

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -2318,7 +2318,7 @@
 
 	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 @@
 			char *keystr;
 			int ret;
 
-			keystr = SMB_MALLOC(kbuf.dsize+1);
+			keystr = SMB_MALLOC_ARRAY(char, kbuf.dsize+1);
 			if (!keystr) {
 				return 1;
 			}

Modified: branches/SAMBA_3_0/source/printing/printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/printing.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/printing/printing.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -1357,7 +1357,7 @@
 	int printing_type;
 	size_t len;
 
-	len = tdb_unpack( buf, msglen, "fdPP",
+	len = tdb_unpack( (uint8 *)buf, msglen, "fdPP",
 		sharename,
 		&printing_type,
 		lpqcommand,

Modified: branches/SAMBA_3_0/source/smbd/seal.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/seal.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/smbd/seal.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -492,8 +492,7 @@
 
 	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 @@
 
 	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 @@
 
 	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);

Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/sesssetup.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/smbd/sesssetup.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -990,8 +990,7 @@
 	}
 
 	/* 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;

Modified: branches/SAMBA_3_0/source/utils/net_rpc_registry.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_rpc_registry.c	2007-05-07 15:05:04 UTC (rev 22746)
+++ branches/SAMBA_3_0/source/utils/net_rpc_registry.c	2007-05-07 15:07:49 UTC (rev 22747)
@@ -263,7 +263,7 @@
 		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,



More information about the samba-cvs mailing list