diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-18 22:17:31 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-18 22:17:31 +0000 |
commit | c6643537f1a978097034de7ce33dcd40530da1c8 (patch) | |
tree | 84b53711ba03f3f8d0b61dcace4eca78f6ef8127 /pbx | |
parent | 20dede9dcf4608236c70acd8d3ce544123d3ce9a (diff) |
constify arguments in more places where strings should not be modified (issue #6286)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8203 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_config.c | 17 | ||||
-rw-r--r-- | pbx/pbx_dundi.c | 4 |
2 files changed, 12 insertions, 9 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 7991c96db..51947169b 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -143,7 +143,7 @@ static int handle_context_dont_include(int fd, int argc, char *argv[]) return RESULT_FAILURE; } -static char *complete_context_dont_include(char *line, char *word, +static char *complete_context_dont_include(const char *line, const char *word, int pos, int state) { int which = 0; @@ -449,7 +449,7 @@ static int handle_context_remove_extension(int fd, int argc, char *argv[]) * It's ugly, I know, but I'm waiting for Mark suggestion if upper is * bug or feature ... */ -static int fix_complete_args(char *line, char **word, int *pos) +static int fix_complete_args(const char *line, char **word, int *pos) { char *_line, *_strsep_line, *_previous_word = NULL, *_word = NULL; int words = 0; @@ -481,13 +481,14 @@ static int fix_complete_args(char *line, char **word, int *pos) } #endif /* BROKEN_READLINE */ -static char *complete_context_remove_extension(char *line, char *word, int pos, +static char *complete_context_remove_extension(const char *line, const char *word2, int pos, int state) { char *ret = NULL; int which = 0; #ifdef BROKEN_READLINE + char *word = (char *)word2; /* fool the compiler. XXX will go away later */ /* * Fix arguments, *word is a new allocated structure, REMEMBER to * free *word when you want to return from this function ... @@ -496,6 +497,8 @@ static char *complete_context_remove_extension(char *line, char *word, int pos, ast_log(LOG_ERROR, "Out of free memory\n"); return NULL; } +#else + const char *word = word2; #endif /* @@ -745,7 +748,7 @@ static int handle_context_add_include(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_add_include(char *line, char *word, int pos, +static char *complete_context_add_include(const char *line, const char *word, int pos, int state) { struct ast_context *c; @@ -1243,7 +1246,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[]) } /*! add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */ -static char *complete_context_add_extension(char *line, char *word, +static char *complete_context_add_extension(const char *line, const char *word, int pos, int state) { int which = 0; @@ -1326,7 +1329,7 @@ static int handle_context_add_ignorepat(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_add_ignorepat(char *line, char *word, +static char *complete_context_add_ignorepat(const char *line, const char *word, int pos, int state) { if (pos == 3) return state == 0 ? strdup("into") : NULL; @@ -1427,7 +1430,7 @@ static int handle_reload_extensions(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } -static char *complete_context_remove_ignorepat(char *line, char *word, +static char *complete_context_remove_ignorepat(const char *line, const char *word, int pos, int state) { struct ast_context *c; diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 554ff2f4e..5c876c501 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -2226,7 +2226,7 @@ static char *model2str(int model) } } -static char *complete_peer_helper(char *line, char *word, int pos, int state, int rpos) +static char *complete_peer_helper(const char *line, const char *word, int pos, int state, int rpos) { int which=0; char *ret; @@ -2251,7 +2251,7 @@ static char *complete_peer_helper(char *line, char *word, int pos, int state, in return ret; } -static char *complete_peer_4(char *line, char *word, int pos, int state) +static char *complete_peer_4(const char *line, const char *word, int pos, int state) { return complete_peer_helper(line, word, pos, state, 3); } |