Fix linux clang errors and warnings

refs #596
This commit is contained in:
Roland Winklmeier
2016-02-11 16:44:18 +01:00
parent 2da4a3e47e
commit 7953d550ea
28 changed files with 48 additions and 48 deletions

View File

@@ -95,7 +95,7 @@ namespace BlackMisc
}
else
{
codes == this->findByIataCode(icaoPattern.getIataCode());
codes = this->findByIataCode(icaoPattern.getIataCode());
}
if (codes.size() == 1) { return codes.front(); }

View File

@@ -43,13 +43,13 @@ namespace BlackMisc
{ }
//! Set active frequency
void setFrequencyActiveMHz(double frequencyMHz)
void setFrequencyActiveMHz(double frequencyMHz) override
{
this->CModulator::setFrequencyActiveMHz(frequencyMHz);
}
//! Set standby frequency
void setFrequencyStandbyMHz(double frequencyMHz)
void setFrequencyStandbyMHz(double frequencyMHz) override
{
this->CModulator::setFrequencyStandbyMHz(frequencyMHz);
}

View File

@@ -188,7 +188,7 @@ namespace BlackMisc
std::array<double, 3> CCoordinateGeodetic::normalVectorDouble() const
{
return { this->m_x, this->m_y, this->m_z };
return { { this->m_x, this->m_y, this->m_z } };
}
void CCoordinateGeodetic::setLatitude(const CLatitude &latitude)

View File

@@ -169,10 +169,10 @@ namespace BlackMisc
virtual const BlackMisc::PhysicalQuantities::CLength &geodeticHeight() const override { return this->m_geodeticHeight; }
//! \copydoc ICoordinateGeodetic::normalVector
virtual QVector3D normalVector() const;
virtual QVector3D normalVector() const override;
//! \copydoc ICoordinateGeodetic::normalVectorDouble
virtual std::array<double, 3> normalVectorDouble() const;
virtual std::array<double, 3> normalVectorDouble() const override;
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;

View File

@@ -315,7 +315,7 @@ namespace BlackMisc
{
if (this->isNull()) return false;
if (value == 0) return true;
return abs(value) <= this->m_epsilon;
return std::abs(value) <= this->m_epsilon;
}
//! Is unit null?

View File

@@ -43,7 +43,7 @@ namespace BlackMisc
virtual BlackMisc::Aviation::CAircraftParts getOwnAircraftParts() const override;
//! \copydoc IOwnAircraftProvider::getOwnAircraftModel
virtual BlackMisc::Simulation::CAircraftModel getOwnAircraftModel() const;
virtual BlackMisc::Simulation::CAircraftModel getOwnAircraftModel() const override;
//! \copydoc IOwnAircraftProvider::getDistanceToOwnAircraft
virtual BlackMisc::PhysicalQuantities::CLength getDistanceToOwnAircraft(const BlackMisc::Geo::ICoordinateGeodetic &position) const override;

View File

@@ -15,7 +15,7 @@ namespace BlackMisc
m_payload(payload)
{}
CStatusException::CStatusException(const CStatusException &other) : std::exception(other)
CStatusException::CStatusException(const CStatusException &other) : std::exception(other), m_payload(other.m_payload)
{
QReadLocker lock(&other.m_lock);
this->m_temp = other.m_temp;

View File

@@ -193,7 +193,7 @@ namespace BlackMisc
void valuesSaveRequested(const BlackMisc::CValueCachePacket &values);
private:
struct Element; // remove forward declaration when elementsStartingWith uses C++14 auto deduced return type
struct Element; // remove forward declaration (and uncomment the one below) when elementsStartingWith uses C++14 auto deduced return type
protected:
//! Returns a range referring to all elements which start with the given prefix.
@@ -235,7 +235,7 @@ namespace BlackMisc
private:
friend class Private::CValuePage;
struct Element;
// struct Element; // to be uncommented when the forward declaration above elementsStartingWith is removed
using ElementPtr = QSharedPointer<Element>; // QMap doesn't support move-only types
QMap<QString, ElementPtr> m_elements;

View File

@@ -105,7 +105,7 @@ namespace BlackMisc
protected:
QString getRegExp() const override { return QStringLiteral("^(?<airport>\\w{4}) "); }
bool validateAndSet(const QRegularExpressionMatch &match, CMetar &metar) const
bool validateAndSet(const QRegularExpressionMatch &match, CMetar &metar) const override
{
QString airportAsString = match.captured("airport");
Q_ASSERT(!airportAsString.isEmpty());
@@ -475,7 +475,7 @@ namespace BlackMisc
return hash;
}
virtual bool isRepeatable() const { return true; }
virtual bool isRepeatable() const override { return true; }
// w'w' represents present weather, coded in accordance with WMO Code Table 4678.
// As many groups as necessary are included, with each group containing from 2 to 9 characters.
@@ -550,7 +550,7 @@ namespace BlackMisc
return hash;
}
virtual bool isRepeatable() const { return true; }
virtual bool isRepeatable() const override { return true; }
QString getRegExp() const override
{