mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Fixed warnings as mentioned in
https://dev.vatsim-germany.org/boards/22/topics/2587?r=2598#message-2598 and found by +win32-msvc*:QMAKE_CXXFLAGS_WARN_ON *= /Wall /W3 /wd4640 /wd4619 /wd4350 /wd4351
This commit is contained in:
@@ -173,7 +173,7 @@ void Client::presetLoginModeCmd(QTextStream &args)
|
|||||||
{
|
{
|
||||||
QString modeString;
|
QString modeString;
|
||||||
args >> modeString;
|
args >> modeString;
|
||||||
BlackCore::INetwork::LoginMode mode;
|
BlackCore::INetwork::LoginMode mode(BlackCore::INetwork::LoginNormal);
|
||||||
if (modeString == "normal") { mode = BlackCore::INetwork::LoginNormal; }
|
if (modeString == "normal") { mode = BlackCore::INetwork::LoginNormal; }
|
||||||
if (modeString == "observer") { mode = BlackCore::INetwork::LoginAsObserver; }
|
if (modeString == "observer") { mode = BlackCore::INetwork::LoginAsObserver; }
|
||||||
if (modeString == "stealth") { mode = BlackCore::INetwork::LoginStealth; }
|
if (modeString == "stealth") { mode = BlackCore::INetwork::LoginStealth; }
|
||||||
|
|||||||
@@ -267,10 +267,10 @@ namespace BlackCore
|
|||||||
bool m_debugMessages = false; //!< Display debug messages
|
bool m_debugMessages = false; //!< Display debug messages
|
||||||
bool m_blinkCycle = false; //!< use for highlighting
|
bool m_blinkCycle = false; //!< use for highlighting
|
||||||
IInterpolator *m_interpolator = nullptr; //!< interpolator instance
|
IInterpolator *m_interpolator = nullptr; //!< interpolator instance
|
||||||
qint64 m_highlightEndTimeMsEpoch = 0;
|
qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting
|
||||||
BlackMisc::Simulation::CSimulatedAircraftList m_highlightedAircraft; //!< all other aircraft are to be ignored
|
BlackMisc::Simulation::CSimulatedAircraftList m_highlightedAircraft; //!< all other aircraft are to be ignored
|
||||||
BlackMisc::Aviation::CCallsignList m_callsignsToBeRendered;
|
BlackMisc::Aviation::CCallsignList m_callsignsToBeRendered; //!< callsigns which will be rendered
|
||||||
QTimer *m_oneSecondTimer = nullptr;
|
QTimer *m_oneSecondTimer = nullptr; //!< timer
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
|||||||
CLogMessage(this).warning("invalid port");
|
CLogMessage(this).warning("invalid port");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
quint16 p = port.toUInt();
|
int p = port.toInt();
|
||||||
QString msg;
|
QString msg;
|
||||||
if (!CNetworkUtils::canConnect(address, p, msg))
|
if (!CNetworkUtils::canConnect(address, p, msg))
|
||||||
{
|
{
|
||||||
@@ -108,7 +108,7 @@ namespace BlackGui
|
|||||||
CLogMessage(this).warning("invalid port");
|
CLogMessage(this).warning("invalid port");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
quint16 p = port.toUInt();
|
int p = port.toInt();
|
||||||
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
||||||
Q_ASSERT(!fileName.isEmpty());
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
// write either local or remote file
|
// write either local or remote file
|
||||||
|
|||||||
@@ -421,7 +421,6 @@ namespace BlackGui
|
|||||||
cmd.append(" ").append(enteredLine);
|
cmd.append(" ").append(enteredLine);
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTextMessageComponent::onTextMessageReceived(const CTextMessageList &messages)
|
void CTextMessageComponent::onTextMessageReceived(const CTextMessageList &messages)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
QString s(m_number);
|
QString s(m_number);
|
||||||
s += m_on;
|
s += BlackMisc::boolToOnOff(m_on);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ namespace BlackMisc
|
|||||||
QString s;
|
QString s;
|
||||||
s += m_lights.toQString(i18n);
|
s += m_lights.toQString(i18n);
|
||||||
s += " gear down: ";
|
s += " gear down: ";
|
||||||
s += m_gearDown;
|
s += BlackMisc::boolToYesNo(m_gearDown);
|
||||||
s += " flaps pct: ";
|
s += " flaps pct: ";
|
||||||
s += m_flapsPercentage;
|
s += QString::number(m_flapsPercentage);
|
||||||
s += " spoilers out: ";
|
s += " spoilers out: ";
|
||||||
s += m_spoilersOut;
|
s += BlackMisc::boolToYesNo(m_spoilersOut);
|
||||||
s += " engines on: ";
|
s += " engines on: ";
|
||||||
s += m_engines.toQString(i18n);
|
s += m_engines.toQString(i18n);
|
||||||
s += " on ground: ";
|
s += " on ground: ";
|
||||||
s += m_isOnGround;
|
s += BlackMisc::boolToYesNo(m_isOnGround);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace BlackMisc
|
|||||||
/*
|
/*
|
||||||
* Can connect to IP/port?
|
* Can connect to IP/port?
|
||||||
*/
|
*/
|
||||||
bool CNetworkUtils::canConnect(const QString &hostAddress, quint16 port, QString &message, int timeoutMs)
|
bool CNetworkUtils::canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs)
|
||||||
{
|
{
|
||||||
if (!CNetworkUtils::hasConnectedInterface(false))
|
if (!CNetworkUtils::hasConnectedInterface(false))
|
||||||
{
|
{
|
||||||
@@ -80,7 +80,7 @@ namespace BlackMisc
|
|||||||
// http://qt-project.org/forums/viewthread/9346
|
// http://qt-project.org/forums/viewthread/9346
|
||||||
QTcpSocket socket;
|
QTcpSocket socket;
|
||||||
bool connected = false;
|
bool connected = false;
|
||||||
socket.connectToHost(hostAddress, port);
|
socket.connectToHost(hostAddress, static_cast<quint16>(port));
|
||||||
if (!socket.waitForConnected(timeoutMs))
|
if (!socket.waitForConnected(timeoutMs))
|
||||||
{
|
{
|
||||||
message = QObject::tr("Connection failed : %1", "BlackMisc").arg(socket.errorString());
|
message = QObject::tr("Connection failed : %1", "BlackMisc").arg(socket.errorString());
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace BlackMisc
|
|||||||
* \param message human readable message
|
* \param message human readable message
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
static bool canConnect(const QString &hostAddress, quint16 port, QString &message, int timeoutMs = 1500);
|
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs = 1500);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Can connect to server?
|
* Can connect to server?
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ namespace BlackMisc
|
|||||||
void setDescription(const QString &description) { m_description = description.trimmed().simplified(); }
|
void setDescription(const QString &description) { m_description = description.trimmed().simplified(); }
|
||||||
|
|
||||||
//! Get port
|
//! Get port
|
||||||
qint32 getPort() const { return m_port; }
|
int getPort() const { return m_port; }
|
||||||
|
|
||||||
//! Set port
|
//! Set port
|
||||||
void setPort(qint32 port) { m_port = port; }
|
void setPort(int port) { m_port = port; }
|
||||||
|
|
||||||
//! Server is accepting connections
|
//! Server is accepting connections
|
||||||
bool isAcceptingConnections() const { return m_isAcceptingConnections; }
|
bool isAcceptingConnections() const { return m_isAcceptingConnections; }
|
||||||
@@ -101,9 +101,9 @@ namespace BlackMisc
|
|||||||
QString m_name;
|
QString m_name;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
QString m_address;
|
QString m_address;
|
||||||
qint32 m_port;
|
int m_port;
|
||||||
CUser m_user;
|
CUser m_user;
|
||||||
bool m_isAcceptingConnections;
|
bool m_isAcceptingConnections;
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ namespace BlackMisc
|
|||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Q_ASSERT("Wrong index");
|
|
||||||
return QString(""); // never reached
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoiceCapabilities::setFromFlightPlanRemarks(const QString &flightPlanRemarks)
|
void CVoiceCapabilities::setFromFlightPlanRemarks(const QString &flightPlanRemarks)
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ namespace BlackMisc
|
|||||||
class IOwnAircraftProvider : public IOwnAircraftProviderReadOnly
|
class IOwnAircraftProvider : public IOwnAircraftProviderReadOnly
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
using IOwnAircraftProviderReadOnly::ownAircraft;
|
||||||
|
|
||||||
//! Own aircraft
|
//! Own aircraft
|
||||||
virtual CSimulatedAircraft &ownAircraft() = 0;
|
virtual CSimulatedAircraft &ownAircraft() = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ namespace BlackMisc
|
|||||||
class IRemoteAircraftProvider : public IRemoteAircraftProviderReadOnly
|
class IRemoteAircraftProvider : public IRemoteAircraftProviderReadOnly
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
using IRemoteAircraftProviderReadOnly::remoteAircraft;
|
||||||
|
using IRemoteAircraftProviderReadOnly::remoteAircraftParts;
|
||||||
|
using IRemoteAircraftProviderReadOnly::remoteAircraftSituations;
|
||||||
|
|
||||||
//! All rendered aircraft
|
//! All rendered aircraft
|
||||||
//! \note in memory reference, not thread safe
|
//! \note in memory reference, not thread safe
|
||||||
virtual CSimulatedAircraftList &remoteAircraft() = 0;
|
virtual CSimulatedAircraftList &remoteAircraft() = 0;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace BlackSim
|
|||||||
//
|
//
|
||||||
// Create a very simple SimConnect.cfg
|
// Create a very simple SimConnect.cfg
|
||||||
//
|
//
|
||||||
bool CSimConnectUtilities::writeSimConnectCfg(const QString &fileName, const QString &ip, quint16 port)
|
bool CSimConnectUtilities::writeSimConnectCfg(const QString &fileName, const QString &ip, int port)
|
||||||
{
|
{
|
||||||
QString sc = CSimConnectUtilities::simConnectCfg(ip, port);
|
QString sc = CSimConnectUtilities::simConnectCfg(ip, port);
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
@@ -46,7 +46,7 @@ namespace BlackSim
|
|||||||
//
|
//
|
||||||
// simconnect.cfg file
|
// simconnect.cfg file
|
||||||
//
|
//
|
||||||
QString CSimConnectUtilities::simConnectCfg(const QString &ip, quint16 port)
|
QString CSimConnectUtilities::simConnectCfg(const QString &ip, int port)
|
||||||
{
|
{
|
||||||
QString sc = QString("[SimConnect]\nProtocol=Ipv4\nAddress=%1\nPort=%2\n"
|
QString sc = QString("[SimConnect]\nProtocol=Ipv4\nAddress=%1\nPort=%2\n"
|
||||||
"MaxReceiveSize=4096\nDisableNagle=0").arg(ip).arg(port);
|
"MaxReceiveSize=4096\nDisableNagle=0").arg(ip).arg(port);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace BlackSim
|
|||||||
* \param port Port of FSX (e.g. 500)
|
* \param port Port of FSX (e.g. 500)
|
||||||
* \return content for simconnect.cfg
|
* \return content for simconnect.cfg
|
||||||
*/
|
*/
|
||||||
static QString simConnectCfg(const QString &ip, quint16 port = 500);
|
static QString simConnectCfg(const QString &ip, int port = 500);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create a FSX simconnect.cfg file
|
* Create a FSX simconnect.cfg file
|
||||||
@@ -57,7 +57,7 @@ namespace BlackSim
|
|||||||
* \param port Port of FSX (e.g. 500)
|
* \param port Port of FSX (e.g. 500)
|
||||||
* \return success
|
* \return success
|
||||||
*/
|
*/
|
||||||
static bool writeSimConnectCfg(const QString &fileName, const QString &ip, quint16 port = 500);
|
static bool writeSimConnectCfg(const QString &fileName, const QString &ip, int port = 500);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Resolve SimConnect exception (based on Qt metadata).
|
* Resolve SimConnect exception (based on Qt metadata).
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace BlackSimPlugin
|
|||||||
//! Set default values
|
//! Set default values
|
||||||
void setDefaultValues()
|
void setDefaultValues()
|
||||||
{
|
{
|
||||||
std::fill(data, data + 128, 0);
|
std::fill(data, data + 128, static_cast<byte>(0));
|
||||||
data[17] = 1; // standby
|
data[17] = 1; // standby
|
||||||
data[19] = 0; // no ident
|
data[19] = 0; // no ident
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ namespace BlackSimPlugin
|
|||||||
CLogMessage(this).warning("FSX: Not connected, not added aircraft %1") << callsign.toQString();
|
CLogMessage(this).warning("FSX: Not connected, not added aircraft %1") << callsign.toQString();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
remoteAircraft().setRendered(callsign, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsx::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const QString &originator)
|
bool CSimulatorFsx::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const QString &originator)
|
||||||
|
|||||||
Reference in New Issue
Block a user