Merge "[hardware][interfaces][automotive] fix -Wreorder-init-list"

This commit is contained in:
Treehugger Robot
2019-10-21 18:13:46 +00:00
committed by Gerrit Code Review
4 changed files with 717 additions and 676 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -249,8 +249,8 @@ void EmulatedVehicleHal::onCreate() {
// Create a separate instance for each individual zone
VehiclePropValue prop = {
.prop = cfg.prop,
.areaId = curArea,
.areaId = curArea,
.prop = cfg.prop,
};
if (it.initialAreaValues.size() > 0) {

View File

@@ -101,9 +101,11 @@ std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::is
rawEvent.toStyledString().c_str());
continue;
}
VehiclePropValue event = {.prop = rawEvent["prop"].asInt(),
.areaId = rawEvent["areaId"].asInt(),
.timestamp = rawEvent["timestamp"].asInt64()};
VehiclePropValue event = {
.timestamp = rawEvent["timestamp"].asInt64(),
.areaId = rawEvent["areaId"].asInt(),
.prop = rawEvent["prop"].asInt(),
};
Json::Value rawEventValue = rawEvent["value"];
auto& value = event.value;

View File

@@ -120,7 +120,10 @@ void VehicleEmulator::doGetProperty(VehicleEmulator::EmulatorMessage const& rxMs
}
{
VehiclePropValue request = { .prop = propId, .areaId = areaId };
VehiclePropValue request = {
.areaId = areaId,
.prop = propId,
};
StatusCode halStatus;
auto val = mHal->get(request, &halStatus);
if (val != nullptr) {
@@ -150,10 +153,10 @@ void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage const& rxMs
VehicleEmulator::EmulatorMessage& respMsg) {
emulator::VehiclePropValue protoVal = rxMsg.value(0);
VehiclePropValue val = {
.prop = protoVal.prop(),
.areaId = protoVal.area_id(),
.status = (VehiclePropertyStatus)protoVal.status(),
.timestamp = elapsedRealtimeNano(),
.timestamp = elapsedRealtimeNano(),
.areaId = protoVal.area_id(),
.prop = protoVal.prop(),
.status = (VehiclePropertyStatus)protoVal.status(),
};
respMsg.set_msg_type(emulator::SET_PROPERTY_RESP);