diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2009-05-21 21:13:09 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2009-05-21 21:13:09 +0000 |
commit | e6b2e9a7501b5d2e351a5e626fa13dfc3c113f1e (patch) | |
tree | b40d978190102dbe6f14458ab8a70f358db533e4 /apps/app_voicemail.c | |
parent | 88bda581ec7c524050bca769c6705ee5c66357ad (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_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 07bd8aa19..4362dbcd8 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -5090,8 +5090,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ return -1; } - ast_str_set(&tmp, 0, "%s", ext); - ext = ast_str_buffer(tmp); + ext = ast_strdupa(ext); if ((context = strchr(ext, '@'))) { *context++ = '\0'; tmpptr = strchr(context, '&'); @@ -8947,7 +8946,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ return 0; } -static int vm_execmain(struct ast_channel *chan, void *data) +static int vm_execmain(struct ast_channel *chan, const char *data) { /* XXX This is, admittedly, some pretty horrendous code. For some reason it just seemed a lot easier to do with GOTO's. I feel @@ -9655,7 +9654,7 @@ out: return res; } -static int vm_exec(struct ast_channel *chan, void *data) +static int vm_exec(struct ast_channel *chan, const char *data) { int res = 0; char *tmp; @@ -9787,7 +9786,7 @@ static int append_mailbox(const char *context, const char *box, const char *data return 0; } -static int vm_box_exists(struct ast_channel *chan, void *data) +static int vm_box_exists(struct ast_channel *chan, const char *data) { struct ast_vm_user svm; char *context, *box; @@ -9851,16 +9850,16 @@ static struct ast_custom_function mailbox_exists_acf = { .read = acf_mailbox_exists, }; -static int vmauthenticate(struct ast_channel *chan, void *data) +static int vmauthenticate(struct ast_channel *chan, const char *data) { - char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = ""; + char *s, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = ""; struct ast_vm_user vmus; char *options = NULL; int silent = 0, skipuser = 0; int res = -1; - if (s) { - s = ast_strdupa(s); + if (data) { + s = ast_strdupa(data); user = strsep(&s, ","); options = strsep(&s, ","); if (user) { |