From 7bbec6611cb0830ee3274a3985d580efcd05a11c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 28 Feb 2020 03:13:06 +0400 Subject: [PATCH] [mod_v8] Fix scan-build warnings. --- src/mod/languages/mod_v8/mod_v8.cpp | 3 +-- src/mod/languages/mod_v8/src/fscoredb.cpp | 6 ------ src/mod/languages/mod_v8/src/jsmain.cpp | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index 49763e05c0..6c2133c0c4 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -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); diff --git a/src/mod/languages/mod_v8/src/fscoredb.cpp b/src/mod/languages/mod_v8/src/fscoredb.cpp index 5af1bd5be8..321677b642 100644 --- a/src/mod/languages/mod_v8/src/fscoredb.cpp +++ b/src/mod/languages/mod_v8/src/fscoredb.cpp @@ -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) { diff --git a/src/mod/languages/mod_v8/src/jsmain.cpp b/src/mod/languages/mod_v8/src/jsmain.cpp index d473d9f085..2a02c8737e 100644 --- a/src/mod/languages/mod_v8/src/jsmain.cpp +++ b/src/mod/languages/mod_v8/src/jsmain.cpp @@ -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();