summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtrunov <dtrunov@luxoft.com>2016-10-10 15:18:45 +0300
committerdtrunov <dtrunov@luxoft.com>2016-10-10 15:23:54 +0300
commit4b7b27b6c42bfad7e8bd7b219ba3edc218a8bc0d (patch)
tree0433628fcb1a4e97d51ca987af2b48823645bb5b
parentedf1075c968e2d0f8a6509dfb3f05d12de48b361 (diff)
downloadsdl_core-4b7b27b6c42bfad7e8bd7b219ba3edc218a8bc0d.tar.gz
Fix comments after review
Change type of some variables, change comparison, fix code style. Closes bug [APPLINK-28726](https://adc.luxoft.com/jira/browse/APPLINK-28726)
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc19
2 files changed, 11 insertions, 10 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
index c29449885b..fb21823b3a 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
@@ -130,7 +130,7 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
mobile_apis::Result::eType& out_result_code,
smart_objects::SmartObject& out_response_params,
smart_objects::SmartObject& out_request_params,
- bool& result);
+ bool& out_result);
/**
* @brief VI parameters which had been already subscribed by another apps
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
index 4079981c71..764eca8f27 100644
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -341,11 +341,11 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
mobile_apis::Result::eType& out_result_code,
smart_objects::SmartObject& out_response_params,
smart_objects::SmartObject& out_request_params,
- bool& result) {
+ bool& out_result) {
// counter for items to subscribe
- int32_t items_to_subscribe = 0;
+ VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
// counter for subscribed items by application
- int32_t subscribed_items = 0;
+ uint32_t subscribed_items = 0;
const VehicleData& vehicle_data = MessageHelper::vehicle_data();
VehicleData::const_iterator it = vehicle_data.begin();
@@ -360,7 +360,8 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
for (; vehicle_data.end() != it; ++it) {
const std::string& key_name = it->first;
if ((*message_)[strings::msg_params].keyExists(key_name)) {
- bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
+ const bool is_key_enabled =
+ (*message_)[strings::msg_params][key_name].asBool();
if (is_key_enabled) {
++items_to_subscribe;
}
@@ -419,7 +420,7 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
}
const bool is_everything_already_subscribed =
- static_cast<uint32_t>(items_to_subscribe) ==
+ items_to_subscribe ==
vi_already_subscribed_by_another_apps_.size() +
vi_already_subscribed_by_this_app_.size();
@@ -430,23 +431,23 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
out_result_code = mobile_apis::Result::INVALID_DATA;
out_info = "No data in the request";
}
- result = false;
+ out_result = false;
}
if (0 == subscribed_items && !is_interface_not_available) {
out_result_code = mobile_apis::Result::IGNORED;
out_info = "Already subscribed on provided VehicleData.";
- result = false;
+ out_result = false;
}
if (is_everything_already_subscribed) {
out_result_code = vi_already_subscribed_by_this_app_.size()
? mobile_apis::Result::IGNORED
: mobile_apis::Result::SUCCESS;
- if (vi_already_subscribed_by_this_app_.size()) {
+ if (!(vi_already_subscribed_by_this_app_.empty())) {
out_info = "Already subscribed on some provided VehicleData.";
}
- result = true;
+ out_result = true;
}
}