diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-07-29 09:58:08 -0400 |
---|---|---|
committer | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-07-29 14:24:45 -0400 |
commit | 3a071dff27caa2f3cac4bbe96a1f701cead93f45 (patch) | |
tree | d33eaa8a09e026b0b68ca7f6a50a0049a5242d49 | |
parent | d187edb6977b59fd4a6f92c9583522a500700d5e (diff) | |
download | sdl_core-3a071dff27caa2f3cac4bbe96a1f701cead93f45.tar.gz |
Fixed unnecessary mixing of enums (CID 80023, 80024, 80026, 80030)
3 files changed, 14 insertions, 19 deletions
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index 4ce38ef575..c33d2e477a 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -174,17 +174,15 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { if (pending_requests_.IsFinal(event_id)) { - bool result = ((hmi_apis::Common_Result::SUCCESS == - static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_) || - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_) || - (hmi_apis::Common_Result::INVALID_ENUM == - static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_))) && - (hmi_apis::Common_Result::SUCCESS == - static_cast<hmi_apis::Common_Result::eType>(navi_alert_maneuver_result_code_))) || - (hmi_apis::Common_Result::SUCCESS == static_cast<hmi_apis::Common_Result::eType>( - tts_speak_result_code_) && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast<hmi_apis::Common_Result::eType>(navi_alert_maneuver_result_code_)); + bool result = ((mobile_apis::Result::SUCCESS == tts_speak_result_code_ || + mobile_apis::Result::UNSUPPORTED_RESOURCE == + tts_speak_result_code_ || + mobile_apis::Result::INVALID_ENUM == tts_speak_result_code_) && + mobile_apis::Result::SUCCESS == + navi_alert_maneuver_result_code_) || + (mobile_apis::Result::SUCCESS == tts_speak_result_code_ && + mobile_apis::Result::UNSUPPORTED_RESOURCE == + navi_alert_maneuver_result_code_); mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>(std::max(tts_speak_result_code_, @@ -192,8 +190,8 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { const char* return_info = NULL; - if (result && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_)) { + if (result && mobile_apis::Result::UNSUPPORTED_RESOURCE == + tts_speak_result_code_) { result_code = mobile_apis::Result::WARNINGS; return_info = "Unsupported phoneme type sent in a prompt"; } diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index ed75e62c0c..719cae11b7 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -259,8 +259,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { message[strings::params][hmi_response::code].asInt()); bool result = false; if (mobile_apis::Result::SUCCESS == result_code || - (hmi_apis::Common_Result::DATA_NOT_AVAILABLE == - static_cast<hmi_apis::Common_Result::eType>(result_code) + (mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE == result_code && message[strings::msg_params].length() > 1)) { result = true; } diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc index 4845bc1256..894b97ea9b 100644 --- a/src/components/application_manager/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/src/commands/mobile/speak_request.cc @@ -113,8 +113,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); - if (hmi_apis::Common_Result::SUCCESS == - static_cast<hmi_apis::Common_Result::eType>(result_code)) { + if (mobile_apis::Result::SUCCESS == result_code) { result = true; } (*message_)[strings::params][strings::function_id] = @@ -122,8 +121,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( const char* return_info = NULL; - if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == - static_cast<hmi_apis::Common_Result::eType>(result_code)) { + if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) { result_code = mobile_apis::Result::WARNINGS; return_info = "Unsupported phoneme type sent in a prompt"; } |