svn commit: samba r15358 - in branches/SAMBA_4_0/source: lib/appweb/ejs lib/appweb/mpr lib/socket_wrapper libcli/ldap ntvfs/posix rpc_server/winreg torture/com torture/rpc

jelmer at samba.org jelmer at samba.org
Sun Apr 30 13:54:04 GMT 2006


Author: jelmer
Date: 2006-04-30 13:54:03 +0000 (Sun, 30 Apr 2006)
New Revision: 15358

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

Log:
Fix some compiler warnings / type safety. Found by tcc

Modified:
   branches/SAMBA_4_0/source/lib/appweb/ejs/ejsLib.c
   branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
   branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c
   branches/SAMBA_4_0/source/libcli/ldap/ldap_controls.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
   branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
   branches/SAMBA_4_0/source/torture/com/simple.c
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/appweb/ejs/ejsLib.c
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/ejs/ejsLib.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/lib/appweb/ejs/ejsLib.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -64,8 +64,8 @@
   this is a workaround for the use of global variables in ejs
 */
 struct ejs_state_ctx {
-	struct MprVar master;
-	struct MprArray *ejsList;
+	MprVar master;
+	MprArray *ejsList;
 };
 
 void *ejs_save_state(void)

Modified: branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h	2006-04-30 13:54:03 UTC (rev 15358)
@@ -185,10 +185,7 @@
 
 #ifndef __cplusplus
 typedef unsigned char 	uchar;
-#ifndef __bool_true_false_are_defined
-typedef int 			bool;
 #endif
-#endif
 
 /*
  *	Porters: put other operating system type defines here

Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -462,7 +462,7 @@
 	child_si->protocol = parent_si->protocol;
 	child_si->bound = 1;
 
-	ret = real_getsockname(fd, &un_my_addr, &un_my_addrlen);
+	ret = real_getsockname(fd, (struct sockaddr *)&un_my_addr, &un_my_addrlen);
 	if (ret == -1) return ret;
 
 	ret = sockaddr_convert_from_un(child_si, &un_my_addr, un_my_addrlen,

Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap_controls.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/ldap/ldap_controls.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/libcli/ldap/ldap_controls.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -127,9 +127,11 @@
 		}
 
 		if (asn1_peek_tag(&data, ASN1_BOOLEAN)) {
-			if (!asn1_read_BOOLEAN(&data, &(lssc[num]->reverse))) {
+			bool reverse;
+			if (!asn1_read_BOOLEAN(&data, &reverse)) {
 			return False;
 			}
+			lssc[num]->reverse = reverse;
 		}
 	
 		if (!asn1_end_tag(&data)) {
@@ -902,9 +904,11 @@
 	}
 
 	if (asn1_peek_tag(data, ASN1_BOOLEAN)) {
-		if (!asn1_read_BOOLEAN(data, &(ctrl->critical))) {
+		bool critical;
+		if (!asn1_read_BOOLEAN(data, &critical)) {
 			return False;
 		}
+		critical = ctrl->critical;
 	} else {
 		ctrl->critical = False;
 	}

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -548,7 +548,7 @@
 NTSTATUS pvfs_resolve_name_fd(struct pvfs_state *pvfs, int fd,
 			      struct pvfs_filename *name)
 {
-	dev_t device = 0;
+	dev_t device = (dev_t)0;
 	ino_t inode = 0;
 
 	if (name->exists) {

Modified: branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -219,7 +219,7 @@
 	/* the client can optionally pass a NULL for type, meaning they don't
 	   want that back */
 	if (r->in.type != NULL) {
-		r->out.type = talloc(mem_ctx, uint32_t);
+		r->out.type = talloc(mem_ctx, enum winreg_Type);
 		*r->out.type = value->data_type;
 	}
 
@@ -398,7 +398,7 @@
 	}
 
 	/* Just asking for the size of the buffer */
-	r->out.type = &val->data_type;
+	r->out.type = (enum winreg_Type *)&val->data_type;
 	r->out.length = &val->data.length;
 	if (!r->in.data) {
 		r->out.size = talloc(mem_ctx, uint32_t);

Modified: branches/SAMBA_4_0/source/torture/com/simple.c
===================================================================
--- branches/SAMBA_4_0/source/torture/com/simple.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/torture/com/simple.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -38,7 +38,7 @@
 	struct IUnknown *interfaces[3];
 	WERROR results[2];
 	struct com_context *ctx;
-	char test_data[5];
+	uint8_t test_data[5];
 	int i;
 
 	com_init();
@@ -53,7 +53,7 @@
 	if (host) {
 		error = dcom_create_object(ctx, &clsid, 
 					   host, 2, IID,
-					   &interfaces, 
+					   (struct IUnknown ***)&interfaces, 
 					   results);
 	} else {
 		error = com_create_object(ctx, &clsid, 2, IID, interfaces, results);
@@ -74,7 +74,7 @@
 		test_data[i] = i+1;
 	}
 
-	error = IStream_Write((struct IStream *)interfaces[0], mem_ctx, &test_data, 5, NULL);
+	error = IStream_Write((struct IStream *)interfaces[0], mem_ctx, test_data, 5, NULL);
 	if (!W_ERROR_IS_OK(error)) {
 		printf("IStream::Write() failed - %s\n", win_errstr(error));
 		ret = False;

Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c	2006-04-30 06:44:19 UTC (rev 15357)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c	2006-04-30 13:54:03 UTC (rev 15358)
@@ -111,7 +111,7 @@
 	struct winreg_CreateKey r;
 	struct policy_handle newhandle;
 	NTSTATUS status;
-	uint32_t action_taken = 0;
+	enum winreg_CreateAction action_taken = 0;
 
 	printf("\ntesting CreateKey\n");
 
@@ -149,7 +149,7 @@
 {
 	struct winreg_CreateKey r;
 	NTSTATUS status;
-	uint32_t action_taken = 0;
+	enum winreg_CreateAction action_taken = 0;
 	struct security_descriptor *sd;
 	DATA_BLOB sdblob;
 	struct winreg_SecBuf secbuf;
@@ -500,15 +500,16 @@
 {
 	struct winreg_QueryValue r;
 	NTSTATUS status;
+	enum winreg_Type zero_type = 0;
+	uint32_t offered = 0xfff;
 	uint32_t zero = 0;
-	uint32_t offered = 0xfff;
 
 	printf("Testing QueryValue\n");
 
 	r.in.handle = handle;
 	r.in.data = NULL;
 	r.in.value_name.name = valuename;
-	r.in.type = &zero;
+	r.in.type = &zero_type;
 	r.in.size = &offered;
 	r.in.length = &zero;
 
@@ -530,7 +531,7 @@
 			   struct policy_handle *handle, int max_valnamelen, int max_valbufsize)
 {
 	struct winreg_EnumValue r;
-	uint32_t type = 0;
+	enum winreg_Type type = 0;
 	uint32_t size = max_valbufsize, zero = 0;
 	BOOL ret = True;
 	uint8_t buf8;



More information about the samba-cvs mailing list