提交 aa4e109a authored 作者: Anthony Minessale's avatar Anthony Minessale

change func to const

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6523 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 6ef6cbaf
...@@ -455,7 +455,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw ...@@ -455,7 +455,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
\return the original string if no expansion takes place otherwise a new string that must be freed \return the original string if no expansion takes place otherwise a new string that must be freed
\note it's necessary to test if the return val is the same as the input and free the string if it is not. \note it's necessary to test if the return val is the same as the input and free the string if it is not.
*/ */
SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, char *in); SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, const char *in);
SWITCH_DECLARE(char *) switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix); SWITCH_DECLARE(char *) switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix);
/** @} */ /** @} */
......
...@@ -1264,12 +1264,12 @@ if ((dp = realloc(data, olen))) {\ ...@@ -1264,12 +1264,12 @@ if ((dp = realloc(data, olen))) {\
memset(c, 0, olen - cpos);\ memset(c, 0, olen - cpos);\
}} \ }} \
SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, char *in) SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, const char *in)
{ {
char *q, *p, *c = NULL; char *p, *c = NULL;
char *data, *indup; char *data, *indup;
size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128; size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128;
const char *sub_val = NULL; const char *q, *sub_val = NULL;
char *cloned_sub_val = NULL; char *cloned_sub_val = NULL;
char *func_val = NULL; char *func_val = NULL;
int nv = 0; int nv = 0;
...@@ -1295,7 +1295,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel ...@@ -1295,7 +1295,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
} }
if (!nv) { if (!nv) {
return in; return (char *)in;
} }
nv = 0; nv = 0;
...@@ -1468,7 +1468,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel ...@@ -1468,7 +1468,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
free(data); free(data);
free(indup); free(indup);
return in; return (char *)in;
} }
} }
if ((nlen = sub_val ? strlen(sub_val) : 0)) { if ((nlen = sub_val ? strlen(sub_val) : 0)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论