[asterisk-commits] seanbright: trunk r358646 - /trunk/include/asterisk/linkedlists.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 8 11:00:26 CST 2012


Author: seanbright
Date: Thu Mar  8 11:00:22 2012
New Revision: 358646

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358646
Log:
Add some underscores in a few of our llist macros to reduce name collisions.

Modified:
    trunk/include/asterisk/linkedlists.h

Modified: trunk/include/asterisk/linkedlists.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/linkedlists.h?view=diff&rev=358646&r1=358645&r2=358646
==============================================================================
--- trunk/include/asterisk/linkedlists.h (original)
+++ trunk/include/asterisk/linkedlists.h Thu Mar  8 11:00:22 2012
@@ -747,24 +747,24 @@
  * \param sortfield Name of the field on which the list is sorted
  * \since 1.6.1
  */
-#define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) do { \
-	if (!(head)->first) {                                           \
-		(head)->first = (elm);                                      \
-		(head)->last = (elm);                                       \
-	} else {                                                        \
-		typeof((head)->first) cur = (head)->first, prev = NULL;     \
-		while (cur && strcmp(cur->sortfield, elm->sortfield) < 0) { \
-			prev = cur;                                             \
-			cur = cur->field.next;                                  \
-		}                                                           \
-		if (!prev) {                                                \
-			AST_LIST_INSERT_HEAD(head, elm, field);                 \
-		} else if (!cur) {                                          \
-			AST_LIST_INSERT_TAIL(head, elm, field);                 \
-		} else {                                                    \
-			AST_LIST_INSERT_AFTER(head, prev, elm, field);          \
-		}                                                           \
-	}                                                               \
+#define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) do {     \
+	if (!(head)->first) {                                               \
+		(head)->first = (elm);                                          \
+		(head)->last = (elm);                                           \
+	} else {                                                            \
+		typeof((head)->first) __cur = (head)->first, __prev = NULL;     \
+		while (__cur && strcmp(__cur->sortfield, elm->sortfield) < 0) { \
+			__prev = __cur;                                             \
+			__cur = __cur->field.next;                                  \
+		}                                                               \
+		if (!__prev) {                                                  \
+			AST_LIST_INSERT_HEAD(head, elm, field);                     \
+		} else if (!__cur) {                                            \
+			AST_LIST_INSERT_TAIL(head, elm, field);                     \
+		} else {                                                        \
+			AST_LIST_INSERT_AFTER(head, __prev, elm, field);            \
+		}                                                               \
+	}                                                                   \
 } while (0)
 
 #define AST_RWLIST_INSERT_SORTALPHA	AST_LIST_INSERT_SORTALPHA
@@ -830,14 +830,14 @@
  * This macro is safe to call on an empty list.
  */
 #define AST_LIST_REMOVE_HEAD(head, field) ({				\
-		typeof((head)->first) cur = (head)->first;		\
-		if (cur) {						\
-			(head)->first = cur->field.next;		\
-			cur->field.next = NULL;				\
-			if ((head)->last == cur)			\
+		typeof((head)->first) __cur = (head)->first;		\
+		if (__cur) {						\
+			(head)->first = __cur->field.next;		\
+			__cur->field.next = NULL;			\
+			if ((head)->last == __cur)			\
 				(head)->last = NULL;			\
 		}							\
-		cur;							\
+		__cur;							\
 	})
 
 #define AST_RWLIST_REMOVE_HEAD AST_LIST_REMOVE_HEAD




More information about the asterisk-commits mailing list