svn commit: samba r17363 - in branches/SAMBA_3_0/source: libmsrpc libsmb nsswitch rpc_parse torture

vlendec at samba.org vlendec at samba.org
Tue Aug 1 12:45:15 GMT 2006


Author: vlendec
Date: 2006-08-01 12:45:12 +0000 (Tue, 01 Aug 2006)
New Revision: 17363

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

Log:
Some C++ warnings
Modified:
   branches/SAMBA_3_0/source/libmsrpc/cac_samr.c
   branches/SAMBA_3_0/source/libmsrpc/libmsrpc_internal.c
   branches/SAMBA_3_0/source/libsmb/smb_share_modes.c
   branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c
   branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c
   branches/SAMBA_3_0/source/rpc_parse/parse_dfs.c
   branches/SAMBA_3_0/source/torture/denytest.c
   branches/SAMBA_3_0/source/torture/nbio.c
   branches/SAMBA_3_0/source/torture/pdbtest.c


Changeset:
Modified: branches/SAMBA_3_0/source/libmsrpc/cac_samr.c
===================================================================
--- branches/SAMBA_3_0/source/libmsrpc/cac_samr.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/libmsrpc/cac_samr.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -156,7 +156,8 @@
    if(!fs.out.domain_sid)
       return NULL;
 
-   sid = talloc_memdup(mem_ctx, &(fs.out.domain_sid->sid), sizeof(DOM_SID));
+   sid = (DOM_SID *)talloc_memdup(mem_ctx, &(fs.out.domain_sid->sid),
+				  sizeof(DOM_SID));
 
    if(!sid) {
       hnd->status = NT_STATUS_NO_MEMORY;

Modified: branches/SAMBA_3_0/source/libmsrpc/libmsrpc_internal.c
===================================================================
--- branches/SAMBA_3_0/source/libmsrpc/libmsrpc_internal.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/libmsrpc/libmsrpc_internal.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -252,7 +252,8 @@
 
          data->reg_binary.data_length = size;
 
-         data->reg_binary.data = talloc_memdup(mem_ctx, buf.buffer, size);
+         data->reg_binary.data = (uint8 *)talloc_memdup(mem_ctx, buf.buffer,
+							size);
          if(!data->reg_binary.data) {
             TALLOC_FREE(data);
             errno = ENOMEM;
@@ -499,7 +500,8 @@
    memcpy(info->nt_password, id21->nt_pwd, 8);
    memcpy(info->lm_password, id21->lm_pwd, 8);
    
-   info->logon_hours = talloc_memdup(mem_ctx, &(id21->logon_hrs), sizeof(LOGON_HRS));
+   info->logon_hours = (LOGON_HRS *)talloc_memdup(mem_ctx, &(id21->logon_hrs),
+						  sizeof(LOGON_HRS));
    if(!info->logon_hours)
       return NULL;
 

Modified: branches/SAMBA_3_0/source/libsmb/smb_share_modes.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/smb_share_modes.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/libsmb/smb_share_modes.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -259,9 +259,10 @@
 	db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
 	if (!db_data.dptr) {
 		/* We must create the entry. */
-		db_data.dptr = malloc((2*sizeof(struct share_mode_entry)) +
-					strlen(sharepath) + 1 +
-					strlen(filename) + 1);
+		db_data.dptr = (char *)malloc(
+			(2*sizeof(struct share_mode_entry)) +
+			strlen(sharepath) + 1 +
+			strlen(filename) + 1);
 		if (!db_data.dptr) {
 			return -1;
 		}
@@ -294,7 +295,8 @@
 	}
 
 	/* Entry exists, we must add a new entry. */
-	new_data_p = malloc(db_data.dsize + sizeof(struct share_mode_entry));
+	new_data_p = (char *)malloc(
+		db_data.dsize + sizeof(struct share_mode_entry));
 	if (!new_data_p) {
 		free(db_data.dptr);
 		return -1;
@@ -391,7 +393,8 @@
 	}
 
 	/* More than one - allocate a new record minus the one we'll delete. */
-	new_data_p = malloc(db_data.dsize - sizeof(struct share_mode_entry));
+	new_data_p = (char *)malloc(
+		db_data.dsize - sizeof(struct share_mode_entry));
 	if (!new_data_p) {
 		free(db_data.dptr);
 		return -1;

Modified: branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -370,7 +370,8 @@
 
 	return_result:
 
-		pw_cache = getpwent_response.extra_data.data;
+		pw_cache = (struct winbindd_pw *)
+			getpwent_response.extra_data.data;
 
 		/* Check data is valid */
 
@@ -613,7 +614,8 @@
 
 	return_result:
 
-		gr_cache = getgrent_response.extra_data.data;
+		gr_cache = (struct winbindd_gr *)
+			getgrent_response.extra_data.data;
 
 		/* Check data is valid */
 
@@ -704,7 +706,7 @@
 
 		if (ret == NSS_STATUS_SUCCESS) {
 			ret = fill_grent(result, &response.data.gr, 
-					 response.extra_data.data,
+					 (char *)response.extra_data.data,
 					 &buffer, &buflen);
 
 			if (ret == NSS_STATUS_TRYAGAIN) {
@@ -719,7 +721,8 @@
 		/* We've been called again */
 		
 		ret = fill_grent(result, &response.data.gr, 
-				 response.extra_data.data, &buffer, &buflen);
+				 (char *)response.extra_data.data, &buffer,
+				 &buflen);
 		
 		if (ret == NSS_STATUS_TRYAGAIN) {
 			keep_response = True;
@@ -767,7 +770,7 @@
 		if (ret == NSS_STATUS_SUCCESS) {
 
 			ret = fill_grent(result, &response.data.gr, 
-					 response.extra_data.data, 
+					 (char *)response.extra_data.data, 
 					 &buffer, &buflen);
 
 			if (ret == NSS_STATUS_TRYAGAIN) {
@@ -782,7 +785,8 @@
 		/* We've been called again */
 
 		ret = fill_grent(result, &response.data.gr, 
-				 response.extra_data.data, &buffer, &buflen);
+				 (char *)response.extra_data.data, &buffer,
+				 &buflen);
 
 		if (ret == NSS_STATUS_TRYAGAIN) {
 			keep_response = True;
@@ -853,7 +857,9 @@
 					}
 				}
 
-				newgroups = realloc((*groups), newsize * sizeof(**groups));
+				newgroups = (gid_t *)
+					realloc((*groups),
+						newsize * sizeof(**groups));
 				if (!newgroups) {
 					*errnop = ENOMEM;
 					ret = NSS_STATUS_NOTFOUND;

Modified: branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_buffer.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -319,7 +319,8 @@
 
 			/* Yes this should be malloc not talloc. Don't change. */
 
-			chaine.buffer = SMB_MALLOC((q-p+1)*sizeof(uint16));
+			chaine.buffer = (uint16 *)
+				SMB_MALLOC((q-p+1)*sizeof(uint16));
 			if (chaine.buffer == NULL)
 				return False;
 

Modified: branches/SAMBA_3_0/source/rpc_parse/parse_dfs.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_parse/parse_dfs.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_dfs.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -325,7 +325,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
+			v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
 		}
 		for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) {
 			if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth))
@@ -447,7 +447,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
+			v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
 		}
 		for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) {
 			if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth))
@@ -920,7 +920,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO1 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info1_p("s", &v->s[i_s_1], ps, depth))
@@ -986,7 +986,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO2 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info2_p("s", &v->s[i_s_1], ps, depth))
@@ -1052,7 +1052,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO3 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info3_p("s", &v->s[i_s_1], ps, depth))
@@ -1118,7 +1118,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO4 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info4_p("s", &v->s[i_s_1], ps, depth))
@@ -1184,7 +1184,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO200 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info200_p("s", &v->s[i_s_1], ps, depth))
@@ -1250,7 +1250,7 @@
 			return False;
 		
 		if (UNMARSHALLING(ps)) {
-			v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
+			v->s = (NETDFS_DFS_INFO300 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
 		}
 		for (i_s_1=0; i_s_1<v->count;i_s_1++) {
 			if (!netdfs_io_dfs_Info300_p("s", &v->s[i_s_1], ps, depth))

Modified: branches/SAMBA_3_0/source/torture/denytest.c
===================================================================
--- branches/SAMBA_3_0/source/torture/denytest.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/torture/denytest.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -1447,10 +1447,10 @@
 		} else {
 			char x = 1;
 			res = A_0;
-			if (cli_read(cli1, fnum2, (void *)&x, 0, 1) == 1) {
+			if (cli_read(cli1, fnum2, (char *)&x, 0, 1) == 1) {
 				res += A_R;
 			}
-			if (cli_write(cli1, fnum2, 0, (void *)&x, 0, 1) == 1) {
+			if (cli_write(cli1, fnum2, 0, (char *)&x, 0, 1) == 1) {
 				res += A_W;
 			}
 		}
@@ -1531,10 +1531,10 @@
 		} else {
 			char x = 1;
 			res = A_0;
-			if (cli_read(cli2, fnum2, (void *)&x, 0, 1) == 1) {
+			if (cli_read(cli2, fnum2, (char *)&x, 0, 1) == 1) {
 				res += A_R;
 			}
-			if (cli_write(cli2, fnum2, 0, (void *)&x, 0, 1) == 1) {
+			if (cli_write(cli2, fnum2, 0, (char *)&x, 0, 1) == 1) {
 				res += A_W;
 			}
 		}

Modified: branches/SAMBA_3_0/source/torture/nbio.c
===================================================================
--- branches/SAMBA_3_0/source/torture/nbio.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/torture/nbio.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -34,7 +34,7 @@
 	int handle;
 } ftable[MAX_FILES];
 
-static struct {
+static struct children {
 	double bytes_in, bytes_out;
 	int line;
 	int done;
@@ -70,7 +70,7 @@
 void nbio_shmem(int n)
 {
 	nprocs = n;
-	children = shm_setup(sizeof(*children) * nprocs);
+	children = (struct children *)shm_setup(sizeof(*children) * nprocs);
 	if (!children) {
 		printf("Failed to setup shared memory!\n");
 		exit(1);

Modified: branches/SAMBA_3_0/source/torture/pdbtest.c
===================================================================
--- branches/SAMBA_3_0/source/torture/pdbtest.c	2006-08-01 10:58:01 UTC (rev 17362)
+++ branches/SAMBA_3_0/source/torture/pdbtest.c	2006-08-01 12:45:12 UTC (rev 17363)
@@ -291,9 +291,9 @@
 
 	pdb_get_account_policy(AP_PASSWORD_HISTORY, &history);
 	if (history * PW_HISTORY_ENTRY_LEN < NT_HASH_LEN) {
-		buf = TALLOC(ctx, NT_HASH_LEN);
+		buf = (uint8 *)TALLOC(ctx, NT_HASH_LEN);
 	} else {
-		buf = TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN);
+		buf = (uint8 *)TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN);
 	}
 
 	/* Generate some random hashes */



More information about the samba-cvs mailing list