[asterisk-commits] kpfleming: trunk r89106 - in /trunk: apps/ channels/ codecs/ funcs/ include/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 7 23:28:47 CST 2007


Author: kpfleming
Date: Wed Nov  7 23:28:47 2007
New Revision: 89106

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89106
Log:
improve linked-list macros in two ways:
  - the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists

Modified:
    trunk/apps/app_followme.c
    trunk/apps/app_meetme.c
    trunk/apps/app_queue.c
    trunk/apps/app_voicemail.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_iax2.c
    trunk/channels/iax2-parser.c
    trunk/codecs/codec_zap.c
    trunk/funcs/func_strings.c
    trunk/include/asterisk/linkedlists.h
    trunk/main/app.c
    trunk/main/asterisk.c
    trunk/main/astobj2.c
    trunk/main/audiohook.c
    trunk/main/autoservice.c
    trunk/main/cdr.c
    trunk/main/channel.c
    trunk/main/cli.c
    trunk/main/config.c
    trunk/main/devicestate.c
    trunk/main/event.c
    trunk/main/file.c
    trunk/main/frame.c
    trunk/main/image.c
    trunk/main/indications.c
    trunk/main/loader.c
    trunk/main/logger.c
    trunk/main/manager.c
    trunk/main/pbx.c
    trunk/main/sched.c
    trunk/main/srv.c
    trunk/main/translate.c
    trunk/pbx/pbx_dundi.c
    trunk/res/res_agi.c
    trunk/res/res_crypto.c
    trunk/res/res_features.c
    trunk/res/res_jabber.c
    trunk/res/res_musiconhold.c
    trunk/res/res_odbc.c
    trunk/res/res_speech.c
    trunk/utils/astman.c

Modified: trunk/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_followme.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Wed Nov  7 23:28:47 2007
@@ -840,13 +840,12 @@
 			winner = wait_for_winner(findme_user_list, nm, caller, tpargs->namerecloc, &status, tpargs);
 		
 					
-		AST_LIST_TRAVERSE_SAFE_BEGIN(findme_user_list, fmuser, entry) {
+		while ((fmuser = AST_LIST_REMOVE_HEAD(findme_user_list, entry))) {
 			if (!fmuser->cleared && fmuser->ochan != winner)
 				clear_caller(fmuser);
-			AST_LIST_REMOVE_CURRENT(findme_user_list, entry);
 			ast_free(fmuser);
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+
 		fmuser = NULL;
 		tmpuser = NULL;
 		headuser = NULL;	
@@ -978,11 +977,8 @@
 	
 	findmeexec(&targs);		
 	
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&targs.cnumbers, nm, entry) {
-		AST_LIST_REMOVE_CURRENT(&targs.cnumbers, entry);
+	while ((nm = AST_LIST_REMOVE_HEAD(&targs.cnumbers, entry)))
 		ast_free(nm);
-	}
-	AST_LIST_TRAVERSE_SAFE_END
 		
 	if (!ast_strlen_zero(namerecloc))
 		unlink(namerecloc);	

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Nov  7 23:28:47 2007
@@ -3971,14 +3971,14 @@
 				continue;
 
 			if (remove)
-				AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry);
+				AST_LIST_REMOVE_CURRENT(entry);
 
 			if (trunk_ref)
 				*trunk_ref = s_trunk_ref;
 
 			break;
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+		AST_LIST_TRAVERSE_SAFE_END;
 	
 		if (ringing_trunk)
 			break;
@@ -4006,11 +4006,11 @@
 		case AST_DIAL_RESULT_FAILED:
 		case AST_DIAL_RESULT_TIMEOUT:
 		case AST_DIAL_RESULT_UNANSWERED:
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_stations, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			sla_stop_ringing_station(ringing_station, SLA_STATION_HANGUP_NORMAL);
 			break;
 		case AST_DIAL_RESULT_ANSWERED:
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_stations, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			/* Find the appropriate trunk to answer. */
 			ast_mutex_lock(&sla.lock);
 			ringing_trunk = sla_choose_ringing_trunk(ringing_station->station, &s_trunk_ref, 1);
@@ -4055,7 +4055,7 @@
 			break;
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 }
 
 /*! \brief Check to see if this station is already ringing 
@@ -4085,7 +4085,7 @@
 		if (station != failed_station->station)
 			continue;
 		if (ast_tvdiff_ms(ast_tvnow(), failed_station->last_try) > 1000) {
-			AST_LIST_REMOVE_CURRENT(&sla.failed_stations, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			ast_free(failed_station);
 			break;
 		}
@@ -4284,7 +4284,7 @@
 				break;
 		}
 		if (!trunk_ref) {
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_stations, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			ast_dial_join(ringing_station->station->dial);
 			ast_dial_destroy(ringing_station->station->dial);
 			ringing_station->station->dial = NULL;
@@ -4341,7 +4341,7 @@
 		time_left = (ringing_trunk->trunk->ring_timeout * 1000) - time_elapsed;
 		if (time_left <= 0) {
 			pbx_builtin_setvar_helper(ringing_trunk->trunk->chan, "SLATRUNK_STATUS", "RINGTIMEOUT");
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			sla_stop_ringing_trunk(ringing_trunk);
 			res = 1;
 			continue;
@@ -4349,7 +4349,7 @@
 		if (time_left < *timeout)
 			*timeout = time_left;
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	return res;
 }
@@ -4422,7 +4422,7 @@
 
 		/* If there is no time left, the station needs to stop ringing */
 		if (time_left <= 0) {
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_stations, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			sla_stop_ringing_station(ringing_station, SLA_STATION_HANGUP_TIMEOUT);
 			res = 1;
 			continue;
@@ -4433,7 +4433,7 @@
 		if (time_left < *timeout)
 			*timeout = time_left;
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	return res;
 }
@@ -4992,11 +4992,11 @@
 	ast_mutex_lock(&sla.lock);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_trunks, ringing_trunk, entry) {
 		if (ringing_trunk->trunk == trunk) {
-			AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			break;
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	ast_mutex_unlock(&sla.lock);
 	if (ringing_trunk) {
 		sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Nov  7 23:28:47 2007
@@ -933,7 +933,7 @@
 		if (!strcasecmp(curint->interface, interface)) {
 			if (!interface_exists_global(interface)) {
 				ast_debug(1, "Removing %s from the list of interfaces that make up all of our queue members.\n", interface);
-				AST_LIST_REMOVE_CURRENT(&interfaces, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				ast_free(curint);
 			}
 			break;

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Nov  7 23:28:47 2007
@@ -4381,7 +4381,7 @@
 				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir);
 #endif
 				saved_messages++;
-				AST_LIST_REMOVE_CURRENT(&extensions, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				free_user(vmtmp);
 				if (res)
 					break;
@@ -7804,7 +7804,7 @@
 	AST_RWLIST_WRLOCK(&mwi_subs);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&mwi_subs, mwi_sub, entry) {
 		if (mwi_sub->uniqueid == uniqueid) {
-			AST_LIST_REMOVE_CURRENT(&mwi_subs, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			break;
 		}
 	}

Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Wed Nov  7 23:28:47 2007
@@ -1152,7 +1152,7 @@
 	}
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&agents, p, list) {
 		if (p->dead) {
-			AST_LIST_REMOVE_CURRENT(&agents, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			/* Destroy if  appropriate */
 			if (!p->owner) {
 				if (!p->chan) {
@@ -1166,7 +1166,7 @@
 			}
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&agents);
 	ast_config_destroy(cfg);
 	return 1;

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Nov  7 23:28:47 2007
@@ -1918,10 +1918,10 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&firmwares, cur, list) {
 		if (!cur->dead)
 			continue;
-		AST_LIST_REMOVE_CURRENT(&firmwares, list);
+		AST_LIST_REMOVE_CURRENT(list);
 		destroy_firmware(cur);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	AST_LIST_UNLOCK(&firmwares);
 }
@@ -6127,7 +6127,7 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&dpcache, dp, peer_list) {
 		if (strcmp(dp->exten, exten))
 			continue;
-		AST_LIST_REMOVE_CURRENT(&dpcache, peer_list);
+		AST_LIST_REMOVE_CURRENT(peer_list);
 		dp->callno = 0;
 		dp->expiry.tv_sec = dp->orig.tv_sec + expiry;
 		if (dp->flags & CACHE_FLAG_PENDING) {
@@ -6140,7 +6140,7 @@
 			if (dp->waiters[x] > -1)
 				write(dp->waiters[x], "asdf", 4);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&dpcache);
 
 	return 0;
@@ -6908,7 +6908,7 @@
 		if (!drop && iax2_trunk_expired(tpeer, &now)) {
 			/* Take it out of the list, but don't free it yet, because it
 			   could be in use */
-			AST_LIST_REMOVE_CURRENT(&tpeers, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			drop = tpeer;
 		} else {
 			res = send_trunk(tpeer, &now);
@@ -6920,7 +6920,7 @@
 		res = 0;
 		ast_mutex_unlock(&tpeer->lock);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&tpeers);
 
 	if (drop) {
@@ -7209,7 +7209,7 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&to_here->full_frames, cur_pkt_buf, entry) {
 		cur_fh = (struct ast_iax2_full_hdr *) cur_pkt_buf->buf;
 		if (fh->oseqno < cur_fh->oseqno) {
-			AST_LIST_INSERT_BEFORE_CURRENT(&to_here->full_frames, pkt_buf, entry);
+			AST_LIST_INSERT_BEFORE_CURRENT(pkt_buf, entry);
 			break;
 		}
 	}
@@ -7478,12 +7478,12 @@
 	AST_LIST_LOCK(varlist);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(varlist, var, entries) {
 		if (strcmp(var->name, data) == 0) {
-			AST_LIST_REMOVE_CURRENT(varlist, entries);
+			AST_LIST_REMOVE_CURRENT(entries);
 			ast_var_delete(var);
 			break;
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	var = ast_var_assign(data, value);
 	if (var)
 		AST_LIST_INSERT_TAIL(varlist, var, entries);
@@ -9538,7 +9538,7 @@
 
 			if (f->retries < 0) {
 				/* This is not supposed to be retransmitted */
-				AST_LIST_REMOVE_CURRENT(&frame_queue, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				/* Free the iax frame */
 				iax_frame_free(f);
 			} else {
@@ -9547,7 +9547,7 @@
 				f->retrans = iax2_sched_add(sched, f->retrytime, attempt_transmit, f);
 			}
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+		AST_LIST_TRAVERSE_SAFE_END;
 		AST_LIST_UNLOCK(&frame_queue);
 
 		pthread_testcancel();
@@ -10832,7 +10832,7 @@
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&dpcache, dp, cache_list) {
 		if (ast_tvcmp(tv, dp->expiry) > 0) {
-			AST_LIST_REMOVE_CURRENT(&dpcache, cache_list);
+			AST_LIST_REMOVE_CURRENT(cache_list);
 			if ((dp->flags & CACHE_FLAG_PENDING) || dp->callno)
 				ast_log(LOG_WARNING, "DP still has peer field or pending or callno (flags = %d, peer = blah, callno = %d)\n", dp->flags, dp->callno);
 			else
@@ -10842,7 +10842,7 @@
 		if (!strcmp(dp->peercontext, data) && !strcmp(dp->exten, exten))
 			break;
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	if (!dp) {
 		/* No matching entry.  Create a new one. */
@@ -11420,27 +11420,18 @@
 
 	/* Call for all threads to halt */
 	AST_LIST_LOCK(&idle_list);
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&idle_list, thread, list) {
-		AST_LIST_REMOVE_CURRENT(&idle_list, list);
+	while ((thread = AST_LIST_REMOVE_HEAD(&idle_list, list)))
 		pthread_cancel(thread->threadid);
-	}
-	AST_LIST_TRAVERSE_SAFE_END
-			AST_LIST_UNLOCK(&idle_list);
+	AST_LIST_UNLOCK(&idle_list);
 
 	AST_LIST_LOCK(&active_list);
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&active_list, thread, list) {
-		AST_LIST_REMOVE_CURRENT(&active_list, list);
+	while ((thread = AST_LIST_REMOVE_HEAD(&active_list, list)))
 		pthread_cancel(thread->threadid);
-	}
-	AST_LIST_TRAVERSE_SAFE_END
-			AST_LIST_UNLOCK(&active_list);
+	AST_LIST_UNLOCK(&active_list);
 
 	AST_LIST_LOCK(&dynamic_list);
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&dynamic_list, thread, list) {
-		AST_LIST_REMOVE_CURRENT(&dynamic_list, list);
+	while ((thread = AST_LIST_REMOVE_HEAD(&dynamic_list, list)))
 		pthread_cancel(thread->threadid);
-	}
-	AST_LIST_TRAVERSE_SAFE_END
 	AST_LIST_UNLOCK(&dynamic_list);
 	
 	/* Wait for threads to exit */

Modified: trunk/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/iax2-parser.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/channels/iax2-parser.c (original)
+++ trunk/channels/iax2-parser.c Wed Nov  7 23:28:47 2007
@@ -1003,13 +1003,13 @@
 		AST_LIST_TRAVERSE_SAFE_BEGIN(iax_frames, fr, list) {
 			if (fr->afdatalen >= datalen) {
 				size_t afdatalen = fr->afdatalen;
-				AST_LIST_REMOVE_CURRENT(iax_frames, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				memset(fr, 0, sizeof(*fr));
 				fr->afdatalen = afdatalen;
 				break;
 			}
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+		AST_LIST_TRAVERSE_SAFE_END;
 	}
 	if (!fr) {
 		if (!(fr = ast_calloc_cache(1, sizeof(*fr) + datalen)))

Modified: trunk/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_zap.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/codecs/codec_zap.c (original)
+++ trunk/codecs/codec_zap.c Wed Nov  7 23:28:47 2007
@@ -356,7 +356,7 @@
 		if (cur->t.dstfmt != dst)
 			continue;
 
-		AST_LIST_REMOVE_CURRENT(&translators, entry);
+		AST_LIST_REMOVE_CURRENT(entry);
 		ast_unregister_translator(&cur->t);
 		ast_free(cur);
 		global_format_map.map[dst][src] = 0;

Modified: trunk/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_strings.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Wed Nov  7 23:28:47 2007
@@ -230,7 +230,7 @@
 	int len = strlen(prefix);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->varshead, var, entries) {
 		if (strncasecmp(prefix, ast_var_name(var), len) == 0) {
-			AST_LIST_REMOVE_CURRENT(&chan->varshead, entries);
+			AST_LIST_REMOVE_CURRENT(entries);
 			ast_free(var);
 		}
 	}

Modified: trunk/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/linkedlists.h?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/include/asterisk/linkedlists.h (original)
+++ trunk/include/asterisk/linkedlists.h Wed Nov  7 23:28:47 2007
@@ -496,10 +496,11 @@
   the \a current pointer without affecting the loop traversal.
 */
 #define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) {				\
-	typeof((head)->first) __list_next;						\
-	typeof((head)->first) __list_prev = NULL;					\
-	typeof((head)->first) __new_prev = NULL;					\
-	for ((var) = (head)->first, __new_prev = (var),					\
+	typeof((head)) __list_head = head;						\
+	typeof(__list_head->first) __list_next;						\
+	typeof(__list_head->first) __list_prev = NULL;					\
+	typeof(__list_head->first) __new_prev = NULL;					\
+	for ((var) = __list_head->first, __new_prev = (var),				\
 	      __list_next = (var) ? (var)->field.next : NULL;				\
 	     (var);									\
 	     __list_prev = __new_prev, (var) = __list_next,				\
@@ -511,7 +512,6 @@
 
 /*!
   \brief Removes the \a current entry from a list during a traversal.
-  \param head This is a pointer to the list head structure
   \param field This is the name of the field (declared using AST_LIST_ENTRY())
   used to link entries of this list together.
 
@@ -520,22 +520,29 @@
   the list traversal (and without having to re-traverse the list to modify the
   previous entry, if any).
  */
-#define AST_LIST_REMOVE_CURRENT(head, field) do { \
+#define AST_LIST_REMOVE_CURRENT(field) do { \
 	__new_prev->field.next = NULL;							\
 	__new_prev = __list_prev;							\
 	if (__list_prev)								\
 		__list_prev->field.next = __list_next;					\
 	else										\
-		(head)->first = __list_next;						\
+		__list_head->first = __list_next;					\
 	if (!__list_next)								\
-		(head)->last = __list_prev; \
+		__list_head->last = __list_prev; 					\
 	} while (0)
 
 #define AST_RWLIST_REMOVE_CURRENT AST_LIST_REMOVE_CURRENT
 
+#define AST_LIST_MOVE_CURRENT(newhead, field) do { \
+	typeof ((newhead)->first) __list_cur = __new_prev;				\
+	AST_LIST_REMOVE_CURRENT(field);							\
+	AST_LIST_INSERT_TAIL((newhead), __list_cur, field);				\
+	} while (0)
+
+#define AST_RWLIST_MOVE_CURRENT AST_LIST_MOVE_CURRENT
+
 /*!
   \brief Inserts a list entry before the current entry during a traversal.
-  \param head This is a pointer to the list head structure
   \param elm This is a pointer to the entry to be inserted.
   \param field This is the name of the field (declared using AST_LIST_ENTRY())
   used to link entries of this list together.
@@ -543,13 +550,13 @@
   \note This macro can \b only be used inside an AST_LIST_TRAVERSE_SAFE_BEGIN()
   block.
  */
-#define AST_LIST_INSERT_BEFORE_CURRENT(head, elm, field) do {		\
+#define AST_LIST_INSERT_BEFORE_CURRENT(elm, field) do {			\
 	if (__list_prev) {						\
 		(elm)->field.next = __list_prev->field.next;		\
 		__list_prev->field.next = elm;				\
 	} else {							\
-		(elm)->field.next = (head)->first;			\
-		(head)->first = (elm);					\
+		(elm)->field.next = __list_head->first;			\
+		__list_head->first = (elm);				\
 	}								\
 	__new_prev = (elm);						\
 } while (0)

Modified: trunk/main/app.c
URL: http://svn.digium.com/view/asterisk/trunk/main/app.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Wed Nov  7 23:28:47 2007
@@ -873,12 +873,12 @@
 	AST_RWLIST_WRLOCK(&groups);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
 		if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) {
-			AST_RWLIST_REMOVE_CURRENT(&groups, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			free(gi);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 
 	if (ast_strlen_zero(group)) {
 		/* Enable unsetting the group */
@@ -964,11 +964,11 @@
 	AST_RWLIST_WRLOCK(&groups);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
 		if (gi->chan == chan) {
-			AST_RWLIST_REMOVE_CURRENT(&groups, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_free(gi);
 		}
 	}
-        AST_RWLIST_TRAVERSE_SAFE_END
+        AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&groups);
 	
 	return 0;
@@ -1204,7 +1204,7 @@
 	AST_LIST_LOCK(&path_lock_list);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&path_lock_list, p, le) {
 		if (!strcmp(p->path, path)) {
-			AST_LIST_REMOVE_CURRENT(&path_lock_list, le);
+			AST_LIST_REMOVE_CURRENT(le);
 			break;
 		}
 	}

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Wed Nov  7 23:28:47 2007
@@ -286,7 +286,7 @@
 	AST_RWLIST_WRLOCK(&file_versions);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&file_versions, find, list) {
 		if (!strcasecmp(find->file, file)) {
-			AST_RWLIST_REMOVE_CURRENT(&file_versions, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			break;
 		}
 	}
@@ -325,7 +325,7 @@
 	AST_RWLIST_WRLOCK(&thread_list);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&thread_list, x, list) {
 		if ((void *) x->id == id) {
-			AST_RWLIST_REMOVE_CURRENT(&thread_list, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			break;
 		}
 	}
@@ -747,11 +747,11 @@
 	AST_RWLIST_WRLOCK(&atexits);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&atexits, ae, list) {
 		if (ae->func == func) {
-			AST_RWLIST_REMOVE_CURRENT(&atexits, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&atexits);
 
 	if (ae)

Modified: trunk/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/trunk/main/astobj2.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/astobj2.c (original)
+++ trunk/main/astobj2.c Wed Nov  7 23:28:47 2007
@@ -467,7 +467,7 @@
 
 				/* we are going to modify the container, so update version */
 				ast_atomic_fetchadd_int(&c->version, 1);
-				AST_LIST_REMOVE_CURRENT(&c->buckets[i], entry);
+				AST_LIST_REMOVE_CURRENT(entry);
 				/* update number of elements and version */
 				ast_atomic_fetchadd_int(&c->elements, -1);
 				ao2_ref(EXTERNAL_OBJ(x->astobj), -1);
@@ -488,7 +488,7 @@
 #endif
 			}
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+		AST_LIST_TRAVERSE_SAFE_END;
 	}
 	ao2_unlock(c);
 	return ret;

Modified: trunk/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/trunk/main/audiohook.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/audiohook.c (original)
+++ trunk/main/audiohook.c Wed Nov  7 23:28:47 2007
@@ -346,35 +346,29 @@
 	struct ast_audiohook *audiohook = NULL;
 
 	/* Drop any spies */
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->spy_list, audiohook, list) {
+	while ((audiohook = AST_LIST_REMOVE_HEAD(&audiohook_list->spy_list, list))) {
 		ast_audiohook_lock(audiohook);
-		AST_LIST_REMOVE_CURRENT(&audiohook_list->spy_list, list);
 		audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 		ast_cond_signal(&audiohook->trigger);
 		ast_audiohook_unlock(audiohook);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
 
 	/* Drop any whispering sources */
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->whisper_list, audiohook, list) {
+	while ((audiohook = AST_LIST_REMOVE_HEAD(&audiohook_list->whisper_list, list))) {
 		ast_audiohook_lock(audiohook);
-		AST_LIST_REMOVE_CURRENT(&audiohook_list->whisper_list, list);
 		audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 		ast_cond_signal(&audiohook->trigger);
 		ast_audiohook_unlock(audiohook);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
 
 	/* Drop any manipulaters */
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->manipulate_list, audiohook, list) {
+	while ((audiohook = AST_LIST_REMOVE_HEAD(&audiohook_list->manipulate_list, list))) {
 		ast_audiohook_lock(audiohook);
 		ast_mutex_lock(&audiohook->lock);
-		AST_LIST_REMOVE_CURRENT(&audiohook_list->manipulate_list, list);
 		audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 		ast_audiohook_unlock(audiohook);
 		audiohook->manipulate_callback(audiohook, NULL, NULL, 0);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
 
 	/* Drop translation paths if present */
 	for (i = 0; i < 2; i++) {
@@ -453,7 +447,7 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->manipulate_list, audiohook, list) {
 		ast_audiohook_lock(audiohook);
 		if (audiohook->status != AST_AUDIOHOOK_STATUS_RUNNING) {
-			AST_LIST_REMOVE_CURRENT(&audiohook_list->manipulate_list, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 			ast_audiohook_unlock(audiohook);
 			audiohook->manipulate_callback(audiohook, NULL, NULL, 0);
@@ -463,7 +457,7 @@
 			audiohook->manipulate_callback(audiohook, chan, frame, direction);
 		ast_audiohook_unlock(audiohook);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	return frame;
 }
@@ -500,7 +494,7 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->spy_list, audiohook, list) {
 		ast_audiohook_lock(audiohook);
 		if (audiohook->status != AST_AUDIOHOOK_STATUS_RUNNING) {
-			AST_LIST_REMOVE_CURRENT(&audiohook_list->spy_list, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 			ast_cond_signal(&audiohook->trigger);
 			ast_audiohook_unlock(audiohook);
@@ -519,7 +513,7 @@
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->whisper_list, audiohook, list) {
 			ast_audiohook_lock(audiohook);
 			if (audiohook->status != AST_AUDIOHOOK_STATUS_RUNNING) {
-				AST_LIST_REMOVE_CURRENT(&audiohook_list->whisper_list, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 				ast_cond_signal(&audiohook->trigger);
 				ast_audiohook_unlock(audiohook);
@@ -544,7 +538,7 @@
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->manipulate_list, audiohook, list) {
 			ast_audiohook_lock(audiohook);
 			if (audiohook->status != AST_AUDIOHOOK_STATUS_RUNNING) {
-				AST_LIST_REMOVE_CURRENT(&audiohook_list->manipulate_list, list);
+				AST_LIST_REMOVE_CURRENT(list);
 				audiohook->status = AST_AUDIOHOOK_STATUS_DONE;
 				ast_audiohook_unlock(audiohook);
 				/* We basically drop all of our links to the manipulate audiohook and prod it to do it's own destructive things */

Modified: trunk/main/autoservice.c
URL: http://svn.digium.com/view/asterisk/trunk/main/autoservice.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/autoservice.c (original)
+++ trunk/main/autoservice.c Wed Nov  7 23:28:47 2007
@@ -135,14 +135,14 @@
 	AST_RWLIST_WRLOCK(&aslist);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&aslist, as, list) {	
 		if (as->chan == chan) {
-			AST_RWLIST_REMOVE_CURRENT(&aslist, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_free(as);
 			if (!ast_check_hangup(chan))
 				res = 0;
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 
 	if (asthread != AST_PTHREADT_NULL) 
 		pthread_kill(asthread, SIGURG);

Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Wed Nov  7 23:28:47 2007
@@ -151,7 +151,7 @@
 	AST_RWLIST_WRLOCK(&be_list);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&be_list, i, list) {
 		if (!strcasecmp(name, i->name)) {
-			AST_RWLIST_REMOVE_CURRENT(&be_list, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_verb(2, "Unregistered '%s' CDR backend\n", name);
 			ast_free(i);
 			break;
@@ -313,7 +313,7 @@
 			AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
 				if (!strcasecmp(ast_var_name(newvariable), name)) {
 					/* there is already such a variable, delete it */
-					AST_LIST_REMOVE_CURRENT(headp, entries);
+					AST_LIST_REMOVE_CURRENT(entries);
 					ast_var_delete(newvariable);
 					break;
 				}
@@ -491,9 +491,8 @@
 		} else if (tovarname && strcasecmp(fromvarval,tovarval) == 0) /* if they are the same, the job is done */
 			continue;
 
-		/*rip this var out of the from cdr, and stick it in the to cdr */
-		AST_LIST_REMOVE_CURRENT(headpfrom, entries);
-		AST_LIST_INSERT_HEAD(headpto, variablesfrom, entries);
+		/* rip this var out of the from cdr, and stick it in the to cdr */
+		AST_LIST_MOVE_CURRENT(headpto, entries);
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
 }

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed Nov  7 23:28:47 2007
@@ -451,13 +451,13 @@
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&backends, chan, list) {
 		if (chan->tech == tech) {
-			AST_LIST_REMOVE_CURRENT(&backends, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			ast_free(chan);
 			ast_verb(2, "Unregistered channel type '%s'\n", tech->type);
 			break;	
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	AST_RWLIST_UNLOCK(&channels);
 }
@@ -1256,12 +1256,12 @@
 	/* Find our position and remove ourselves */
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->datastores, datastore2, entry) {
 		if (datastore2 == datastore) {
-			AST_LIST_REMOVE_CURRENT(&chan->datastores, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			res = 0;
 			break;
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 
 	return res;
 }

Modified: trunk/main/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cli.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/cli.c (original)
+++ trunk/main/cli.c Wed Nov  7 23:28:47 2007
@@ -1420,7 +1420,7 @@
 		if (lf < len)
 			len = lf;
 		if (strncasecmp(e->_full_cmd, cur->_full_cmd, len) < 0) {
-			AST_RWLIST_INSERT_BEFORE_CURRENT(&helpers, e, list); 
+			AST_RWLIST_INSERT_BEFORE_CURRENT(e, list); 
 			break;
 		}
 	}

Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Wed Nov  7 23:28:47 2007
@@ -545,11 +545,9 @@
 static void ast_destroy_template_list(struct ast_category *cat)
 {
 	struct ast_category_template_instance *x;
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&cat->template_instances, x, next) {
-		AST_LIST_REMOVE_CURRENT(&cat->template_instances, next);
+
+	while ((x = AST_LIST_REMOVE_HEAD(&cat->template_instances, next)))
 		free(x);
-	}
-	AST_LIST_TRAVERSE_SAFE_END;
 }
 
 void ast_category_destroy(struct ast_category *cat)

Modified: trunk/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/trunk/main/devicestate.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/devicestate.c (original)
+++ trunk/main/devicestate.c Wed Nov  7 23:28:47 2007
@@ -372,7 +372,7 @@
 	AST_RWLIST_WRLOCK(&devstate_provs);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&devstate_provs, devcb, list) {
 		if (!strcasecmp(devcb->label, label)) {
-			AST_RWLIST_REMOVE_CURRENT(&devstate_provs, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_free(devcb);
 			res = 0;
 			break;

Modified: trunk/main/event.c
URL: http://svn.digium.com/view/asterisk/trunk/main/event.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/event.c (original)
+++ trunk/main/event.c Wed Nov  7 23:28:47 2007
@@ -708,11 +708,11 @@
 		}
 		if (!cache_arg) {
 			/* All parameters were matched on this cache entry, so remove it */
-			AST_LIST_REMOVE_CURRENT(&ast_event_cache[host_event_type], entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			ast_event_ref_destroy(event_ref);
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	res = ast_event_dup_and_cache(event);
 	AST_RWLIST_UNLOCK(&ast_event_cache[host_event_type]);
 

Modified: trunk/main/file.c
URL: http://svn.digium.com/view/asterisk/trunk/main/file.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Wed Nov  7 23:28:47 2007
@@ -110,12 +110,12 @@
 	AST_RWLIST_WRLOCK(&formats);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&formats, tmp, list) {
 		if (!strcasecmp(name, tmp->name)) {
-			AST_RWLIST_REMOVE_CURRENT(&formats, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_free(tmp);
 			res = 0;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&formats);
 
 	if (!res)

Modified: trunk/main/frame.c
URL: http://svn.digium.com/view/asterisk/trunk/main/frame.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/frame.c (original)
+++ trunk/main/frame.c Wed Nov  7 23:28:47 2007
@@ -452,7 +452,8 @@
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&frames->list, out, frame_list) {
 			if (out->mallocd_hdr_len >= len) {
 				size_t mallocd_len = out->mallocd_hdr_len;
-				AST_LIST_REMOVE_CURRENT(&frames->list, frame_list);
+
+				AST_LIST_REMOVE_CURRENT(frame_list);
 				memset(out, 0, sizeof(*out));
 				out->mallocd_hdr_len = mallocd_len;
 				buf = out;
@@ -460,7 +461,7 @@
 				break;
 			}
 		}
-		AST_LIST_TRAVERSE_SAFE_END
+		AST_LIST_TRAVERSE_SAFE_END;
 	}
 #endif
 

Modified: trunk/main/image.c
URL: http://svn.digium.com/view/asterisk/trunk/main/image.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/image.c (original)
+++ trunk/main/image.c Wed Nov  7 23:28:47 2007
@@ -65,11 +65,11 @@
 	AST_RWLIST_WRLOCK(&imagers);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&imagers, i, list) {	
 		if (i == img) {
-			AST_RWLIST_REMOVE_CURRENT(&imagers, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&imagers);
 	if (i)
 		ast_verb(2, "Unregistered format '%s' (%s)\n", img->name, img->desc);

Modified: trunk/main/indications.c
URL: http://svn.digium.com/view/asterisk/trunk/main/indications.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/indications.c (original)
+++ trunk/main/indications.c Wed Nov  7 23:28:47 2007
@@ -480,12 +480,12 @@
 		if (tz == current_tonezone)
 			current_tonezone = zone;
 		/* Remove from the linked list */
-		AST_RWLIST_REMOVE_CURRENT(&tone_zones, list);
+		AST_RWLIST_REMOVE_CURRENT(list);
 		/* Finally free the zone itself */
 		free_zone(tz);
 		break;
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 
 	/* Add zone to the list */
 	AST_RWLIST_INSERT_TAIL(&tone_zones, zone, list);
@@ -515,12 +515,12 @@
 			current_tonezone = NULL;
 		}
 		/* Remove from the list */
-		AST_RWLIST_REMOVE_CURRENT(&tone_zones, list);
+		AST_RWLIST_REMOVE_CURRENT(list);
 		ast_verb(3, "Unregistered indication country '%s'\n", tz->country);
 		free_zone(tz);
 		res = 0;
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&tone_zones);
 
 	return res;

Modified: trunk/main/loader.c
URL: http://svn.digium.com/view/asterisk/trunk/main/loader.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Wed Nov  7 23:28:47 2007
@@ -169,7 +169,7 @@
 	AST_LIST_LOCK(&module_list);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, mod, entry) {
 		if (mod->info == info) {
-			AST_LIST_REMOVE_CURRENT(&module_list, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			break;
 		}
 	}
@@ -825,7 +825,7 @@
 
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
 			if (!resource_name_match(order->resource, v->value)) {
-				AST_LIST_REMOVE_CURRENT(&load_order, entry);
+				AST_LIST_REMOVE_CURRENT(entry);
 				ast_free(order->resource);
 				ast_free(order);
 			}
@@ -849,7 +849,7 @@
 		switch (load_resource(order->resource, 1)) {
 		case AST_MODULE_LOAD_SUCCESS:
 		case AST_MODULE_LOAD_DECLINE:
-			AST_LIST_REMOVE_CURRENT(&load_order, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			ast_free(order->resource);
 			ast_free(order);
 			break;
@@ -868,7 +868,7 @@
 		switch (load_resource(order->resource, 0)) {
 		case AST_MODULE_LOAD_SUCCESS:
 		case AST_MODULE_LOAD_DECLINE:
-			AST_LIST_REMOVE_CURRENT(&load_order, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			ast_free(order->resource);
 			ast_free(order);
 			break;
@@ -961,7 +961,7 @@
 	AST_LIST_LOCK(&module_list);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&updaters, cur, entry) {
 		if (cur->updater == v)	{
-			AST_LIST_REMOVE_CURRENT(&updaters, entry);
+			AST_LIST_REMOVE_CURRENT(entry);
 			break;
 		}
 	}

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Wed Nov  7 23:28:47 2007
@@ -1166,12 +1166,12 @@
 	AST_RWLIST_WRLOCK(&verbosers);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&verbosers, cur, list) {
 		if (cur->verboser == v) {
-			AST_RWLIST_REMOVE_CURRENT(&verbosers, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			free(cur);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&verbosers);
 	
 	return cur ? 0 : -1;

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Wed Nov  7 23:28:47 2007
@@ -2598,7 +2598,7 @@
 	AST_LIST_LOCK(&sessions);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&sessions, s, list) {
 		if (s->sessiontimeout && (now > s->sessiontimeout) && !s->inuse) {
-			AST_LIST_REMOVE_CURRENT(&sessions, list);
+			AST_LIST_REMOVE_CURRENT(list);
 			ast_atomic_fetchadd_int(&num_sessions, -1);
 			if (s->authenticated && (option_verbose > 1) && manager_displayconnects(s)) {
 				ast_verb(2, "HTTP Manager '%s' timed out from %s\n",
@@ -2609,7 +2609,7 @@
 				break;
 		}
 	}
-	AST_LIST_TRAVERSE_SAFE_END
+	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&sessions);
 }
 
@@ -2719,13 +2719,13 @@
 	AST_RWLIST_WRLOCK(&actions);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&actions, cur, list) {
 		if (!strcasecmp(action, cur->action)) {
-			AST_RWLIST_REMOVE_CURRENT(&actions, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_free(cur);
 			ast_verb(2, "Manager unregistered action %s\n", action);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&actions);
 
 	return 0;
@@ -3476,7 +3476,7 @@
 			continue;
 		}
 		/* We do not need to keep this user so take them out of the list */
-		AST_RWLIST_REMOVE_CURRENT(&users, list);
+		AST_RWLIST_REMOVE_CURRENT(list);
 		/* Free their memory now */
 		if (user->secret)
 			ast_free(user->secret);
@@ -3490,7 +3490,7 @@
 			ast_free(user->write);
 		ast_free(user);
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 
 	AST_RWLIST_UNLOCK(&users);
 

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=89106&r1=89105&r2=89106
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Nov  7 23:28:47 2007
@@ -1514,12 +1514,12 @@
 	AST_RWLIST_WRLOCK(&acf_root);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&acf_root, cur, acflist) {
 		if (cur == acf) {
-			AST_RWLIST_REMOVE_CURRENT(&acf_root, acflist);
+			AST_RWLIST_REMOVE_CURRENT(acflist);
 			ast_verb(2, "Unregistered custom function %s\n", acf->name);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&acf_root);
 
 	return acf ? 0 : -1;
@@ -1547,11 +1547,11 @@
 	/* Store in alphabetical order */
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&acf_root, cur, acflist) {
 		if (strcasecmp(acf->name, cur->name) < 0) {
-			AST_RWLIST_INSERT_BEFORE_CURRENT(&acf_root, acf, acflist);
+			AST_RWLIST_INSERT_BEFORE_CURRENT(acf, acflist);
 			break;
 		}
 	}
-	AST_RWLIST_TRAVERSE_SAFE_END
+	AST_RWLIST_TRAVERSE_SAFE_END;
 	if (!cur)
 		AST_RWLIST_INSERT_TAIL(&acf_root, acf, acflist);
 
@@ -2361,13 +2361,13 @@
 				ast_free(cbprev);
 	    		}
 	    		hint->callbacks = NULL;
-			AST_RWLIST_REMOVE_CURRENT(&hints, list);
+			AST_RWLIST_REMOVE_CURRENT(list);
 	    		ast_free(hint);

[... 396 lines stripped ...]



More information about the asterisk-commits mailing list