]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_v8] Fix dead nested assignments
authorAndrey Volk <andywolk@gmail.com>
Tue, 11 Jan 2022 11:15:44 +0000 (14:15 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 9 Aug 2022 20:35:13 +0000 (23:35 +0300)
src/mod/languages/mod_v8/src/fseventhandler.cpp
src/mod/languages/mod_v8/src/fsodbc.cpp
src/mod/languages/mod_v8/src/fssession.cpp

index e4e256e689ac836012e276465d33e3e7dafdde8e..145984c83fdcec7b87cd817e3826006c77e09998 100644 (file)
@@ -389,10 +389,9 @@ JS_EVENTHANDLER_FUNCTION_IMPL(SendEvent)
                                if (session_uuid.length() > 0) {
                                        /* This is a session event */
                                        switch_core_session_t *session;
-                                       switch_status_t status = SWITCH_STATUS_FALSE;
 
                                        if ((session = switch_core_session_locate(session_uuid.c_str()))) {
-                                               if ((status = switch_core_session_queue_private_event(session, event, SWITCH_FALSE)) == SWITCH_STATUS_SUCCESS) {
+                                               if (switch_core_session_queue_private_event(session, event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
                                                        info.GetReturnValue().Set(true);
                                                } else {
                                                        info.GetReturnValue().Set(false);
index 5b34ebe36e891187efad940b17ef126e9d9fcd68..2b75661c504c805b893fae850907c45c287b5b03 100644 (file)
@@ -273,7 +273,6 @@ JS_ODBC_FUNCTION_IMPL(NumCols)
 JS_ODBC_FUNCTION_IMPL(NextRow)
 {
        HandleScope handle_scope(info.GetIsolate());
-       int result = 0;
        bool tf = false;
 
        if (switch_odbc_handle_get_state(_handle) != SWITCH_ODBC_STATE_CONNECTED) {
@@ -282,7 +281,7 @@ JS_ODBC_FUNCTION_IMPL(NextRow)
        }
 
        if (_stmt) {
-               if ((result = SQLFetch(_stmt) == SQL_SUCCESS)) {
+               if (SQLFetch(_stmt) == SQL_SUCCESS) {
                        tf = true;
                }
        }
index c8a315ced0ac21dbb03081447d06fa8c00575837..d3bc77ae13bba5ad0997718858391e9c496272a2 100644 (file)
@@ -1250,7 +1250,6 @@ JS_SESSION_FUNCTION_IMPL(WaitForMedia)
        HandleScope handle_scope(info.GetIsolate());
        switch_channel_t *channel;
        switch_time_t started;
-       unsigned int elapsed;
        int32_t timeout = 60000;
        bool ret = true;
 
@@ -1273,7 +1272,7 @@ JS_SESSION_FUNCTION_IMPL(WaitForMedia)
        }
 
        for (;;) {
-               if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
+               if (((/* Elapsed */(unsigned int)((switch_micro_time_now() - started) / 1000)) > (switch_time_t)timeout)
                        || switch_channel_down(channel)) {
                        info.GetReturnValue().Set(false);
                        break;
@@ -1297,7 +1296,6 @@ JS_SESSION_FUNCTION_IMPL(WaitForAnswer)
        HandleScope handle_scope(info.GetIsolate());
        switch_channel_t *channel;
        switch_time_t started;
-       unsigned int elapsed;
        int32_t timeout = 60000;
        bool ret = true;
 
@@ -1319,7 +1317,7 @@ JS_SESSION_FUNCTION_IMPL(WaitForAnswer)
        }
 
        for (;;) {
-               if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
+               if (((/* Elapsed */(unsigned int)((switch_micro_time_now() - started) / 1000)) > (switch_time_t)timeout)
                        || switch_channel_down(channel)) {
                        info.GetReturnValue().Set(false);
                        break;