summaryrefslogtreecommitdiff
path: root/apps/app_stack.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
commite6b2e9a7501b5d2e351a5e626fa13dfc3c113f1e (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /apps/app_stack.c
parent88bda581ec7c524050bca769c6705ee5c66357ad (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: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_stack.c')
-rw-r--r--apps/app_stack.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/app_stack.c b/apps/app_stack.c
index 64522afdd..27652c3bd 100644
--- a/apps/app_stack.c
+++ b/apps/app_stack.c
@@ -266,7 +266,7 @@ static void gosub_free(void *data)
ast_free(oldlist);
}
-static int pop_exec(struct ast_channel *chan, void *data)
+static int pop_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
struct gosub_stack_frame *oldframe;
@@ -290,12 +290,12 @@ static int pop_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int return_exec(struct ast_channel *chan, void *data)
+static int return_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
struct gosub_stack_frame *oldframe;
AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
- char *retval = data;
+ const char *retval = data;
if (!stack_store) {
ast_log(LOG_ERROR, "Return without Gosub: stack is unallocated\n");
@@ -320,7 +320,7 @@ static int return_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int gosub_exec(struct ast_channel *chan, void *data)
+static int gosub_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
@@ -410,7 +410,7 @@ static int gosub_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int gosubif_exec(struct ast_channel *chan, void *data)
+static int gosubif_exec(struct ast_channel *chan, const char *data)
{
char *args;
int res=0;
@@ -537,7 +537,7 @@ static struct ast_custom_function peek_function = {
.read = peek_read,
};
-static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **argv)
+static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char * const *argv)
{
int old_priority, priority;
char old_context[AST_MAX_CONTEXT], old_extension[AST_MAX_EXTENSION];
@@ -627,7 +627,7 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **arg
return RESULT_SUCCESS;
}
-static char usage_gosub[] =
+static const char usage_gosub[] =
" Usage: GOSUB <context> <extension> <priority> [<optional-argument>]\n"
" Cause the channel to execute the specified dialplan subroutine, returning\n"
" to the dialplan with execution of a Return()\n";