[Asterisk-cvs] asterisk/include/asterisk linkedlists.h,1.6,1.7

markster at lists.digium.com markster at lists.digium.com
Thu Dec 23 10:16:08 CST 2004


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv32222/include/asterisk

Modified Files:
	linkedlists.h 
Log Message:
Speed up ast_list macros (bug #3135)


Index: linkedlists.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/linkedlists.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- linkedlists.h	19 Dec 2004 18:33:05 -0000	1.6
+++ linkedlists.h	23 Dec 2004 15:11:46 -0000	1.7
@@ -62,13 +62,15 @@
 } while (0)
 
 
-#define AST_LIST_REMOVE_HEAD(head, field) do {					\
+#define AST_LIST_REMOVE_HEAD(head, type, field) ({				\
+		struct type *cur = (head)->first;				\
 		(head)->first = (head)->first->field.next;			\
-	} while (0)
+		cur;								\
+	})
 
 #define AST_LIST_REMOVE(head, elm, type, field) do {			\
 	if ((head)->first == (elm)) {					\
-		AST_LIST_REMOVE_HEAD((head), field);			\
+		AST_LIST_REMOVE_HEAD((head), type, field);		\
 	}								\
 	else {								\
 		struct type *curelm = (head)->first;			\




More information about the svn-commits mailing list