]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_v8] Fix scan-build warnings. 458/head
authorAndrey Volk <andywolk@gmail.com>
Thu, 27 Feb 2020 23:13:06 +0000 (03:13 +0400)
committerAndrey Volk <andywolk@gmail.com>
Thu, 27 Feb 2020 23:13:06 +0000 (03:13 +0400)
src/mod/languages/mod_v8/mod_v8.cpp
src/mod/languages/mod_v8/src/fscoredb.cpp
src/mod/languages/mod_v8/src/jsmain.cpp

index 49763e05c03828c961dde60fa4a9fba29ad9abd3..6c2133c0c4a48cd5889101d33decb67dca920d25 100644 (file)
@@ -201,7 +201,6 @@ static switch_status_t v8_mod_load_file(const char *filename)
        function_handle = (switch_loadable_module_function_table_t *)switch_dso_data_sym(dso, "v8_mod_init", &derr);
 
        if (!function_handle || derr) {
-               status = SWITCH_STATUS_FALSE;
                err = derr;
                goto err;
        }
@@ -1458,7 +1457,7 @@ SWITCH_STANDARD_API(process_status_function)
 
        } else if (!strcasecmp(as, "xml")) {
                switch_snprintf(tmp_str, sizeof(tmp_str), "%u", count);
-               switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup("row_count"), strdup(tmp_str));
+               switch_xml_set_attr_d(xml, "row_count", tmp_str);
 
                output_text = switch_xml_toxml(xml, SWITCH_FALSE);
 
index 5af1bd5be88b7e7ff43a4851f858abf8687d09a6..321677b642cab649c91791b4dab0ee7c5adfcd96 100644 (file)
@@ -301,7 +301,6 @@ JS_COREDB_FUNCTION_IMPL(Prepare)
 JS_COREDB_FUNCTION_IMPL(BindText)
 {
        HandleScope handle_scope(info.GetIsolate());
-       bool status;
        int32_t param_index = -1;
        string param_value;
 
@@ -324,7 +323,6 @@ JS_COREDB_FUNCTION_IMPL(BindText)
        }
 
        /* convert args */
-       status = !info[0].IsEmpty() && info[0]->IsInt32() ? true : false;
        param_index = info[0]->Int32Value();
        String::Utf8Value str(info[1]);
        param_value = js_safe_str(*str);
@@ -347,7 +345,6 @@ JS_COREDB_FUNCTION_IMPL(BindText)
 JS_COREDB_FUNCTION_IMPL(BindInt)
 {
        HandleScope handle_scope(info.GetIsolate());
-       bool status;
        int32_t param_index = -1;
        int32_t param_value = -1;
 
@@ -370,10 +367,7 @@ JS_COREDB_FUNCTION_IMPL(BindInt)
        }
 
        /* convert args */
-       status = !info[0].IsEmpty() && info[0]->IsInt32() ? true : false;
        param_index = info[0]->Int32Value();
-
-       status = !info[1].IsEmpty() && info[1]->IsInt32() ? true : false;
        param_value = info[1]->Int32Value();
 
        if (param_index < 1) {
index d473d9f085071963adf2e3edbb99e80a58f18cd6..2a02c8737e1c2ada894217509be3572dc1e5ee1a 100644 (file)
@@ -443,7 +443,7 @@ Isolate *JSMain::GetIsolate()
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
 void JSMain::Initialize(v8::Platform **platform)
 {
-       bool res = V8::InitializeICUDefaultLocation(SWITCH_GLOBAL_dirs.mod_dir);
+       V8::InitializeICUDefaultLocation(SWITCH_GLOBAL_dirs.mod_dir);
        V8::InitializeExternalStartupData(SWITCH_GLOBAL_dirs.mod_dir);
 
        *platform = v8::platform::CreateDefaultPlatform();