svn commit: samba r15855 - in branches/SAMBA_4_0/source: ntvfs/posix ntvfs/sysdep rpc_server rpc_server/srvsvc smb_server web_server wrepl_server

tridge at samba.org tridge at samba.org
Wed May 24 07:35:07 GMT 2006


Author: tridge
Date: 2006-05-24 07:35:06 +0000 (Wed, 24 May 2006)
New Revision: 15855

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

Log:

more talloc_set_destructor() typesafe fixes. nearly done ...

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
   branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
   branches/SAMBA_4_0/source/rpc_server/handles.c
   branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c
   branches/SAMBA_4_0/source/smb_server/handle.c
   branches/SAMBA_4_0/source/smb_server/session.c
   branches/SAMBA_4_0/source/smb_server/tcon.c
   branches/SAMBA_4_0/source/web_server/http.c
   branches/SAMBA_4_0/source/web_server/web_server.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -35,9 +35,8 @@
 /*
   destroy an open search
 */
-static int pvfs_search_destructor(void *ptr)
+static int pvfs_search_destructor(struct pvfs_search_state *search)
 {
-	struct pvfs_search_state *search = ptr;
 	DLIST_REMOVE(search->pvfs->search.list, search);
 	idr_remove(search->pvfs->search.idtree, search->handle);
 	return 0;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -102,9 +102,8 @@
 /*
   destroy a pending wait
  */
-static int pvfs_wait_destructor(void *ptr)
+static int pvfs_wait_destructor(struct pvfs_wait *pwait)
 {
-	struct pvfs_wait *pwait = ptr;
 	if (pwait->msg_type != -1) {
 		messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
 	}

Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -104,9 +104,8 @@
 	}
 }
 
-static int pvfs_state_destructor(void *ptr)
+static int pvfs_state_destructor(struct pvfs_state *pvfs)
 {
-	struct pvfs_state *pvfs = talloc_get_type(ptr, struct pvfs_state);
 	struct pvfs_file *f, *fn;
 	struct pvfs_search_state *s, *sn;
 

Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -82,9 +82,8 @@
 /*
   destroy the inotify private context
 */
-static int inotify_destructor(void *ptr)
+static int inotify_destructor(struct inotify_private *in)
 {
-	struct inotify_private *in = talloc_get_type(ptr, struct inotify_private);
 	close(in->fd);
 	return 0;
 }
@@ -308,9 +307,8 @@
 /*
   destroy a watch
 */
-static int watch_destructor(void *ptr)
+static int watch_destructor(struct watch_context *w)
 {
-	struct watch_context *w = talloc_get_type(ptr, struct watch_context);
 	struct inotify_private *in = w->in;
 	int wd = w->wd;
 	DLIST_REMOVE(w->in->watches, w);

Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -266,10 +266,8 @@
 /*
   destroy a link to an endpoint
 */
-static int dcesrv_endpoint_destructor(void *ptr)
+static int dcesrv_endpoint_destructor(struct dcesrv_connection *p)
 {
-	struct dcesrv_connection *p = ptr;
-
 	while (p->contexts) {
 		struct dcesrv_connection_context *c = p->contexts;
 

Modified: branches/SAMBA_4_0/source/rpc_server/handles.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/handles.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/rpc_server/handles.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -27,9 +27,8 @@
 /*
   destroy a rpc handle
 */
-static int dcesrv_handle_destructor(void *ptr)
+static int dcesrv_handle_destructor(struct dcesrv_handle *h)
 {
-	struct dcesrv_handle *h = ptr;
 	DLIST_REMOVE(h->context->handles, h);
 	talloc_free(h);
 	return 0;

Modified: branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -43,9 +43,8 @@
 	struct ntvfs_context *ntvfs;
 };
 
-static int srvsvc_ntvfs_ctx_destructor(void *p)
+static int srvsvc_ntvfs_ctx_destructor(struct srvsvc_ntvfs_ctx *c)
 {
-	struct srvsvc_ntvfs_ctx *c = talloc_get_type(p, struct srvsvc_ntvfs_ctx);
 	ntvfs_disconnect(c->ntvfs);
 	return 0;
 }

Modified: branches/SAMBA_4_0/source/smb_server/handle.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/handle.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/smb_server/handle.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -85,9 +85,8 @@
 /*
   destroy a connection structure
 */
-static int smbsrv_handle_destructor(void *ptr)
+static int smbsrv_handle_destructor(struct smbsrv_handle *handle)
 {
-	struct smbsrv_handle *handle = talloc_get_type(ptr, struct smbsrv_handle);
 	struct smbsrv_handles_context *handles_ctx;
 
 	handles_ctx = &handle->tcon->handles;

Modified: branches/SAMBA_4_0/source/smb_server/session.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/session.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/smb_server/session.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -122,9 +122,8 @@
 /****************************************************************************
 destroy a session structure
 ****************************************************************************/
-static int smbsrv_session_destructor(void *p)
+static int smbsrv_session_destructor(struct smbsrv_session *sess)
 {
-	struct smbsrv_session *sess = talloc_get_type(p, struct smbsrv_session);
 	struct smbsrv_connection *smb_conn = sess->smb_conn;
 
 	idr_remove(smb_conn->sessions.idtree_vuid, sess->vuid);

Modified: branches/SAMBA_4_0/source/smb_server/tcon.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/tcon.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/smb_server/tcon.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -111,13 +111,12 @@
 /*
   destroy a connection structure
 */
-static int smbsrv_tcon_destructor(void *ptr)
+static int smbsrv_tcon_destructor(struct smbsrv_tcon *tcon)
 {
-	struct smbsrv_tcon *tcon = talloc_get_type(ptr, struct smbsrv_tcon);
 	struct smbsrv_tcons_context *tcons_ctx;
 	struct socket_address *client_addr;
 
-	client_addr = socket_get_peer_addr(tcon->smb_conn->connection->socket, ptr);
+	client_addr = socket_get_peer_addr(tcon->smb_conn->connection->socket, tcon);
 	DEBUG(3,("%s closed connection to service %s\n",
 		 client_addr ? client_addr->addr : "(unknown)",
 		 tcon->share_name));

Modified: branches/SAMBA_4_0/source/web_server/http.c
===================================================================
--- branches/SAMBA_4_0/source/web_server/http.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/web_server/http.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -668,9 +668,8 @@
 /*
   destroy a session
  */
-static int session_destructor(void *ptr)
+static int session_destructor(struct session_data *s)
 {
-	struct session_data *s = talloc_get_type(ptr, struct session_data);
 	DLIST_REMOVE(s->edata->sessions, s);
 	return 0;
 }

Modified: branches/SAMBA_4_0/source/web_server/web_server.c
===================================================================
--- branches/SAMBA_4_0/source/web_server/web_server.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/web_server/web_server.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -37,9 +37,8 @@
 /*
   destroy a web connection
 */
-static int websrv_destructor(void *ptr)
+static int websrv_destructor(struct websrv_context *web)
 {
-	struct websrv_context *web = talloc_get_type(ptr, struct websrv_context);
 	if (web->output.fd != -1) {
 		close(web->output.fd);
 	}

Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c
===================================================================
--- branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c	2006-05-24 07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c	2006-05-24 07:35:06 UTC (rev 15855)
@@ -38,9 +38,8 @@
 	stream_terminate_connection(wreplconn->conn, reason);
 }
 
-static int terminate_after_send_destructor(void *ptr)
+static int terminate_after_send_destructor(struct wreplsrv_in_connection **tas)
 {
-	struct wreplsrv_in_connection **tas = talloc_get_type(ptr, struct wreplsrv_in_connection *);
 	wreplsrv_terminate_in_connection(*tas, "wreplsrv_in_connection: terminate_after_send");
 	return 0;
 }



More information about the samba-cvs mailing list