[asterisk-commits] kpfleming: branch 1.8 r370183 - in /branches/1.8: addons/ apps/ channels/ fun...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 18 12:10:42 CDT 2012


Author: kpfleming
Date: Wed Jul 18 12:10:36 2012
New Revision: 370183

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370183
Log:
Ensure that all ast_datastore_info structures are 'const'.

While addressing a bug, I came across a instance of 'struct ast_datastore_info'
that was not declared 'const'. Since the API already expects them to be
'const', this patch changes the declarations of all existing instances
that were not already declared that way.


Modified:
    branches/1.8/addons/app_mysql.c
    branches/1.8/apps/app_macro.c
    branches/1.8/apps/app_mixmonitor.c
    branches/1.8/apps/app_stack.c
    branches/1.8/channels/chan_iax2.c
    branches/1.8/funcs/func_curl.c
    branches/1.8/funcs/func_global.c
    branches/1.8/funcs/func_lock.c
    branches/1.8/funcs/func_odbc.c
    branches/1.8/main/ccss.c
    branches/1.8/main/channel.c
    branches/1.8/main/pbx.c
    branches/1.8/res/res_odbc.c

Modified: branches/1.8/addons/app_mysql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/addons/app_mysql.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/addons/app_mysql.c (original)
+++ branches/1.8/addons/app_mysql.c Wed Jul 18 12:10:36 2012
@@ -106,7 +106,7 @@
 static void mysql_ds_destroy(void *data);
 static void mysql_ds_fixup(void *data, struct ast_channel *oldchan, struct ast_channel *newchan);
 
-static struct ast_datastore_info mysql_ds_info = {
+static const struct ast_datastore_info mysql_ds_info = {
 	.type = "APP_ADDON_SQL_MYSQL",
 	.destroy = mysql_ds_destroy,
 	.chan_fixup = mysql_ds_fixup,

Modified: branches/1.8/apps/app_macro.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_macro.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/apps/app_macro.c (original)
+++ branches/1.8/apps/app_macro.c Wed Jul 18 12:10:36 2012
@@ -164,7 +164,7 @@
 
 static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
 
-static struct ast_datastore_info macro_ds_info = {
+static const struct ast_datastore_info macro_ds_info = {
 	.type = "MACRO",
 	.chan_fixup = macro_fixup,
 };

Modified: branches/1.8/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_mixmonitor.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/apps/app_mixmonitor.c (original)
+++ branches/1.8/apps/app_mixmonitor.c Wed Jul 18 12:10:36 2012
@@ -232,7 +232,7 @@
 	ast_mutex_unlock(&mixmonitor_ds->lock);
 }
 
-static struct ast_datastore_info mixmonitor_ds_info = {
+static const struct ast_datastore_info mixmonitor_ds_info = {
 	.type = "mixmonitor",
 	.destroy = mixmonitor_ds_destroy,
 };

Modified: branches/1.8/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_stack.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/apps/app_stack.c (original)
+++ branches/1.8/apps/app_stack.c Wed Jul 18 12:10:36 2012
@@ -212,7 +212,7 @@
 
 static void gosub_free(void *data);
 
-static struct ast_datastore_info stack_info = {
+static const struct ast_datastore_info stack_info = {
 	.type = "GOSUB",
 	.destroy = gosub_free,
 };

Modified: branches/1.8/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_iax2.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/channels/chan_iax2.c (original)
+++ branches/1.8/channels/chan_iax2.c Wed Jul 18 12:10:36 2012
@@ -1328,7 +1328,7 @@
 		pvt->callno, pvt->peercallno, pvt->peer ? pvt->peer : "");
 }
 
-static struct ast_datastore_info iax2_variable_datastore_info = {
+static const struct ast_datastore_info iax2_variable_datastore_info = {
 	.type = "IAX2_VARIABLE",
 	.duplicate = iax2_dup_variable_datastore,
 	.destroy = iax2_free_variable_datastore,

Modified: branches/1.8/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_curl.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/funcs/func_curl.c (original)
+++ branches/1.8/funcs/func_curl.c Wed Jul 18 12:10:36 2012
@@ -165,7 +165,7 @@
 
 static void curlds_free(void *data);
 
-static struct ast_datastore_info curl_info = {
+static const struct ast_datastore_info curl_info = {
 	.type = "CURL",
 	.destroy = curlds_free,
 };

Modified: branches/1.8/funcs/func_global.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_global.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/funcs/func_global.c (original)
+++ branches/1.8/funcs/func_global.c Wed Jul 18 12:10:36 2012
@@ -88,7 +88,7 @@
 
 static void shared_variable_free(void *data);
 
-static struct ast_datastore_info shared_variable_info = {
+static const struct ast_datastore_info shared_variable_info = {
 	.type = "SHARED_VARIABLES",
 	.destroy = shared_variable_free,
 };

Modified: branches/1.8/funcs/func_lock.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_lock.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/funcs/func_lock.c (original)
+++ branches/1.8/funcs/func_lock.c Wed Jul 18 12:10:36 2012
@@ -99,7 +99,7 @@
 static int unloading = 0;
 static pthread_t broker_tid = AST_PTHREADT_NULL;
 
-static struct ast_datastore_info lock_info = {
+static const struct ast_datastore_info lock_info = {
 	.type = "MUTEX",
 	.destroy = lock_free,
 	.chan_fixup = lock_fixup,

Modified: branches/1.8/funcs/func_odbc.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_odbc.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/funcs/func_odbc.c (original)
+++ branches/1.8/funcs/func_odbc.c Wed Jul 18 12:10:36 2012
@@ -119,7 +119,7 @@
 
 static void odbc_datastore_free(void *data);
 
-static struct ast_datastore_info odbc_info = {
+static const struct ast_datastore_info odbc_info = {
 	.type = "FUNC_ODBC",
 	.destroy = odbc_datastore_free,
 };

Modified: branches/1.8/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/ccss.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/main/ccss.c (original)
+++ branches/1.8/main/ccss.c Wed Jul 18 12:10:36 2012
@@ -1716,7 +1716,7 @@
  * more information regarding the actual structure of the tree, see
  * the documentation provided in include/asterisk/ccss.h
  */
-static const struct ast_datastore_info dialed_cc_interfaces_info = {
+static const const struct ast_datastore_info dialed_cc_interfaces_info = {
 	.type = "Dial CC Interfaces",
 	.duplicate = dialed_cc_interfaces_duplicate,
 	.destroy = dialed_cc_interfaces_destroy,
@@ -3130,7 +3130,7 @@
 	ast_free(recall_data);
 }
 
-static struct ast_datastore_info recall_ds_info = {
+static const struct ast_datastore_info recall_ds_info = {
 	.type = "cc_recall",
 	.duplicate = cc_recall_ds_duplicate,
 	.destroy = cc_recall_ds_destroy,

Modified: branches/1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/channel.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/main/channel.c (original)
+++ branches/1.8/main/channel.c Wed Jul 18 12:10:36 2012
@@ -679,7 +679,7 @@
 }
 
 /*! \brief Datastore to put the linked list of ast_chan_trace and trace status */
-static const struct ast_datastore_info ast_chan_trace_datastore_info = {
+static const const struct ast_datastore_info ast_chan_trace_datastore_info = {
 	.type = "ChanTrace",
 	.destroy = ast_chan_trace_destroy_cb
 };
@@ -2520,7 +2520,7 @@
 	ast_string_field_free_memory(chan);
 }
 
-struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
+struct ast_datastore *ast_channel_datastore_alloc(const const struct ast_datastore_info *info, const char *uid)
 {
 	return ast_datastore_alloc(info, uid);
 }
@@ -2561,7 +2561,7 @@
 	return AST_LIST_REMOVE(&chan->datastores, datastore, entry) ? 0 : -1;
 }
 
-struct ast_datastore *ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
+struct ast_datastore *ast_channel_datastore_find(struct ast_channel *chan, const const struct ast_datastore_info *info, const char *uid)
 {
 	struct ast_datastore *datastore = NULL;
 	
@@ -4707,7 +4707,7 @@
 	ast_free(plc);
 }
 
-static struct ast_datastore_info plc_ds_info = {
+static const struct ast_datastore_info plc_ds_info = {
 	.type = "plc",
 	.destroy = plc_ds_destroy,
 };
@@ -6053,7 +6053,7 @@
 	ast_free(ds);
 }
 
-static const struct ast_datastore_info xfer_ds_info = {
+static const const struct ast_datastore_info xfer_ds_info = {
 	.type = "xfer_colp",
 	.destroy = xfer_ds_destroy,
 };
@@ -9493,7 +9493,7 @@
 	ast_cc_config_params_destroy(cc_params);
 }
 
-static const struct ast_datastore_info cc_channel_datastore_info = {
+static const const struct ast_datastore_info cc_channel_datastore_info = {
 	.type = "Call Completion",
 	.duplicate = channel_cc_params_copy,
 	.destroy = channel_cc_params_destroy,

Modified: branches/1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/pbx.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/main/pbx.c (original)
+++ branches/1.8/main/pbx.c Wed Jul 18 12:10:36 2012
@@ -3277,7 +3277,7 @@
 	ast_free(exception);
 }
 
-static struct ast_datastore_info exception_store_info = {
+static const struct ast_datastore_info exception_store_info = {
 	.type = "EXCEPTION",
 	.destroy = exception_store_free,
 };

Modified: branches/1.8/res/res_odbc.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_odbc.c?view=diff&rev=370183&r1=370182&r2=370183
==============================================================================
--- branches/1.8/res/res_odbc.c (original)
+++ branches/1.8/res/res_odbc.c Wed Jul 18 12:10:36 2012
@@ -153,7 +153,7 @@
 
 AST_THREADSTORAGE(errors_buf);
 
-static struct ast_datastore_info txn_info = {
+static const struct ast_datastore_info txn_info = {
 	.type = "ODBC_Transaction",
 	.destroy = odbc_txn_free,
 };




More information about the asterisk-commits mailing list