提交 6a90d335 authored 作者: Michael Jerris's avatar Michael Jerris

don't hide status in macro, use switch_snprintf to get null terminated string.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6709 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 504f1275
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_de, mod_say_de_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_de, mod_say_de_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = de_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = de_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = en_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = en_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_es, mod_say_es_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_es, mod_say_es_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = es_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = es_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_fr, mod_say_fr_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_fr, mod_say_fr_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = fr_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = fr_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_it, mod_say_it_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_it, mod_say_it_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = it_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = it_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_nl, mod_say_nl_load, NULL, NULL); ...@@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_nl, mod_say_nl_load, NULL, NULL);
#define say_num(num, t) { \ #define say_num(num, t) { \
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = nl_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ if ((tstatus = nl_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\ return tstatus;\
}}\ }}\
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\ switch_status_t tstatus;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\ return tstatus;\
}\ }\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论