提交 a0b8d922 authored 作者: Travis Cross's avatar Travis Cross

Move variables down into loop where they're used

These variables aren't used outside of this for loop, so they should
be declared within it.
上级 4178688b
...@@ -202,10 +202,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio ...@@ -202,10 +202,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
if (pattern) { if (pattern) {
switch_regex_t *re = NULL; switch_regex_t *re = NULL;
int proceed = 0, ovector[100]; int proceed = 0, ovector[100];
char *substituted = NULL;
uint32_t len = 0;
char *odata = NULL;
char *expanded = NULL;
switch_xml_t match = NULL; switch_xml_t match = NULL;
status = SWITCH_STATUS_SUCCESS; status = SWITCH_STATUS_SUCCESS;
...@@ -221,6 +217,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio ...@@ -221,6 +217,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
for (action = switch_xml_child(match, "action"); action && status == SWITCH_STATUS_SUCCESS; action = action->next) { for (action = switch_xml_child(match, "action"); action && status == SWITCH_STATUS_SUCCESS; action = action->next) {
char *adata = (char *) switch_xml_attr_soft(action, "data"); char *adata = (char *) switch_xml_attr_soft(action, "data");
char *func = (char *) switch_xml_attr_soft(action, "function"); char *func = (char *) switch_xml_attr_soft(action, "function");
char *substituted = NULL;
uint32_t len = 0;
char *odata = NULL;
char *expanded = NULL;
if (strchr(pattern, '(') && strchr(adata, '$') && proceed > 0) { if (strchr(pattern, '(') && strchr(adata, '$') && proceed > 0) {
len = (uint32_t) (strlen(data) + strlen(adata) + 10) * proceed; len = (uint32_t) (strlen(data) + strlen(adata) + 10) * proceed;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论