]> 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:10:36 +0000 (17:10 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 18 Jul 2012 17:10:36 +0000 (17:10 +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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@370183 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 9633390761f07d9a2cd892d57f1802fcc6f2a011..839dad88af6d3f844b5cd760c29883e234b26ecf 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 86237b3b306f24d2df6ea204ee6fb76d0d705472..104705bc0f5452f71fac6c23913d565f92de41e3 100644 (file)
@@ -232,7 +232,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 aa597f0674d90c1524ab1399dfc09da1ebaa5396..68aa062cc92f6a0879578694ce895d0a4d6c663c 100644 (file)
@@ -212,7 +212,7 @@ static const char * const 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 dab1590c32b7d872f124af5d24427a04876d31be..47fa4e9aad7da35467d9bc8e784c239858871c53 100644 (file)
@@ -1328,7 +1328,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 1bcf2336165f7f395eea7965bde0e0af8db6f41e..85ae77f8a1ad944e653d1de0037792f101787890 100644 (file)
@@ -165,7 +165,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 201f075d478e3e89129bf88c89a51af5dd4c817f..8507b1d273fdf66c157b37a0a41e9384c1e95bfc 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 ef09ed02fb95291b9a6f5af4ea76043ad876e2a2..92d57768ffc041b1e0ea7ff41b14d8c10c9784c3 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 e2a6a62d5b61d5ba788fabd3b581cdf9fbf8f184..9625fcc62a154ba67643ada74c0505c0e4b9e7b3 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 6c4f1ac81cba8937c605627899e692cba81ff780..0ec08b1644ccd8a66596b92c034e0938b851783d 100644 (file)
@@ -1716,7 +1716,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,
@@ -3130,7 +3130,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 4276d530d132eb8a1ea45507a4ffa9af4d310915..05186025cdc4e2f7982e2d7d886dc7f5b88bfb1f 100644 (file)
@@ -679,7 +679,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
 };
@@ -2520,7 +2520,7 @@ static void ast_dummy_channel_destructor(void *obj)
        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 @@ int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore
        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 @@ 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,
 };
@@ -6053,7 +6053,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,
 };
@@ -9493,7 +9493,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 3ecdb5c1d4ef9f7e26fe15cf62d99c94a256b953..412fd9f53be8b58309641d5a97bae1900ed227d1 100644 (file)
@@ -3277,7 +3277,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 c51eaac43a6ba637f2fc8e95f3c2ac22cdafb5f1..607c9a7f8f62ffc7b6c003361bb568dc07959222 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,
 };