mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Ref T773, gcc/clang warnings
Remark: "assuming signed overflow does not occur when assuming that (X - c) > X is always false"
This commit is contained in:
committed by
Mat Sutcliffe
parent
4120a2c77d
commit
466c761616
@@ -119,12 +119,21 @@ namespace BlackMisc
|
|||||||
//! Swap this sequence with another.
|
//! Swap this sequence with another.
|
||||||
void swap(CSequence &other) noexcept { m_impl.swap(other.m_impl); }
|
void swap(CSequence &other) noexcept { m_impl.swap(other.m_impl); }
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||||
|
#endif
|
||||||
|
|
||||||
//! Access an element by its index.
|
//! Access an element by its index.
|
||||||
reference operator [](size_type index) { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
reference operator [](size_type index) { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
||||||
|
|
||||||
//! Access an element by its index.
|
//! Access an element by its index.
|
||||||
const_reference operator [](size_type index) const { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
const_reference operator [](size_type index) const { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
//! Access the first element.
|
//! Access the first element.
|
||||||
reference front() { Q_ASSERT(!empty()); return m_impl.front(); }
|
reference front() { Q_ASSERT(!empty()); return m_impl.front(); }
|
||||||
|
|
||||||
|
|||||||
@@ -583,5 +583,20 @@ namespace BlackMisc
|
|||||||
if (interpolator == 'l') { return l; }
|
if (interpolator == 'l') { return l; }
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||||
|
#endif
|
||||||
|
const CAircraftSituation &SituationLog::secondInterpolationSituation() const
|
||||||
|
{
|
||||||
|
if (interpolationSituations.size() < 2) { return Aviation::CAircraftSituation::null(); }
|
||||||
|
const Aviation::CAircraftSituationList::size_type i = interpolationSituations.size() - 2; // 2nd latest, latest at end
|
||||||
|
return interpolationSituations[i];
|
||||||
|
}
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -74,12 +74,7 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! The second latest situation (spline)
|
//! The second latest situation (spline)
|
||||||
const Aviation::CAircraftSituation &secondInterpolationSituation() const
|
const Aviation::CAircraftSituation &secondInterpolationSituation() const;
|
||||||
{
|
|
||||||
if (interpolationSituations.size() < 2) { return Aviation::CAircraftSituation::null(); }
|
|
||||||
const Aviation::CAircraftSituationList::size_type i = interpolationSituations.size() - 2; // 2nd latest, latest at end
|
|
||||||
return interpolationSituations[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
//! To string
|
//! To string
|
||||||
QString toQString(bool withSetup,
|
QString toQString(bool withSetup,
|
||||||
|
|||||||
Reference in New Issue
Block a user