MSVC: Fix build warnings
parent
f752924a36
commit
9ba7320fd3
|
|
@ -45,12 +45,12 @@ bool FlexRay::Controller::configure(std::chrono::milliseconds timeout) {
|
||||||
};
|
};
|
||||||
|
|
||||||
auto statusPair = getCurrentPOCStatus(timeout);
|
auto statusPair = getCurrentPOCStatus(timeout);
|
||||||
const auto& status = statusPair.second;
|
const auto& pocStatus = statusPair.second;
|
||||||
if(!statusPair.first)
|
if(!statusPair.first)
|
||||||
return false;
|
return false;
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
||||||
if(status != POCStatus::Config) {
|
if(pocStatus != POCStatus::Config) {
|
||||||
if(!enterConfig(timeout))
|
if(!enterConfig(timeout))
|
||||||
return false;
|
return false;
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
@ -279,12 +279,12 @@ bool FlexRay::Controller::configure(std::chrono::milliseconds timeout) {
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t dataPointer = (totalBuffers + 1) * 4;
|
uint16_t dataPointer = static_cast<uint16_t>((totalBuffers + 1) * 4);
|
||||||
for(auto i = 0; i < totalBuffers; i++) {
|
for(uint16_t i = 0; i < totalBuffers; i++) {
|
||||||
MessageBuffer& buf = *(i < (int)staticTx.size() ? staticTx[i] : dynamicTx[i - staticTx.size()]);
|
MessageBuffer& buf = *(i < (int)staticTx.size() ? staticTx[i] : dynamicTx[i - staticTx.size()]);
|
||||||
|
|
||||||
if(buf.frameID == 0)
|
if(buf.frameID == 0)
|
||||||
buf.frameID = i | (1 << 10);
|
buf.frameID = static_cast<uint16_t>(i | (1 << 10));
|
||||||
|
|
||||||
uint32_t hs1 = (
|
uint32_t hs1 = (
|
||||||
(buf.frameID) |
|
(buf.frameID) |
|
||||||
|
|
@ -354,19 +354,19 @@ bool FlexRay::Controller::getReady(std::chrono::milliseconds timeout) {
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
||||||
auto statusPair = getCurrentPOCStatus(timeout);
|
auto statusPair = getCurrentPOCStatus(timeout);
|
||||||
const auto& status = statusPair.second;
|
const auto& pocStatus = statusPair.second;
|
||||||
if(!statusPair.first)
|
if(!statusPair.first)
|
||||||
return false;
|
return false;
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
||||||
if(status == POCStatus::Ready && !configDirty) {
|
if(pocStatus == POCStatus::Ready && !configDirty) {
|
||||||
// Already in the desired state
|
// Already in the desired state
|
||||||
if(allowColdstart && !setCurrentPOCCommand(FlexRay::POCCommand::AllowColdstart, true, timeout))
|
if(allowColdstart && !setCurrentPOCCommand(FlexRay::POCCommand::AllowColdstart, true, timeout))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status != POCStatus::Config) {
|
if(pocStatus != POCStatus::Config) {
|
||||||
// Must enter config before continuing
|
// Must enter config before continuing
|
||||||
if(!enterConfig(timeout))
|
if(!enterConfig(timeout))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -523,15 +523,15 @@ bool FlexRay::Controller::enterConfig(std::chrono::milliseconds timeout) {
|
||||||
};
|
};
|
||||||
|
|
||||||
auto statusPair = getCurrentPOCStatus(timeout);
|
auto statusPair = getCurrentPOCStatus(timeout);
|
||||||
const auto& status = statusPair.second;
|
const auto& pocStatus = statusPair.second;
|
||||||
if(!statusPair.first)
|
if(!statusPair.first)
|
||||||
return false;
|
return false;
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
||||||
if(status != FlexRay::POCStatus::Ready &&
|
if(pocStatus != FlexRay::POCStatus::Ready &&
|
||||||
status != FlexRay::POCStatus::Config &&
|
pocStatus != FlexRay::POCStatus::Config &&
|
||||||
status != FlexRay::POCStatus::DefaultConfig &&
|
pocStatus != FlexRay::POCStatus::DefaultConfig &&
|
||||||
status != FlexRay::POCStatus::Halt) {
|
pocStatus != FlexRay::POCStatus::Halt) {
|
||||||
if(!setCurrentPOCCommand(FlexRay::POCCommand::Freeze, true, timeout))
|
if(!setCurrentPOCCommand(FlexRay::POCCommand::Freeze, true, timeout))
|
||||||
return false;
|
return false;
|
||||||
updateTimeout();
|
updateTimeout();
|
||||||
|
|
|
||||||
|
|
@ -570,7 +570,7 @@ bool IDeviceSettings::canTerminationBeEnabledFor(Network net) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference the mutable termination enables as we want to allow a disable/enable within a group without applying
|
// Reference the mutable termination enables as we want to allow a disable/enable within a group without applying
|
||||||
const uint64_t* currentQueuedTerminationEnables = const_cast<IDeviceSettings*>(this)->getMutableTerminationEnables();
|
ICSNEO_UNALIGNED(const uint64_t*) currentQueuedTerminationEnables = const_cast<IDeviceSettings*>(this)->getMutableTerminationEnables();
|
||||||
if(currentQueuedTerminationEnables == nullptr) {
|
if(currentQueuedTerminationEnables == nullptr) {
|
||||||
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -621,7 +621,7 @@ optional<bool> IDeviceSettings::isTerminationEnabledFor(Network net) const {
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t* terminationEnables = getTerminationEnables();
|
ICSNEO_UNALIGNED(const uint64_t*) terminationEnables = getTerminationEnables();
|
||||||
if(terminationEnables == nullptr) {
|
if(terminationEnables == nullptr) {
|
||||||
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
||||||
return nullopt;
|
return nullopt;
|
||||||
|
|
@ -652,7 +652,7 @@ bool IDeviceSettings::setTerminationFor(Network net, bool enabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t* terminationEnables = getMutableTerminationEnables();
|
ICSNEO_UNALIGNED(uint64_t*) terminationEnables = getMutableTerminationEnables();
|
||||||
if(terminationEnables == nullptr) {
|
if(terminationEnables == nullptr) {
|
||||||
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
report(APIEvent::Type::TerminationNotSupportedDevice, APIEvent::Severity::Error);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue