]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure that all ast_datastore_info structures are 'const'.
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 18 Jul 2012 17:18:20 +0000 (17:18 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 18 Jul 2012 17:18:20 +0000 (17:18 +0000)
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.
........

Merged revisions 370183 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370184 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 files changed:
addons/app_mysql.c
apps/app_macro.c
apps/app_mixmonitor.c
apps/app_stack.c
channels/chan_iax2.c
funcs/func_curl.c
funcs/func_global.c
funcs/func_lock.c
funcs/func_odbc.c
main/ccss.c
main/channel.c
main/pbx.c
res/res_odbc.c

index 5649166a72b6b4aa07687b3f399ed2c7482eb20b..9ee584e27af53c49b2710d130c27781563540375 100644 (file)
@@ -106,7 +106,7 @@ static int autoclear = 0;
 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,
index 8f10d119e0c359436ee1fac9c2089b1def87b1c3..337091f238d102e222a6a8b902aa9c0d22a4b853 100644 (file)
@@ -164,7 +164,7 @@ static char *exit_app = "MacroExit";
 
 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,
 };
index b3c37f31ec027615be53f96fdffbc36a48d7048d..7da3bea692ba976405c714985b61f09e685b1bf9 100644 (file)
@@ -383,7 +383,7 @@ static void mixmonitor_ds_destroy(void *data)
        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,
 };
index 00a63480dc2050cf2a3510a05bf9a960e801194c..e32d56dd7645855c21c21effeea685587faffff6 100644 (file)
@@ -212,7 +212,7 @@ static const char app_pop[] = "StackPop";
 
 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,
 };
index cc51624f2ea1c375b2a8a808a9dbcecb572e2b7a..199834ddf4db13ca58313d540eb3a7d33932177b 100644 (file)
@@ -1380,7 +1380,7 @@ static void iax2_ami_channelupdate(struct chan_iax2_pvt *pvt)
                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,
index a4328b92392717d4fde67ad8edd125b353b8c355..2305d3719fc661cc0edc927395d0dfde2e09cbf0 100644 (file)
@@ -174,7 +174,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 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,
 };
index de8de8a50abe77589336b9864ba00564c315dec9..e16b60ac116df748cb14a6e9c799e29a7781e41a 100644 (file)
@@ -88,7 +88,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 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,
 };
index 9394b3918b1a98510f82f410435c4ee3b17e8c5c..d8db10e842a07ea5d84ff3af1bfb22290bc26950 100644 (file)
@@ -99,7 +99,7 @@ static void lock_fixup(void *data, struct ast_channel *oldchan, struct ast_chann
 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,
index 5b24878a666c912c2cb311b1b33c3ba7c4093d8e..d6a11cd1a2c1d11c78c8f6d87747fb8f44b5868d 100644 (file)
@@ -119,7 +119,7 @@ struct acf_odbc_query {
 
 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,
 };
index 03c75d750e4b5abea9eb0c29035f5ae5888893af..76b02dac6cae6bb15c5008c971d5254f63786738 100644 (file)
@@ -1845,7 +1845,7 @@ static void *dialed_cc_interfaces_duplicate(void *data)
  * 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,
@@ -3285,7 +3285,7 @@ static void cc_recall_ds_destroy(void *data)
        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,
index 9abd9e7e021638350975e13507d029b7085c3d23..1cfb76702a0560219cb0692011b182bbab400861 100644 (file)
@@ -473,7 +473,7 @@ static void ast_chan_trace_destroy_cb(void *data)
 }
 
 /*! \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
 };
@@ -2377,7 +2377,7 @@ static void ast_dummy_channel_destructor(void *obj)
        ast_channel_internal_cleanup(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);
 }
@@ -2418,7 +2418,7 @@ int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore
        return AST_LIST_REMOVE(ast_channel_datastores(chan), 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;
 
@@ -4700,7 +4700,7 @@ static void plc_ds_destroy(void *data)
        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,
 };
@@ -6247,7 +6247,7 @@ static void xfer_ds_destroy(void *data)
        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,
 };
@@ -10021,7 +10021,7 @@ static void channel_cc_params_destroy(void *data)
        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,
index cbfbafa6960ebff55dcee7aa28eeade8d785f9fe..a1ed1b52d687befef378f228af8c1521a25ad79a 100644 (file)
@@ -3437,7 +3437,7 @@ static void exception_store_free(void *data)
        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,
 };
index 3afa088dae5a71b30a8d591bb28482e323ff2873..797f31ece89f945ebc527d084f20f00071652d58 100644 (file)
@@ -153,7 +153,7 @@ static void odbc_release_obj2(struct odbc_obj *obj, struct odbc_txn_frame *tx);
 
 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,
 };