diff options
author | ypostolov <ypostolov@luxoft.com> | 2020-02-12 15:53:46 +0200 |
---|---|---|
committer | yurii <ypostolov> | 2020-03-26 15:02:49 +0200 |
commit | 86dbcbdcf96ad8b7cf805c4ca90b57b1a347178b (patch) | |
tree | ad656ecbb67c3298576ea043ac7d031454123d18 | |
parent | c27d30e1ab59a24c463435c62ee91323ccb07b12 (diff) | |
download | sdl_core-86dbcbdcf96ad8b7cf805c4ca90b57b1a347178b.tar.gz |
fixed issue variableScope
3 files changed, 6 insertions, 10 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index 6bbcbd8d39..89b65ab2b4 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -246,9 +246,9 @@ void RCCommandRequest::ProcessAccessResponse( result_code, mobile_apis::Result::SUCCESS, mobile_apis::Result::WARNINGS); - // cppcheck-suppress variableScope - bool is_allowed = false; + if (result) { + bool is_allowed = false; if (message[app_mngr::strings::msg_params].keyExists( message_params::kAllowed)) { is_allowed = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 80c6eb557c..b03f30f135 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -1042,15 +1042,12 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( const smart_objects::SmartObject& choice_set_id_list) const { LOG4CXX_AUTO_TRACE(logger_); - // cppcheck-suppress variableScope - size_t choice_list_length = 0; std::set<uint32_t> choice_id_set; - // cppcheck-suppress variableScope - smart_objects::SmartObject* choice_set = 0; std::pair<std::set<uint32_t>::iterator, bool> ins_res; for (size_t i = 0; i < choice_set_id_list_length; ++i) { - choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt()); + smart_objects::SmartObject* choice_set = + app->FindChoiceSet(choice_set_id_list[i].asInt()); if (!choice_set) { LOG4CXX_ERROR( logger_, @@ -1058,7 +1055,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( return false; } - choice_list_length = (*choice_set)[strings::choice_set].length(); + size_t choice_list_length = (*choice_set)[strings::choice_set].length(); const smart_objects::SmartObject& choices_list = (*choice_set)[strings::choice_set]; for (size_t k = 0; k < choice_list_length; ++k) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc index b6916b8aa3..b5baab5f6e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc @@ -164,8 +164,6 @@ void PutFileRequest::Run() { is_persistent_file_ = false; bool is_system_file = false; length_ = binary_data.size(); - // cppcheck-suppress variableScope - bool is_download_complete = true; bool offset_exist = (*message_)[strings::msg_params].keyExists(strings::offset); @@ -254,6 +252,7 @@ void PutFileRequest::Run() { case mobile_apis::Result::SUCCESS: { LOG4CXX_INFO(logger_, "PutFile is successful"); if (!is_system_file) { + bool is_download_complete = true; AppFile file(sync_file_name_, is_persistent_file_, is_download_complete, |