From 1e5e3216d8325faa7677d2324b83ebe682ec8787 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 6 Jan 2022 20:54:33 +0300 Subject: [PATCH] [mod_conference] Fix dead nested assignments --- src/mod/applications/mod_conference/conference_api.c | 3 +-- src/mod/applications/mod_conference/conference_event.c | 4 ++-- src/mod/applications/mod_conference/conference_member.c | 2 +- src/mod/applications/mod_conference/mod_conference.c | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index bd24484928..8bcfc5862f 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -2020,7 +2020,6 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit } if (!strncasecmp(argv[2], "group", 5)) { - layout_group_t *lg = NULL; int xx = 4; if ((group_name = strchr(argv[2], ':'))) { @@ -2034,7 +2033,7 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit stream->write_function(stream, "-ERR Group name not specified.\n"); return SWITCH_STATUS_SUCCESS; } else { - if (((lg = switch_core_hash_find(conference->layout_group_hash, group_name)))) { + if (switch_core_hash_find(conference->layout_group_hash, group_name)) { if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { stream->write_function(stream, "-ERR Change personal canvas to layout group [%s]\n", group_name); conference->video_layout_group = switch_core_strdup(conference->pool, group_name); diff --git a/src/mod/applications/mod_conference/conference_event.c b/src/mod/applications/mod_conference/conference_event.c index 23adb127a8..a88a5feab9 100644 --- a/src/mod/applications/mod_conference/conference_event.c +++ b/src/mod/applications/mod_conference/conference_event.c @@ -305,7 +305,7 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json } else if (!strcasecmp(action, "shift-click-layer")) { } else if (!strcasecmp(action, "reset-layer") || !strcasecmp(action, "layer-pan-x") || !strcasecmp(action, "layer-pan-y")) { cJSON *v; - int layer_id = 0, canvas_id = 0, metric = 0, absolute = 0; + int layer_id = 0, canvas_id = 0, metric = 0; const char *i = "i", *xy = ""; if ((v = cJSON_GetObjectItem(data, "layerID"))) { @@ -321,7 +321,7 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json } if ((v = cJSON_GetObjectItem(data, "absolute"))) { - if ((absolute = v->valueint)) { + if (v->valueint) { i = ""; } } diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 6df96fca97..6112a2890c 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -592,7 +592,7 @@ void conference_member_add_file_data(conference_member_t *member, int16_t *data, if (switch_core_speech_read_tts(member->fnode->sh, file_frame, &speech_len, &flags) == SWITCH_STATUS_SUCCESS) { file_sample_len = file_data_len / 2 / member->conference->channels; } else { - file_sample_len = file_data_len = 0; + file_sample_len = 0; } } else if (member->fnode->type == NODE_TYPE_FILE) { switch_core_file_read(&member->fnode->fh, file_frame, &file_sample_len); diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index d6cdab6ef7..619cd8c4a6 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -490,7 +490,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob } else { - file_sample_len = file_data_len = 0; + file_sample_len = 0; } } else if (conference->fnode->type == NODE_TYPE_FILE) { switch_core_file_read(&conference->fnode->fh, file_frame, &file_sample_len); @@ -1891,7 +1891,6 @@ switch_status_t conference_text_thread_callback(switch_core_session_t *session, /* Application interface function that is called from the dialplan to join the channel to a conference */ SWITCH_STANDARD_APP(conference_function) { - switch_codec_t *read_codec = NULL; //uint32_t flags = 0; conference_member_t member = { 0 }; conference_obj_t *conference = NULL; @@ -1931,7 +1930,7 @@ SWITCH_STANDARD_APP(conference_function) } /* Save the original read codec. */ - if (!(read_codec = switch_core_session_get_read_codec(session))) { + if (!switch_core_session_get_read_codec(session)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Channel has no media!\n"); goto end; }