mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #800 Fixed some implicit conversion warnings.
This commit is contained in:
committed by
Klaus Basan
parent
461474e29d
commit
5791de6860
@@ -40,7 +40,7 @@ namespace BlackMisc
|
||||
template <typename ForwardIt, typename OutputIt, typename Generator>
|
||||
void copyRandomElements(ForwardIt in, ForwardIt end, OutputIt out, int n, Generator &&rng)
|
||||
{
|
||||
for (auto size = std::distance(in, end); in != end && n > 0; ++in, --size)
|
||||
for (auto size = static_cast<int>(std::distance(in, end)); in != end && n > 0; ++in, --size)
|
||||
{
|
||||
if (std::uniform_int_distribution<>(0, size - 1)(rng) < n)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackMisc
|
||||
|
||||
void CIcon::setRotation(const PhysicalQuantities::CAngle &rotate)
|
||||
{
|
||||
this->m_rotateDegrees = rotate.valueRounded(PhysicalQuantities::CAngleUnit::deg(), 0);
|
||||
this->m_rotateDegrees = static_cast<int>(rotate.valueRounded(PhysicalQuantities::CAngleUnit::deg(), 0));
|
||||
}
|
||||
|
||||
QString CIcon::convertToQString(bool i18n) const
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace BlackMisc
|
||||
|
||||
if (isModifier()) { return keyStrings.value(m_keyCode); }
|
||||
|
||||
QChar key = QChar::fromLatin1(m_keyCode);
|
||||
QChar key = QChar::fromLatin1(static_cast<char>(m_keyCode));
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace BlackMisc
|
||||
quint32 CBcdConversions::comFrequencyToBcdHz(const BlackMisc::PhysicalQuantities::CFrequency &comFrequency)
|
||||
{
|
||||
// FSX documentation is wrong, we need to use kHz + 2 digits, not Hz
|
||||
quint32 f = comFrequency.valueRounded(CFrequencyUnit::kHz(), 0) / 10;
|
||||
f = dec2Bcd(f);
|
||||
return f;
|
||||
double f = comFrequency.valueRounded(CFrequencyUnit::kHz(), 0) / 10;
|
||||
quint32 fInt = dec2Bcd(static_cast<quint32>(f));
|
||||
return fInt;
|
||||
}
|
||||
|
||||
quint32 CBcdConversions::transponderCodeToBcd(const BlackMisc::Aviation::CTransponder &transponder)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace BlackMisc
|
||||
{
|
||||
auto it = std::find_if(s.begin(), s.end(), predicate);
|
||||
if (it == s.end()) { return -1; }
|
||||
return std::distance(s.begin(), it);
|
||||
return static_cast<int>(std::distance(s.begin(), it));
|
||||
}
|
||||
|
||||
//! Split a string into multiple strings, using a predicate function to identify the split points.
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackMisc
|
||||
double f = 118.0 + (index % 30) * 0.25;
|
||||
|
||||
const QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
||||
const QDateTime dtUntil = dtFrom.addSecs(60 * 60.0); // 1 hour
|
||||
const QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour
|
||||
const CUser user(id, usr);
|
||||
|
||||
CAtcStation station;
|
||||
|
||||
Reference in New Issue
Block a user