[asterisk-commits] russell: branch
russell/ast_verbose_threadstorage r38487 - in /team/russell/a...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Jul 29 11:24:43 MST 2006
Author: russell
Date: Sat Jul 29 13:24:42 2006
New Revision: 38487
URL: http://svn.digium.com/view/asterisk?rev=38487&view=rev
Log:
- add the unused attribute to compiler.h
- rename FREE to ast_free due to a conflict with res_snmp
Modified:
team/russell/ast_verbose_threadstorage/channels/chan_iax2.c
team/russell/ast_verbose_threadstorage/channels/chan_sip.c
team/russell/ast_verbose_threadstorage/include/asterisk/compiler.h
team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h
team/russell/ast_verbose_threadstorage/include/asterisk/utils.h
team/russell/ast_verbose_threadstorage/pbx/pbx_ael.c
team/russell/ast_verbose_threadstorage/pbx/pbx_config.c
team/russell/ast_verbose_threadstorage/res/res_features.c
Modified: team/russell/ast_verbose_threadstorage/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/channels/chan_iax2.c?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/channels/chan_iax2.c (original)
+++ team/russell/ast_verbose_threadstorage/channels/chan_iax2.c Sat Jul 29 13:24:42 2006
@@ -5441,7 +5441,7 @@
if (onoff) {
if (!ast_exists_extension(NULL, regcontext, ext, 1, NULL))
ast_add_extension(regcontext, 1, ext, 1, NULL, NULL,
- "Noop", ast_strdup(peer->name), FREE, "IAX2");
+ "Noop", ast_strdup(peer->name), ast_free, "IAX2");
} else
ast_context_remove_extension(regcontext, ext, 1, NULL);
}
Modified: team/russell/ast_verbose_threadstorage/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/channels/chan_sip.c?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/channels/chan_sip.c (original)
+++ team/russell/ast_verbose_threadstorage/channels/chan_sip.c Sat Jul 29 13:24:42 2006
@@ -2244,7 +2244,7 @@
}
if (onoff)
ast_add_extension(context, 1, ext, 1, NULL, NULL, "Noop",
- ast_strdup(peer->name), FREE, "SIP");
+ ast_strdup(peer->name), ast_free, "SIP");
else
ast_context_remove_extension(context, ext, 1, NULL);
}
Modified: team/russell/ast_verbose_threadstorage/include/asterisk/compiler.h
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/include/asterisk/compiler.h?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/include/asterisk/compiler.h (original)
+++ team/russell/ast_verbose_threadstorage/include/asterisk/compiler.h Sat Jul 29 13:24:42 2006
@@ -33,5 +33,6 @@
#endif
#define attribute_const __attribute__((const))
+#define attribute_unused __attribute__((unused))
#endif /* _ASTERISK_COMPILER_H */
Modified: team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h (original)
+++ team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h Sat Jul 29 13:24:42 2006
@@ -58,15 +58,15 @@
* AST_THREADSTORAGE(my_buf, my_buf_init);
* \endcode
*/
-#define AST_THREADSTORAGE(name, name_init) \
-static void name_init(void); \
-static struct ast_threadstorage name = { \
- .once = PTHREAD_ONCE_INIT, \
- .key_init = name_init, \
-}; \
-static void name_init(void) \
-{ \
- pthread_key_create(&(name).key, FREE); \
+#define AST_THREADSTORAGE(name, name_init) \
+static void name_init(void); \
+static struct ast_threadstorage name = { \
+ .once = PTHREAD_ONCE_INIT, \
+ .key_init = name_init, \
+}; \
+static void name_init(void) \
+{ \
+ pthread_key_create(&(name).key, ast_free); \
}
/*!
Modified: team/russell/ast_verbose_threadstorage/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/include/asterisk/utils.h?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/include/asterisk/utils.h (original)
+++ team/russell/ast_verbose_threadstorage/include/asterisk/utils.h Sat Jul 29 13:24:42 2006
@@ -35,6 +35,7 @@
#include "asterisk/time.h"
#include "asterisk/strings.h"
#include "asterisk/logger.h"
+#include "asterisk/compiler.h"
/*! \note
\verbatim
@@ -275,16 +276,17 @@
/*!
* \brief free() wrapper
*
- * FREE should be used when a function pointer for free() needs to be passed
+ * ast_free should be used when a function pointer for free() needs to be passed
* as the argument to an application. Otherwise, astmm will cause seg faults.
*/
#ifdef __AST_DEBUG_MALLOC
-static void __attribute__ ((unused)) FREE(void *ptr)
+static void ast_free(void *ptr) attribute_unused;
+static void ast_free(void *ptr)
{
free(ptr);
}
#else
-#define FREE free
+#define ast_free free
#endif
#ifndef __AST_DEBUG_MALLOC
Modified: team/russell/ast_verbose_threadstorage/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/pbx/pbx_ael.c?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/pbx/pbx_ael.c (original)
+++ team/russell/ast_verbose_threadstorage/pbx/pbx_ael.c Sat Jul 29 13:24:42 2006
@@ -3179,7 +3179,7 @@
if (exten->hints) {
if (ast_add_extension2(context, 0 /*no replace*/, exten->name, PRIORITY_HINT, NULL, exten->cidmatch,
- exten->hints, NULL, FREE, registrar)) {
+ exten->hints, NULL, ast_free, registrar)) {
ast_log(LOG_WARNING, "Unable to add step at priority 'hint' of extension '%s'\n",
exten->name);
}
@@ -3261,7 +3261,7 @@
if (ast_add_extension2(context, 0 /*no replace*/, exten->name, pr->priority_num, (label?label:NULL), exten->cidmatch,
- app, strdup(appargs), FREE, registrar)) {
+ app, strdup(appargs), ast_free, registrar)) {
ast_log(LOG_WARNING, "Unable to add step at priority '%d' of extension '%s'\n", pr->priority_num,
exten->name);
}
Modified: team/russell/ast_verbose_threadstorage/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/pbx/pbx_config.c?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/pbx/pbx_config.c (original)
+++ team/russell/ast_verbose_threadstorage/pbx/pbx_config.c Sat Jul 29 13:24:42 2006
@@ -1449,7 +1449,7 @@
lastpri = ipri;
if (!ast_opt_dont_warn && !strcmp(realext, "_."))
ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior. Please use '_X.' instead at line %d\n", v->lineno);
- if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), FREE, registrar)) {
+ if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), ast_free, registrar)) {
ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
}
}
Modified: team/russell/ast_verbose_threadstorage/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/res/res_features.c?rev=38487&r1=38486&r2=38487&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/res/res_features.c (original)
+++ team/russell/ast_verbose_threadstorage/res/res_features.c Sat Jul 29 13:24:42 2006
@@ -409,7 +409,7 @@
if (!con) /* Still no context? Bad */
ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
else { /* Add extension to context */
- if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, strdup(pu->parkingexten), FREE, registrar))
+ if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, strdup(pu->parkingexten), ast_free, registrar))
notify_metermaids(pu->parkingexten, parking_con);
}
/* Tell the peer channel the number of the parking space */
@@ -1528,7 +1528,7 @@
if (con) {
char returnexten[AST_MAX_EXTENSION];
snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
- ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), FREE, registrar);
+ ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), ast_free, registrar);
}
set_c_e_p(chan, parking_con_dial, peername, 1);
} else {
@@ -2220,7 +2220,7 @@
ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
return -1;
}
- res = ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), FREE, registrar);
+ res = ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), ast_free, registrar);
if (parkaddhints)
park_add_hints(parking_con, parking_start, parking_stop);
if (!res)
More information about the asterisk-commits
mailing list