mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +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;
|
||||
args >> modeString;
|
||||
BlackCore::INetwork::LoginMode mode;
|
||||
BlackCore::INetwork::LoginMode mode(BlackCore::INetwork::LoginNormal);
|
||||
if (modeString == "normal") { mode = BlackCore::INetwork::LoginNormal; }
|
||||
if (modeString == "observer") { mode = BlackCore::INetwork::LoginAsObserver; }
|
||||
if (modeString == "stealth") { mode = BlackCore::INetwork::LoginStealth; }
|
||||
|
||||
@@ -267,10 +267,10 @@ namespace BlackCore
|
||||
bool m_debugMessages = false; //!< Display debug messages
|
||||
bool m_blinkCycle = false; //!< use for highlighting
|
||||
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::Aviation::CCallsignList m_callsignsToBeRendered;
|
||||
QTimer *m_oneSecondTimer = nullptr;
|
||||
BlackMisc::Aviation::CCallsignList m_callsignsToBeRendered; //!< callsigns which will be rendered
|
||||
QTimer *m_oneSecondTimer = nullptr; //!< timer
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
||||
CLogMessage(this).warning("invalid port");
|
||||
return;
|
||||
}
|
||||
quint16 p = port.toUInt();
|
||||
int p = port.toInt();
|
||||
QString msg;
|
||||
if (!CNetworkUtils::canConnect(address, p, msg))
|
||||
{
|
||||
@@ -108,7 +108,7 @@ namespace BlackGui
|
||||
CLogMessage(this).warning("invalid port");
|
||||
return;
|
||||
}
|
||||
quint16 p = port.toUInt();
|
||||
int p = port.toInt();
|
||||
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
||||
Q_ASSERT(!fileName.isEmpty());
|
||||
// write either local or remote file
|
||||
|
||||
@@ -421,7 +421,6 @@ namespace BlackGui
|
||||
cmd.append(" ").append(enteredLine);
|
||||
return cmd;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void CTextMessageComponent::onTextMessageReceived(const CTextMessageList &messages)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace BlackMisc
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s(m_number);
|
||||
s += m_on;
|
||||
s += BlackMisc::boolToOnOff(m_on);
|
||||
return s;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -18,15 +18,15 @@ namespace BlackMisc
|
||||
QString s;
|
||||
s += m_lights.toQString(i18n);
|
||||
s += " gear down: ";
|
||||
s += m_gearDown;
|
||||
s += BlackMisc::boolToYesNo(m_gearDown);
|
||||
s += " flaps pct: ";
|
||||
s += m_flapsPercentage;
|
||||
s += QString::number(m_flapsPercentage);
|
||||
s += " spoilers out: ";
|
||||
s += m_spoilersOut;
|
||||
s += BlackMisc::boolToYesNo(m_spoilersOut);
|
||||
s += " engines on: ";
|
||||
s += m_engines.toQString(i18n);
|
||||
s += " on ground: ";
|
||||
s += m_isOnGround;
|
||||
s += BlackMisc::boolToYesNo(m_isOnGround);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackMisc
|
||||
/*
|
||||
* 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))
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace BlackMisc
|
||||
// http://qt-project.org/forums/viewthread/9346
|
||||
QTcpSocket socket;
|
||||
bool connected = false;
|
||||
socket.connectToHost(hostAddress, port);
|
||||
socket.connectToHost(hostAddress, static_cast<quint16>(port));
|
||||
if (!socket.waitForConnected(timeoutMs))
|
||||
{
|
||||
message = QObject::tr("Connection failed : %1", "BlackMisc").arg(socket.errorString());
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BlackMisc
|
||||
* \param message human readable message
|
||||
* \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?
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace BlackMisc
|
||||
void setDescription(const QString &description) { m_description = description.trimmed().simplified(); }
|
||||
|
||||
//! Get port
|
||||
qint32 getPort() const { return m_port; }
|
||||
int getPort() const { return m_port; }
|
||||
|
||||
//! Set port
|
||||
void setPort(qint32 port) { m_port = port; }
|
||||
void setPort(int port) { m_port = port; }
|
||||
|
||||
//! Server is accepting connections
|
||||
bool isAcceptingConnections() const { return m_isAcceptingConnections; }
|
||||
@@ -101,9 +101,9 @@ namespace BlackMisc
|
||||
QString m_name;
|
||||
QString m_description;
|
||||
QString m_address;
|
||||
qint32 m_port;
|
||||
CUser m_user;
|
||||
bool m_isAcceptingConnections;
|
||||
int m_port;
|
||||
CUser m_user;
|
||||
bool m_isAcceptingConnections;
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -57,8 +57,6 @@ namespace BlackMisc
|
||||
return u;
|
||||
}
|
||||
}
|
||||
Q_ASSERT("Wrong index");
|
||||
return QString(""); // never reached
|
||||
}
|
||||
|
||||
void CVoiceCapabilities::setFromFlightPlanRemarks(const QString &flightPlanRemarks)
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace BlackMisc
|
||||
class IOwnAircraftProvider : public IOwnAircraftProviderReadOnly
|
||||
{
|
||||
public:
|
||||
|
||||
using IOwnAircraftProviderReadOnly::ownAircraft;
|
||||
|
||||
//! Own aircraft
|
||||
virtual CSimulatedAircraft &ownAircraft() = 0;
|
||||
|
||||
|
||||
@@ -63,6 +63,11 @@ namespace BlackMisc
|
||||
class IRemoteAircraftProvider : public IRemoteAircraftProviderReadOnly
|
||||
{
|
||||
public:
|
||||
|
||||
using IRemoteAircraftProviderReadOnly::remoteAircraft;
|
||||
using IRemoteAircraftProviderReadOnly::remoteAircraftParts;
|
||||
using IRemoteAircraftProviderReadOnly::remoteAircraftSituations;
|
||||
|
||||
//! All rendered aircraft
|
||||
//! \note in memory reference, not thread safe
|
||||
virtual CSimulatedAircraftList &remoteAircraft() = 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace BlackSim
|
||||
//
|
||||
// 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);
|
||||
QFile file(fileName);
|
||||
@@ -46,7 +46,7 @@ namespace BlackSim
|
||||
//
|
||||
// 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"
|
||||
"MaxReceiveSize=4096\nDisableNagle=0").arg(ip).arg(port);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackSim
|
||||
* \param port Port of FSX (e.g. 500)
|
||||
* \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
|
||||
@@ -57,7 +57,7 @@ namespace BlackSim
|
||||
* \param port Port of FSX (e.g. 500)
|
||||
* \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).
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace BlackSimPlugin
|
||||
//! Set default values
|
||||
void setDefaultValues()
|
||||
{
|
||||
std::fill(data, data + 128, 0);
|
||||
std::fill(data, data + 128, static_cast<byte>(0));
|
||||
data[17] = 1; // standby
|
||||
data[19] = 0; // no ident
|
||||
}
|
||||
|
||||
@@ -185,7 +185,6 @@ namespace BlackSimPlugin
|
||||
CLogMessage(this).warning("FSX: Not connected, not added aircraft %1") << callsign.toQString();
|
||||
return false;
|
||||
}
|
||||
remoteAircraft().setRendered(callsign, false);
|
||||
}
|
||||
|
||||
bool CSimulatorFsx::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const QString &originator)
|
||||
|
||||
Reference in New Issue
Block a user