mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 12:37:05 +00:00
cleanup msvc code analysis tagging and warnings
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13280 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
c1d643900d
commit
4441606b17
11 files changed
+81
-71
No files matched your search
@@ -1672,6 +1672,11 @@ static void conference_loop_fn_exec_app(conference_member_t *member, caller_cont
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!app) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find application.\n");
|
||||
goto done;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute app: %s, %s\n", app, arg);
|
||||
|
||||
channel = switch_core_session_get_channel(member->session);
|
||||
@@ -2541,10 +2546,10 @@ static void conference_send_all_dtmf(conference_member_t *member, conference_obj
|
||||
if (imember->session) {
|
||||
const char *p;
|
||||
for (p = dtmf; p && *p; p++) {
|
||||
switch_dtmf_t dtmf = { *p, SWITCH_DEFAULT_DTMF_DURATION};
|
||||
switch_dtmf_t digit = { *p, SWITCH_DEFAULT_DTMF_DURATION};
|
||||
switch_mutex_lock(imember->control_mutex);
|
||||
switch_core_session_kill_channel(imember->session, SWITCH_SIG_BREAK);
|
||||
switch_core_session_send_dtmf(imember->session, &dtmf);
|
||||
switch_core_session_send_dtmf(imember->session, &digit);
|
||||
switch_mutex_unlock(imember->control_mutex);
|
||||
}
|
||||
}
|
||||
@@ -4562,7 +4567,7 @@ static void set_mflags(char *flags, member_flag_t *f)
|
||||
|
||||
argc = switch_separate_string(dup, '|', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
|
||||
for(i = 0; i < argc; i++) {
|
||||
for(i = 0; i < argc && argv[i]; i++) {
|
||||
if (!strcasecmp(argv[i], "mute")) {
|
||||
*f &= ~MFLAG_CAN_SPEAK;
|
||||
} else if (!strcasecmp(argv[i], "deaf")) {
|
||||
|
||||
@@ -2352,54 +2352,54 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
|
||||
if ((x_params = switch_xml_child(x_domain, "params"))) {
|
||||
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr(x_param, "name");
|
||||
const char *pvar = switch_xml_attr(x_param, "name");
|
||||
const char *val = switch_xml_attr(x_param, "value");
|
||||
|
||||
if (!strcasecmp(var, "dial-string")) {
|
||||
if (!strcasecmp(pvar, "dial-string")) {
|
||||
dest = val;
|
||||
} else if (!strncasecmp(var, "dial-var-", 9)) {
|
||||
if (!var_event) {
|
||||
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
|
||||
} else {
|
||||
switch_event_del_header(var_event, var + 9);
|
||||
switch_event_del_header(var_event, pvar + 9);
|
||||
}
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((x_params = switch_xml_child(x_group, "params"))) {
|
||||
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr(x_param, "name");
|
||||
const char *pvar = switch_xml_attr(x_param, "name");
|
||||
const char *val = switch_xml_attr(x_param, "value");
|
||||
|
||||
if (!strcasecmp(var, "dial-string")) {
|
||||
if (!strcasecmp(pvar, "dial-string")) {
|
||||
dest = val;
|
||||
} else if (!strncasecmp(var, "dial-var-", 9)) {
|
||||
} else if (!strncasecmp(pvar, "dial-var-", 9)) {
|
||||
if (!var_event) {
|
||||
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
|
||||
} else {
|
||||
switch_event_del_header(var_event, var + 9);
|
||||
switch_event_del_header(var_event, pvar + 9);
|
||||
}
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((x_params = switch_xml_child(x_user, "params"))) {
|
||||
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr(x_param, "name");
|
||||
const char *pvar = switch_xml_attr(x_param, "name");
|
||||
const char *val = switch_xml_attr(x_param, "value");
|
||||
|
||||
if (!strcasecmp(var, "dial-string")) {
|
||||
if (!strcasecmp(pvar, "dial-string")) {
|
||||
dest = val;
|
||||
} else if (!strncasecmp(var, "dial-var-", 9)) {
|
||||
} else if (!strncasecmp(pvar, "dial-var-", 9)) {
|
||||
if (!var_event) {
|
||||
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
|
||||
} else {
|
||||
switch_event_del_header(var_event, var + 9);
|
||||
switch_event_del_header(var_event, pvar + 9);
|
||||
}
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
|
||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2408,7 +2408,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No dial-string available, please check your user directory.\n");
|
||||
cause = SWITCH_CAUSE_MANDATORY_IE_MISSING;
|
||||
} else {
|
||||
const char *var;
|
||||
const char *varval;
|
||||
char *d_dest = NULL;
|
||||
switch_channel_t *channel;
|
||||
switch_originate_flag_t myflags = SOF_NONE;
|
||||
@@ -2422,9 +2422,9 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
|
||||
if (session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))
|
||||
|| (var = switch_event_get_header(var_event, "leg_timeout"))) {
|
||||
timelimit = atoi(var);
|
||||
if ((varval = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))
|
||||
|| (varval = switch_event_get_header(var_event, "leg_timeout"))) {
|
||||
timelimit = atoi(varval);
|
||||
}
|
||||
|
||||
switch_channel_set_variable(channel, "dialed_user", user);
|
||||
@@ -2439,9 +2439,9 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
switch_event_dup(&event, var_event);
|
||||
switch_event_del_header(event, "dialed_user");
|
||||
switch_event_del_header(event, "dialed_domain");
|
||||
if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) ||
|
||||
(var = switch_event_get_header(var_event, "leg_timeout"))) {
|
||||
timelimit = atoi(var);
|
||||
if ((varval = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) ||
|
||||
(varval = switch_event_get_header(var_event, "leg_timeout"))) {
|
||||
timelimit = atoi(varval);
|
||||
}
|
||||
} else {
|
||||
switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
@@ -2485,17 +2485,17 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
if (new_channel && xml) {
|
||||
if ((x_params = switch_xml_child(x_domain, "variables"))) {
|
||||
for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr(x_param, "name");
|
||||
const char *pvar = switch_xml_attr(x_param, "name");
|
||||
const char *val = switch_xml_attr(x_param, "value");
|
||||
switch_channel_set_variable(new_channel, var, val);
|
||||
switch_channel_set_variable(new_channel, pvar, val);
|
||||
}
|
||||
}
|
||||
|
||||
if ((x_params = switch_xml_child(x_user, "variables"))) {
|
||||
for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr(x_param, "name");
|
||||
const char *pvar = switch_xml_attr(x_param, "name");
|
||||
const char *val = switch_xml_attr(x_param, "value");
|
||||
switch_channel_set_variable(new_channel, var, val);
|
||||
switch_channel_set_variable(new_channel, pvar, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2168,8 +2168,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fifo_shutdown)
|
||||
stop_node_thread();
|
||||
}
|
||||
|
||||
top:
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
|
||||
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_first(NULL, globals.fifo_hash)) {
|
||||
int x = 0;
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
node = (fifo_node_t *) val;
|
||||
@@ -2186,8 +2185,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fifo_shutdown)
|
||||
switch_core_hash_destroy(&node->consumer_hash);
|
||||
switch_thread_rwlock_unlock(node->rwlock);
|
||||
switch_core_destroy_memory_pool(&node->pool);
|
||||
goto top;
|
||||
}
|
||||
|
||||
switch_core_hash_destroy(&globals.fifo_hash);
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_mutex_unlock(mutex);
|
||||
|
||||
@@ -2858,15 +2858,15 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
||||
|
||||
if (id) {
|
||||
int ok = 1;
|
||||
switch_event_t *params = NULL;
|
||||
switch_event_t *locate_params = NULL;
|
||||
const char *email_addr = NULL;
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id);
|
||||
switch_event_create(&locate_params, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(locate_params);
|
||||
switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "mailbox", id);
|
||||
|
||||
if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"),
|
||||
&x_domain_root, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) {
|
||||
&x_domain_root, &x_domain, &x_user, NULL, locate_params) == SWITCH_STATUS_SUCCESS) {
|
||||
if ((x_params = switch_xml_child(x_user, "params"))) {
|
||||
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||
const char *var = switch_xml_attr_soft(x_param, "name");
|
||||
@@ -2925,7 +2925,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
||||
ok = 0;
|
||||
}
|
||||
|
||||
switch_event_destroy(¶ms);
|
||||
switch_event_destroy(&locate_params);
|
||||
|
||||
if (!ok) {
|
||||
goto end;
|
||||
@@ -3904,13 +3904,13 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
||||
}
|
||||
|
||||
if (!profile) {
|
||||
switch_hash_index_t *hi;
|
||||
void *val;
|
||||
switch_hash_index_t *index;
|
||||
void *value;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (vm_profile_t *) val;
|
||||
for (index = switch_hash_first(NULL, globals.profile_hash); index; index = switch_hash_next(index)) {
|
||||
switch_hash_this(index, NULL, NULL, &value);
|
||||
profile = (vm_profile_t *) value;
|
||||
if (profile) {
|
||||
switch_thread_rwlock_rdlock(profile->rwlock);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user