Fixed Clang tidy errors

This commit is contained in:
Eric Katzfey 2023-07-07 11:01:44 -07:00
parent 8b43a8a5f6
commit 83f3bc4dff
3 changed files with 12 additions and 60 deletions

View File

@ -319,11 +319,7 @@ ByteSize SerialImpl::getBytesize() const
bool SerialImpl::setBytesize(ByteSize bytesize) bool SerialImpl::setBytesize(ByteSize bytesize)
{ {
if (bytesize != ByteSize::EightBits) { return bytesize == ByteSize::EightBits;
return false;
}
return true;
} }
Parity SerialImpl::getParity() const Parity SerialImpl::getParity() const
@ -333,11 +329,7 @@ Parity SerialImpl::getParity() const
bool SerialImpl::setParity(Parity parity) bool SerialImpl::setParity(Parity parity)
{ {
if (parity != Parity::None) { return parity == Parity::None;
return false;
}
return true;
} }
StopBits SerialImpl::getStopbits() const StopBits SerialImpl::getStopbits() const
@ -347,11 +339,7 @@ StopBits SerialImpl::getStopbits() const
bool SerialImpl::setStopbits(StopBits stopbits) bool SerialImpl::setStopbits(StopBits stopbits)
{ {
if (stopbits != StopBits::One) { return stopbits == StopBits::One;
return false;
}
return true;
} }
FlowControl SerialImpl::getFlowcontrol() const FlowControl SerialImpl::getFlowcontrol() const
@ -361,11 +349,7 @@ FlowControl SerialImpl::getFlowcontrol() const
bool SerialImpl::setFlowcontrol(FlowControl flowcontrol) bool SerialImpl::setFlowcontrol(FlowControl flowcontrol)
{ {
if (flowcontrol != FlowControl::Disabled) { return flowcontrol == FlowControl::Disabled;
return false;
}
return true;
} }
} // namespace device } // namespace device

View File

@ -317,11 +317,7 @@ ByteSize SerialImpl::getBytesize() const
bool SerialImpl::setBytesize(ByteSize bytesize) bool SerialImpl::setBytesize(ByteSize bytesize)
{ {
if (bytesize != ByteSize::EightBits) { return bytesize == ByteSize::EightBits;
return false;
}
return true;
} }
Parity SerialImpl::getParity() const Parity SerialImpl::getParity() const
@ -331,11 +327,7 @@ Parity SerialImpl::getParity() const
bool SerialImpl::setParity(Parity parity) bool SerialImpl::setParity(Parity parity)
{ {
if (parity != Parity::None) { return parity == Parity::None;
return false;
}
return true;
} }
StopBits SerialImpl::getStopbits() const StopBits SerialImpl::getStopbits() const
@ -345,11 +337,7 @@ StopBits SerialImpl::getStopbits() const
bool SerialImpl::setStopbits(StopBits stopbits) bool SerialImpl::setStopbits(StopBits stopbits)
{ {
if (stopbits != StopBits::One) { return stopbits == StopBits::One;
return false;
}
return true;
} }
FlowControl SerialImpl::getFlowcontrol() const FlowControl SerialImpl::getFlowcontrol() const
@ -359,11 +347,7 @@ FlowControl SerialImpl::getFlowcontrol() const
bool SerialImpl::setFlowcontrol(FlowControl flowcontrol) bool SerialImpl::setFlowcontrol(FlowControl flowcontrol)
{ {
if (flowcontrol != FlowControl::Disabled) { return flowcontrol == FlowControl::Disabled;
return false;
}
return true;
} }
} // namespace device } // namespace device

View File

@ -245,11 +245,7 @@ ByteSize SerialImpl::getBytesize() const
bool SerialImpl::setBytesize(ByteSize bytesize) bool SerialImpl::setBytesize(ByteSize bytesize)
{ {
if (bytesize != ByteSize::EightBits) { return bytesize == ByteSize::EightBits;
return false;
}
return true;
} }
Parity SerialImpl::getParity() const Parity SerialImpl::getParity() const
@ -259,11 +255,7 @@ Parity SerialImpl::getParity() const
bool SerialImpl::setParity(Parity parity) bool SerialImpl::setParity(Parity parity)
{ {
if (parity != Parity::None) { return parity == Parity::None;
return false;
}
return true;
} }
StopBits SerialImpl::getStopbits() const StopBits SerialImpl::getStopbits() const
@ -273,11 +265,7 @@ StopBits SerialImpl::getStopbits() const
bool SerialImpl::setStopbits(StopBits stopbits) bool SerialImpl::setStopbits(StopBits stopbits)
{ {
if (stopbits != StopBits::One) { return stopbits == StopBits::One;
return false;
}
return true;
} }
FlowControl SerialImpl::getFlowcontrol() const FlowControl SerialImpl::getFlowcontrol() const
@ -287,11 +275,7 @@ FlowControl SerialImpl::getFlowcontrol() const
bool SerialImpl::setFlowcontrol(FlowControl flowcontrol) bool SerialImpl::setFlowcontrol(FlowControl flowcontrol)
{ {
if (flowcontrol != FlowControl::Disabled) { return flowcontrol == FlowControl::Disabled;
return false;
}
return true;
} }
} // namespace device } // namespace device