[SCM] Samba Shared Repository - branch master updated - 5d19187d3d69fff5c9c7551782adc18b5669c263

Stefan Metzmacher metze at samba.org
Mon Jan 12 08:23:33 GMT 2009


The branch, master has been updated
       via  5d19187d3d69fff5c9c7551782adc18b5669c263 (commit)
      from  44937c55ff69f29d44cf6ef34a7e4050816b30a4 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5d19187d3d69fff5c9c7551782adc18b5669c263
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 12 09:20:57 2009 +0100

    tevent: use for() loops instead of while() loops
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/tevent.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index cf17802..ea16fa1 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -138,34 +138,31 @@ const char **tevent_backend_list(TALLOC_CTX *mem_ctx)
 
 int tevent_common_context_destructor(struct tevent_context *ev)
 {
-	struct tevent_fd *fd;
-	struct tevent_timer *te;
-	struct tevent_signal *se;
+	struct tevent_fd *fd, *fn;
+	struct tevent_timer *te, *tn;
+	struct tevent_signal *se, *sn;
 
 	if (ev->pipe_fde) {
 		talloc_free(ev->pipe_fde);
 		ev->pipe_fde = NULL;
 	}
 
-	fd = ev->fd_events;
-	while (fd) {
+	for (fd = ev->fd_events; fd; fd = fn) {
+		fn = fd->next;
 		fd->event_ctx = NULL;
 		DLIST_REMOVE(ev->fd_events, fd);
-		fd = ev->fd_events;
 	}
 
-	te = ev->timer_events;
-	while (te) {
+	for (te = ev->timer_events; te; te = tn) {
+		tn = te->next;
 		te->event_ctx = NULL;
 		DLIST_REMOVE(ev->timer_events, te);
-		te = ev->timer_events;
 	}
 
-	se = ev->signal_events;
-	while (se) {
+	for (se = ev->signal_events; se; se = sn) {
+		sn = se->next;
 		se->event_ctx = NULL;
 		DLIST_REMOVE(ev->signal_events, se);
-		se = ev->signal_events;
 	}
 
 	return 0;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list