[FSD] Use qFuzzyCompare for double comparison

fixes "warning: comparing floating point with == or != is unsafe"
This commit is contained in:
Klaus Basan
2020-03-12 19:52:05 +01:00
committed by Mat Sutcliffe
parent 84ae160b14
commit 5decc7d917
3 changed files with 16 additions and 16 deletions

View File

@@ -63,14 +63,14 @@ namespace BlackCore
lhs.m_transponderMode == rhs.m_transponderMode &&
lhs.m_transponderCode == rhs.m_transponderCode &&
lhs.m_rating == rhs.m_rating &&
lhs.m_latitude == rhs.m_latitude &&
lhs.m_longitude == rhs.m_longitude &&
qFuzzyCompare(lhs.m_latitude, rhs.m_latitude) &&
qFuzzyCompare(lhs.m_longitude, rhs.m_longitude) &&
lhs.m_altitudeTrue == rhs.m_altitudeTrue &&
lhs.m_altitudePressure == rhs.m_altitudePressure &&
lhs.m_groundSpeed == rhs.m_groundSpeed &&
lhs.m_pitch == rhs.m_pitch &&
lhs.m_bank == rhs.m_bank &&
lhs.m_heading == rhs.m_heading &&
lhs.m_groundSpeed == rhs.m_groundSpeed &&
qFuzzyCompare(lhs.m_pitch, rhs.m_pitch) &&
qFuzzyCompare(lhs.m_bank, rhs.m_bank) &&
qFuzzyCompare(lhs.m_heading, rhs.m_heading) &&
lhs.m_onGround == rhs.m_onGround;
}