From 7343abf86992cbec54890cf2d858134f30039d59 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Thu, 25 Oct 2007 23:03:11 +0000 Subject: appending one list to another should leave the first list empty, and not require the user to do that git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87069 f38db490-d61c-443f-a65b-d21fe96a405b --- include/asterisk/linkedlists.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/asterisk') diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h index 70a5cdcae..a8d90ecbe 100644 --- a/include/asterisk/linkedlists.h +++ b/include/asterisk/linkedlists.h @@ -686,6 +686,9 @@ struct { \ \param list This is a pointer to the list to be appended. \param field This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. + + Note: The source list (the \a list parameter) will be empty after + calling this macro (the list entries are \b moved to the target list). */ #define AST_LIST_APPEND_LIST(head, list, field) do { \ if (!(head)->first) { \ @@ -695,6 +698,8 @@ struct { \ (head)->last->field.next = (list)->first; \ (head)->last = (list)->last; \ } \ + (list)->first = NULL; \ + (list)->last = NULL; \ } while (0) #define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST -- cgit v1.2.3