svn commit: samba r17333 - in branches/SAMBA_3_0/source: libsmb registry

vlendec at samba.org vlendec at samba.org
Mon Jul 31 03:53:40 GMT 2006


Author: vlendec
Date: 2006-07-31 03:53:39 +0000 (Mon, 31 Jul 2006)
New Revision: 17333

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

Log:
Some C++ warnings
Modified:
   branches/SAMBA_3_0/source/libsmb/clifile.c
   branches/SAMBA_3_0/source/libsmb/clilist.c
   branches/SAMBA_3_0/source/libsmb/clirap.c
   branches/SAMBA_3_0/source/libsmb/clireadwrite.c
   branches/SAMBA_3_0/source/libsmb/clistr.c
   branches/SAMBA_3_0/source/libsmb/clitrans.c
   branches/SAMBA_3_0/source/libsmb/libsmbclient.c
   branches/SAMBA_3_0/source/libsmb/smb_signing.c
   branches/SAMBA_3_0/source/registry/reg_cachehook.c
   branches/SAMBA_3_0/source/registry/reg_db.c
   branches/SAMBA_3_0/source/registry/reg_objects.c
   branches/SAMBA_3_0/source/registry/reg_perfcount.c
   branches/SAMBA_3_0/source/registry/reg_printing.c
   branches/SAMBA_3_0/source/registry/regfio.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clifile.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clifile.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clifile.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -1509,7 +1509,7 @@
 
 	if (ea_namelen == 0 && ea_len == 0) {
 		data_len = 4;
-		data = SMB_MALLOC(data_len);
+		data = (char *)SMB_MALLOC(data_len);
 		if (!data) {
 			return False;
 		}
@@ -1517,7 +1517,7 @@
 		SIVAL(p,0,data_len);
 	} else {
 		data_len = 4 + 4 + ea_namelen + 1 + ea_len;
-		data = SMB_MALLOC(data_len);
+		data = (char *)SMB_MALLOC(data_len);
 		if (!data) {
 			return False;
 		}

Modified: branches/SAMBA_3_0/source/libsmb/clilist.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clilist.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clilist.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -335,7 +335,7 @@
 
 		/* grab the data for later use */
 		/* and add them to the dirlist pool */
-		dirlist = SMB_REALLOC(dirlist,dirlist_len + data_len);
+		dirlist = (char *)SMB_REALLOC(dirlist,dirlist_len + data_len);
 
 		if (!dirlist) {
 			DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
@@ -461,7 +461,8 @@
 
 		first = False;
 
-		dirlist = SMB_REALLOC(dirlist,(num_received + received)*DIR_STRUCT_SIZE);
+		dirlist = (char *)SMB_REALLOC(
+			dirlist,(num_received + received)*DIR_STRUCT_SIZE);
 		if (!dirlist) {
 			DEBUG(0,("cli_list_old: failed to expand dirlist"));
 			return 0;

Modified: branches/SAMBA_3_0/source/libsmb/clirap.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clirap.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clirap.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -847,7 +847,7 @@
 		return False;
 	}
 
-	*poutdata = memdup(rdata, data_len);
+	*poutdata = (char *)memdup(rdata, data_len);
 	if (!*poutdata) {
 		SAFE_FREE(rdata);
 		SAFE_FREE(rparam);

Modified: branches/SAMBA_3_0/source/libsmb/clireadwrite.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clireadwrite.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clireadwrite.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -265,11 +265,11 @@
 	BOOL large_writex = False;
 
 	if (size > cli->bufsize) {
-		cli->outbuf = SMB_REALLOC(cli->outbuf, size + 1024);
+		cli->outbuf = (char *)SMB_REALLOC(cli->outbuf, size + 1024);
 		if (!cli->outbuf) {
 			return False;
 		}
-		cli->inbuf = SMB_REALLOC(cli->inbuf, size + 1024);
+		cli->inbuf = (char *)SMB_REALLOC(cli->inbuf, size + 1024);
 		if (cli->inbuf == NULL) {
 			SAFE_FREE(cli->outbuf);
 			return False;

Modified: branches/SAMBA_3_0/source/libsmb/clistr.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clistr.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clistr.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -49,10 +49,10 @@
 
 size_t clistr_align_out(struct cli_state *cli, const void *p, int flags)
 {
-	return align_string(cli->outbuf, p, flags);
+	return align_string(cli->outbuf, (const char *)p, flags);
 }
 
 size_t clistr_align_in(struct cli_state *cli, const void *p, int flags)
 {
-	return align_string(cli->inbuf, p, flags);
+	return align_string(cli->inbuf, (const char *)p, flags);
 }

Modified: branches/SAMBA_3_0/source/libsmb/clitrans.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clitrans.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/clitrans.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -207,7 +207,7 @@
 
 	/* allocate it */
 	if (total_data!=0) {
-		*data = SMB_REALLOC(*data,total_data);
+		*data = (char *)SMB_REALLOC(*data,total_data);
 		if (!(*data)) {
 			DEBUG(0,("cli_receive_trans: failed to enlarge data buffer\n"));
 			goto out;
@@ -215,7 +215,7 @@
 	}
 
 	if (total_param!=0) {
-		*param = SMB_REALLOC(*param,total_param);
+		*param = (char *)SMB_REALLOC(*param,total_param);
 		if (!(*param)) {
 			DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
 			goto out;
@@ -511,7 +511,7 @@
 
 	/* allocate it */
 	if (total_data) {
-		*data = SMB_REALLOC(*data,total_data);
+		*data = (char *)SMB_REALLOC(*data,total_data);
 		if (!(*data)) {
 			DEBUG(0,("cli_receive_nt_trans: failed to enlarge data buffer to %d\n",total_data));
 			goto out;
@@ -519,7 +519,7 @@
 	}
 
 	if (total_param) {
-		*param = SMB_REALLOC(*param,total_param);
+		*param = (char *)SMB_REALLOC(*param,total_param);
 		if (!(*param)) {
 			DEBUG(0,("cli_receive_nt_trans: failed to enlarge param buffer to %d\n", total_param));
 			goto out;

Modified: branches/SAMBA_3_0/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -1281,7 +1281,7 @@
 	}
 	/*d_printf(">>>fstat: resolved path as %s\n", targetpath);*/
 	
-	ret = cli_read(targetcli, file->cli_fd, buf, offset, count);
+	ret = cli_read(targetcli, file->cli_fd, (char *)buf, offset, count);
 
 	if (ret < 0) {
 
@@ -1365,7 +1365,7 @@
 	/*d_printf(">>>write: resolved path as %s\n", targetpath);*/
 
 
-	ret = cli_write(targetcli, file->cli_fd, 0, buf, offset, count);
+	ret = cli_write(targetcli, file->cli_fd, 0, (char *)buf, offset, count);
 
 	if (ret <= 0) {
 
@@ -2246,7 +2246,7 @@
 
 	size = sizeof(struct smbc_dirent) + name_length + comment_len + 2;
     
-	dirent = SMB_MALLOC(size);
+	dirent = (struct smbc_dirent *)SMB_MALLOC(size);
 
 	if (!dirent) {
 
@@ -6230,7 +6230,7 @@
                          * lazy for the moment
                          */
                         pid = sys_getpid();
-                        context->netbios_name = SMB_MALLOC(17);
+                        context->netbios_name = (char *)SMB_MALLOC(17);
                         if (!context->netbios_name) {
                                 errno = ENOMEM;
                                 return NULL;

Modified: branches/SAMBA_3_0/source/libsmb/smb_signing.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/smb_signing.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/libsmb/smb_signing.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -323,7 +323,8 @@
 static void client_sign_outgoing_message(char *outbuf, struct smb_sign_info *si)
 {
 	unsigned char calc_md5_mac[16];
-	struct smb_basic_signing_context *data = si->signing_context;
+	struct smb_basic_signing_context *data =
+		(struct smb_basic_signing_context *)si->signing_context;
 
 	if (!si->doing_signing)
 		return;
@@ -378,7 +379,8 @@
 	unsigned char calc_md5_mac[16];
 	unsigned char *server_sent_mac;
 
-	struct smb_basic_signing_context *data = si->signing_context;
+	struct smb_basic_signing_context *data =
+		(struct smb_basic_signing_context *)si->signing_context;
 
 	if (!si->doing_signing)
 		return True;
@@ -433,7 +435,8 @@
 
 static void simple_free_signing_context(struct smb_sign_info *si)
 {
-	struct smb_basic_signing_context *data = si->signing_context;
+	struct smb_basic_signing_context *data =
+		(struct smb_basic_signing_context *)si->signing_context;
 	struct outstanding_packet_lookup *list;
 	struct outstanding_packet_lookup *next;
 	
@@ -649,7 +652,8 @@
 static void srv_sign_outgoing_message(char *outbuf, struct smb_sign_info *si)
 {
 	unsigned char calc_md5_mac[16];
-	struct smb_basic_signing_context *data = si->signing_context;
+	struct smb_basic_signing_context *data =
+		(struct smb_basic_signing_context *)si->signing_context;
 	uint32 send_seq_number = data->send_seq_num-1;
 	uint16 mid;
 
@@ -690,7 +694,8 @@
 static BOOL srv_check_incoming_message(char *inbuf, struct smb_sign_info *si, BOOL must_be_ok)
 {
 	BOOL good;
-	struct smb_basic_signing_context *data = si->signing_context;
+	struct smb_basic_signing_context *data =
+		(struct smb_basic_signing_context *)si->signing_context;
 	uint32 reply_seq_number = data->send_seq_num;
 	uint32 saved_seq;
 	unsigned char calc_md5_mac[16];

Modified: branches/SAMBA_3_0/source/registry/reg_cachehook.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_cachehook.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/reg_cachehook.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -79,7 +79,7 @@
 	/* prepend the string with a '\' character */
 	
 	len = strlen( keyname );
-	if ( !(key = SMB_MALLOC( len + 2 )) ) {
+	if ( !(key = (char *)SMB_MALLOC( len + 2 )) ) {
 		DEBUG(0,("reghook_cache_find: malloc failed for string [%s] !?!?!\n",
 			keyname));
 		return NULL;
@@ -94,7 +94,7 @@
 		
 	DEBUG(10,("reghook_cache_find: Searching for keyname [%s]\n", key));
 	
-	hook = pathtree_find( cache_tree, key ) ;
+	hook = (REGISTRY_HOOK *)pathtree_find( cache_tree, key ) ;
 	
 	SAFE_FREE( key );
 	

Modified: branches/SAMBA_3_0/source/registry/reg_db.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_db.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/reg_db.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -313,7 +313,7 @@
 
 	/* allocate some initial memory */
 		
-	if (!(buffer = SMB_MALLOC(sizeof(pstring)))) {
+	if (!(buffer = (char *)SMB_MALLOC(sizeof(pstring)))) {
 		return False;
 	}
 	buflen = sizeof(pstring);
@@ -329,7 +329,7 @@
 		len += tdb_pack( buffer+len, buflen-len, "f", regsubkey_ctr_specific_key(ctr, i) );
 		if ( len > buflen ) {
 			/* allocate some extra space */
-			if ((buffer = SMB_REALLOC( buffer, len*2 )) == NULL) {
+			if ((buffer = (char *)SMB_REALLOC( buffer, len*2 )) == NULL) {
 				DEBUG(0,("regdb_store_keys: Failed to realloc memory of size [%d]\n", len*2));
 				ret = False;
 				goto done;

Modified: branches/SAMBA_3_0/source/registry/reg_objects.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_objects.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/reg_objects.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -177,7 +177,8 @@
 	
 	if ( val->data_p && val->size ) 
 	{
-		if ( !(copy->data_p = memdup( val->data_p, val->size )) ) {
+		if ( !(copy->data_p = (uint8 *)memdup( val->data_p,
+						       val->size )) ) {
 			DEBUG(0,("dup_registry_value: memdup() failed for [%d] bytes!\n",
 				val->size));
 			SAFE_FREE( copy );
@@ -302,7 +303,8 @@
 	
 	fstrcpy( ctr->values[ctr->num_values]->valuename, name );
 	ctr->values[ctr->num_values]->type = type;
-	ctr->values[ctr->num_values]->data_p = TALLOC_MEMDUP( ctr, data_p, size );
+	ctr->values[ctr->num_values]->data_p = (uint8 *)TALLOC_MEMDUP(
+		ctr, data_p, size );
 	ctr->values[ctr->num_values]->size = size;
 	ctr->num_values++;
 
@@ -341,7 +343,8 @@
 	
 		fstrcpy( ctr->values[ctr->num_values]->valuename, val->valuename );
 		ctr->values[ctr->num_values]->type = val->type;
-		ctr->values[ctr->num_values]->data_p = TALLOC_MEMDUP( ctr, val->data_p, val->size );
+		ctr->values[ctr->num_values]->data_p = (uint8 *)TALLOC_MEMDUP(
+			ctr, val->data_p, val->size );
 		ctr->values[ctr->num_values]->size = val->size;
 		ctr->num_values++;
 	}

Modified: branches/SAMBA_3_0/source/registry/reg_perfcount.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_perfcount.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/reg_perfcount.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -177,7 +177,7 @@
 	}
 	/* First encode the name_index */
 	working_size = (kbuf.dsize + 1)*sizeof(uint16);
-	buf1 = SMB_REALLOC(buf1, buffer_size + working_size);
+	buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
 	if(!buf1) {
 		buffer_size = 0;
 		return buffer_size;
@@ -187,7 +187,7 @@
 	buffer_size += working_size;
 	/* Now encode the actual name */
 	working_size = (dbuf.dsize + 1)*sizeof(uint16);
-	buf1 = SMB_REALLOC(buf1, buffer_size + working_size);
+	buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
 	if(!buf1) {
 		buffer_size = 0;
 		return buffer_size;
@@ -234,7 +234,7 @@
 
 	/* Now terminate the MULTI_SZ with a double unicode NULL */
 	buf1 = *retbuf;
-	buf1 = SMB_REALLOC(buf1, buffer_size + 2);
+	buf1 = (char *)SMB_REALLOC(buf1, buffer_size + 2);
 	if(!buf1) {
 		buffer_size = 0;
 	} else {
@@ -279,7 +279,7 @@
 
 	/* Now terminate the MULTI_SZ with a double unicode NULL */
 	buf1 = *retbuf;
-	buf1 = SMB_REALLOC(buf1, buffer_size + 2);
+	buf1 = (char *)SMB_REALLOC(buf1, buffer_size + 2);
 	if(!buf1) {
 		buffer_size = 0;
 	} else {

Modified: branches/SAMBA_3_0/source/registry/reg_printing.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_printing.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/reg_printing.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -922,7 +922,7 @@
 			
 			length = strlen(filename);
 		
-			buffer = SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
+			buffer = (char *)SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
 			if ( !buffer ) {
 				break;
 			}
@@ -935,7 +935,7 @@
 		
 		/* terminated by double NULL.  Add the final one here */
 		
-		buffer = SMB_REALLOC( buffer, buffer_size + 2 );
+		buffer = (char *)SMB_REALLOC( buffer, buffer_size + 2 );
 		if ( !buffer ) {
 			buffer_size = 0;
 		} else {

Modified: branches/SAMBA_3_0/source/registry/regfio.c
===================================================================
--- branches/SAMBA_3_0/source/registry/regfio.c	2006-07-31 01:20:05 UTC (rev 17332)
+++ branches/SAMBA_3_0/source/registry/regfio.c	2006-07-31 03:53:39 UTC (rev 17333)
@@ -1646,7 +1646,9 @@
 	if ( vk->data_size > sizeof(uint32) ) {
 		uint32 data_size = ( (vk->data_size+sizeof(uint32)) & 0xfffffff8 ) + 8;
 
-		vk->data = TALLOC_MEMDUP( file->mem_ctx, regval_data_p(value), vk->data_size );
+		vk->data = (uint8 *)TALLOC_MEMDUP( file->mem_ctx,
+						   regval_data_p(value),
+						   vk->data_size );
 		if (vk->data == NULL) {
 			return False;
 		}



More information about the samba-cvs mailing list