diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-21 21:13:09 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-21 21:13:09 +0000 |
commit | 230a66da7d98b2b6d328a04b0e7180b94d9c76bf (patch) | |
tree | b40d978190102dbe6f14458ab8a70f358db533e4 /funcs | |
parent | d57c20e50d7105f72bb90e709965ad5e04c5e36a (diff) |
Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:
- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments
In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.
Review: https://reviewboard.asterisk.org/r/251/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_devstate.c | 4 | ||||
-rw-r--r-- | funcs/func_odbc.c | 2 | ||||
-rw-r--r-- | funcs/func_strings.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/funcs/func_devstate.c b/funcs/func_devstate.c index a25638867..6e4a674d0 100644 --- a/funcs/func_devstate.c +++ b/funcs/func_devstate.c @@ -255,8 +255,8 @@ static char *handle_cli_devstate_change(struct ast_cli_entry *e, int cmd, struct return NULL; case CLI_GENERATE: { - static char * const cmds[] = { "UNKNOWN", "NOT_INUSE", "INUSE", "BUSY", - "UNAVAILABLE", "RINGING", "RINGINUSE", "ONHOLD", NULL }; + static const char * const cmds[] = { "UNKNOWN", "NOT_INUSE", "INUSE", "BUSY", + "UNAVAILABLE", "RINGING", "RINGINUSE", "ONHOLD", NULL }; if (a->pos == e->args + 1) return ast_cli_complete(a->word, cmds, a->n); diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index 4bfe1a23d..85fdd09b4 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -732,7 +732,7 @@ static struct ast_custom_function fetch_function = { static char *app_odbcfinish = "ODBCFinish"; -static int exec_odbcfinish(struct ast_channel *chan, void *data) +static int exec_odbcfinish(struct ast_channel *chan, const char *data) { struct ast_datastore *store = ast_channel_datastore_find(chan, &odbc_info, data); if (!store) /* Already freed; no big deal. */ diff --git a/funcs/func_strings.c b/funcs/func_strings.c index a2ba285d4..b4f29b132 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -654,7 +654,7 @@ static void clearvar_prefix(struct ast_channel *chan, const char *prefix) AST_LIST_TRAVERSE_SAFE_END } -static int exec_clearhash(struct ast_channel *chan, void *data) +static int exec_clearhash(struct ast_channel *chan, const char *data) { char prefix[80]; snprintf(prefix, sizeof(prefix), HASH_PREFIX, data ? (char *)data : "null"); |