[Core] Fix dead nested assignments

This commit is contained in:
Andrey Volk committed 2022-08-09 23:29:31 +03:00
1 parent 1499acac9d
commit 56b6e954cf
21 files changed
+49 -77

No files matched your search

+7 -13
View File
@@ -526,7 +526,6 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
{
switch_io_event_hook_outgoing_channel_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_endpoint_interface_t *endpoint_interface;
switch_channel_t *channel = NULL;
switch_caller_profile_t *outgoing_profile = caller_profile;
@@ -608,7 +607,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
if (session) {
for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) {
if ((status = ptr->outgoing_channel(session, var_event, caller_profile, *new_session, flags)) != SWITCH_STATUS_SUCCESS) {
if (ptr->outgoing_channel(session, var_event, caller_profile, *new_session, flags) != SWITCH_STATUS_SUCCESS) {
break;
}
}
@@ -1116,15 +1115,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_
SWITCH_DECLARE(switch_status_t) switch_core_session_flush_message(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_core_session_message_t *message;
switch_assert(session != NULL);
if (session->message_queue) {
while ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
while (switch_queue_trypop(session->message_queue, &pop) == SWITCH_STATUS_SUCCESS) {
message = (switch_core_session_message_t *) pop;
switch_ivr_process_indications(session, message);
switch_core_session_free_message(&message);
@@ -1353,19 +1350,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch
SWITCH_DECLARE(uint32_t) switch_core_session_flush_private_events(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_FALSE;
int x = 0;
void *pop;
if (session->private_event_queue) {
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue_pri, &pop)) == SWITCH_STATUS_SUCCESS) {
while (switch_queue_trypop(session->private_event_queue_pri, &pop) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
x++;
}
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
while (switch_queue_trypop(session->private_event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
@@ -1398,7 +1394,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_try_reset(switch_core_sessio
SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_size_t has;
if (reset_read_codec) {
switch_core_session_set_read_codec(session, NULL);
@@ -1425,7 +1420,7 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, s
switch_mutex_unlock(session->codec_read_mutex);
if (flush_dtmf) {
while ((has = switch_channel_has_dtmf(channel))) {
while (switch_channel_has_dtmf(channel)) {
switch_channel_flush_dtmf(channel);
}
}
@@ -1496,7 +1491,7 @@ SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session
if (status == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.state_change; ptr; ptr = ptr->next) {
if ((status = ptr->state_change(session)) != SWITCH_STATUS_SUCCESS) {
if (ptr->state_change(session) != SWITCH_STATUS_SUCCESS) {
break;
}
}
@@ -1608,9 +1603,8 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t *
}
if ((*session)->event_queue) {
switch_status_t status;
void *pop;
while ((status = (switch_status_t) switch_queue_trypop((*session)->event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
while (switch_queue_trypop((*session)->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);