From 3416f3d985a0c344698e63c55095792087e0a9fd Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Sat, 23 Oct 2021 20:30:09 +0900 Subject: [PATCH 1/5] Fix static analysis issue (coverity) * Improper use of negative value Signed-off-by: MuHong Byun --- shell/platform/tizen/channels/text_input_channel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/tizen/channels/text_input_channel.cc b/shell/platform/tizen/channels/text_input_channel.cc index 1510d87193d61..7eb5740bd83b6 100644 --- a/shell/platform/tizen/channels/text_input_channel.cc +++ b/shell/platform/tizen/channels/text_input_channel.cc @@ -247,7 +247,7 @@ void TextInputChannel::HandleMethodCall( ? composing_extent->value.GetInt() : -1; - if (composing_base_value == -1 && composing_extent_value == -1) { + if (composing_base_value < 0 || composing_extent_value < 0) { active_model_->EndComposing(); } else { size_t composing_start = From 09f011b9f2f63e90594f6364669fc0837c1dd9bc Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Sat, 23 Oct 2021 20:49:24 +0900 Subject: [PATCH 2/5] Fix static analysis issue (coverity) * Uninitialized scalar field Signed-off-by: MuHong Byun --- shell/platform/tizen/flutter_tizen_engine.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/platform/tizen/flutter_tizen_engine.cc b/shell/platform/tizen/flutter_tizen_engine.cc index c3ca4b80c2c84..5b899846628a3 100644 --- a/shell/platform/tizen/flutter_tizen_engine.cc +++ b/shell/platform/tizen/flutter_tizen_engine.cc @@ -77,6 +77,8 @@ FlutterTizenEngine::FlutterTizenEngine(const FlutterProjectBundle& project) plugin_registrar_ = std::make_unique(); plugin_registrar_->engine = this; + + transformation_ = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}; } FlutterTizenEngine::~FlutterTizenEngine() { From eb8d3320337d99615402c0d1ac3576fec746f4ba Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Sat, 23 Oct 2021 21:03:21 +0900 Subject: [PATCH 3/5] Fix static analysis issue (coverity) * Logically dead code Signed-off-by: MuHong Byun --- shell/platform/tizen/tizen_input_method_context.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shell/platform/tizen/tizen_input_method_context.cc b/shell/platform/tizen/tizen_input_method_context.cc index 0b928989d0d9a..c3ba58fce5354 100644 --- a/shell/platform/tizen/tizen_input_method_context.cc +++ b/shell/platform/tizen/tizen_input_method_context.cc @@ -13,13 +13,10 @@ const char* GetEcoreImfContextAvailableID() { Eina_List* modules; modules = ecore_imf_context_available_ids_get(); - if (!modules) { - return nullptr; + if (modules) { + void* module; + EINA_LIST_FREE(modules, module) { return static_cast(module); } } - - void* module; - EINA_LIST_FREE(modules, module) { return static_cast(module); } - return nullptr; } From 883dcac0607e7958e74380db33c53c0f9dc890e1 Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Sat, 23 Oct 2021 21:24:08 +0900 Subject: [PATCH 4/5] Fix static analysis issue (coverity) * Uninitialized pointer field Signed-off-by: MuHong Byun --- shell/platform/tizen/flutter_tizen_engine_unittest.cc | 2 +- .../platform/tizen/flutter_tizen_texture_registrar_unittests.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/tizen/flutter_tizen_engine_unittest.cc b/shell/platform/tizen/flutter_tizen_engine_unittest.cc index 6dabbbb07db9a..57f61e3f50440 100644 --- a/shell/platform/tizen/flutter_tizen_engine_unittest.cc +++ b/shell/platform/tizen/flutter_tizen_engine_unittest.cc @@ -37,7 +37,7 @@ class FlutterTizenEngineTest : public ::testing::Test { engine_ = nullptr; } - FlutterTizenEngine* engine_; + FlutterTizenEngine* engine_ = nullptr; }; class FlutterTizenEngineTestHeaded : public FlutterTizenEngineTest { diff --git a/shell/platform/tizen/flutter_tizen_texture_registrar_unittests.cc b/shell/platform/tizen/flutter_tizen_texture_registrar_unittests.cc index 38d0a88793eda..361919cd028ce 100644 --- a/shell/platform/tizen/flutter_tizen_texture_registrar_unittests.cc +++ b/shell/platform/tizen/flutter_tizen_texture_registrar_unittests.cc @@ -40,7 +40,7 @@ class FlutterTizenTextureRegistrarTest : public ::testing::Test { engine_ = nullptr; } - FlutterTizenEngine* engine_; + FlutterTizenEngine* engine_ = nullptr; }; TEST_F(FlutterTizenTextureRegistrarTest, CreateDestroy) { From a47447188d3ed60e253d4554224bc0b33bdef10f Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Tue, 26 Oct 2021 14:44:08 +0900 Subject: [PATCH 5/5] Apply review's comment Signed-off-by: MuHong Byun --- shell/platform/tizen/channels/text_input_channel.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/platform/tizen/channels/text_input_channel.cc b/shell/platform/tizen/channels/text_input_channel.cc index 7eb5740bd83b6..05e7b73e3d452 100644 --- a/shell/platform/tizen/channels/text_input_channel.cc +++ b/shell/platform/tizen/channels/text_input_channel.cc @@ -247,7 +247,7 @@ void TextInputChannel::HandleMethodCall( ? composing_extent->value.GetInt() : -1; - if (composing_base_value < 0 || composing_extent_value < 0) { + if (composing_base_value == -1 && composing_extent_value == -1) { active_model_->EndComposing(); } else { size_t composing_start = @@ -255,7 +255,8 @@ void TextInputChannel::HandleMethodCall( size_t cursor_offset = selection_base_value - composing_start; active_model_->SetComposingRange( - flutter::TextRange(composing_base_value, composing_extent_value), + flutter::TextRange(static_cast(composing_base_value), + static_cast(composing_extent_value)), cursor_offset); } SendStateUpdate(*active_model_);