[asterisk-commits] trunk r10255 - in /trunk: apps/app_voicemail.c include/asterisk/linkedlists.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 15 16:00:09 MST 2006


Author: tilghman
Date: Wed Feb 15 17:00:07 2006
New Revision: 10255

URL: http://svn.digium.com/view/asterisk?rev=10255&view=rev
Log:
Define the initial values separate from the STATIC definitions

Modified:
    trunk/apps/app_voicemail.c
    trunk/include/asterisk/linkedlists.h

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=10255&r1=10254&r2=10255&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Feb 15 17:00:07 2006
@@ -3355,8 +3355,8 @@
 	char callerid[512];
 	char ext_context[256]="";
 	int res = 0, cmd = 0;
-	struct ast_vm_user *receiver, *vmtmp;
-	AST_LIST_HEAD_NOLOCK(extension, ast_vm_user) extensions;
+	struct ast_vm_user *receiver = NULL, *vmtmp;
+	AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
 	char tmp[256];
 	char *stringp, *s;
 	int saved_messages = 0, found = 0;

Modified: trunk/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/linkedlists.h?rev=10255&r1=10254&r2=10255&view=diff
==============================================================================
--- trunk/include/asterisk/linkedlists.h (original)
+++ trunk/include/asterisk/linkedlists.h Wed Feb 15 17:00:07 2006
@@ -101,6 +101,23 @@
 }
 
 /*!
+  \brief Defines initial values for a declaration of AST_LIST_HEAD
+*/
+#define AST_LIST_HEAD_INIT_VALUE	{		\
+	.first = NULL,					\
+	.last = NULL,					\
+	.lock = AST_MUTEX_INIT_VALUE,			\
+	}
+
+/*!
+  \brief Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK
+*/
+#define AST_LIST_HEAD_NOLOCK_INIT_VALUE	{	\
+	.first = NULL,					\
+	.last = NULL,					\
+	}
+
+/*!
   \brief Defines a structure to be used to hold a list of specified type, statically initialized.
   \param name This will be the name of the defined structure.
   \param type This is the type of each list entry.
@@ -122,11 +139,7 @@
 	struct type *first;						\
 	struct type *last;						\
 	ast_mutex_t lock;						\
-} name = {								\
-	.first = NULL,							\
-	.last = NULL,							\
-	.lock = AST_MUTEX_INIT_VALUE,					\
-};
+} name = AST_LIST_HEAD_INIT_VALUE;
 
 /*!
   \brief Defines a structure to be used to hold a list of specified type, statically initialized.
@@ -137,10 +150,7 @@
 struct name {								\
 	struct type *first;						\
 	struct type *last;						\
-} name = {								\
-	.first = NULL,							\
-	.last = NULL,							\
-};
+} name = AST_LIST_HEAD_NOLOCK_INIT_VALUE;
 
 /*!
   \brief Initializes a list head structure with a specified first entry.



More information about the asterisk-commits mailing list