Fix warning detected by gcc 4.9.1

- unused variables
- linker error with the MinGW DX SDK
- don't delete a void* pointer
- initialization order
This commit is contained in:
Roland Winklmeier
2014-09-28 13:06:58 +02:00
parent f43f3013fe
commit 8ba1a37ea7
3 changed files with 14 additions and 4 deletions

View File

@@ -204,8 +204,12 @@ namespace BlackSimPlugin
SafeDeleteArray(pSettings->pwszPlayerName);
SafeDeleteArray(pSettings->dpnAppDesc.pwszSessionName);
SafeDeleteArray(pSettings->dpnAppDesc.pwszPassword);
SafeDeleteArray(pSettings->dpnAppDesc.pvReservedData);
SafeDeleteArray(pSettings->dpnAppDesc.pvApplicationReservedData);
// The following two lines came from DX9 SDK samples, but they don't make sense.
// Deleteing a void* pointer is considered unsafe. If you really had to pass
// anything non-void here, make sure the original object is cleaned up properly.
// SafeDeleteArray(pSettings->dpnAppDesc.pvReservedData);
// SafeDeleteArray(pSettings->dpnAppDesc.pvApplicationReservedData);
SafeRelease(pSettings->pdp8HostAddress);
SafeRelease(pSettings->ppdp8DeviceAddresses[0]);
SafeDeleteArray(pSettings->ppdp8DeviceAddresses);
@@ -225,6 +229,7 @@ namespace BlackSimPlugin
{
PDPL_MESSAGE_DISCONNECT pDisconnectMsg;
pDisconnectMsg = (PDPL_MESSAGE_DISCONNECT)msgBuffer;
Q_UNUSED(pDisconnectMsg)
// We should free any data associated with the
// app here, but there is none.
@@ -235,6 +240,7 @@ namespace BlackSimPlugin
{
PDPL_MESSAGE_RECEIVE pReceiveMsg;
pReceiveMsg = (PDPL_MESSAGE_RECEIVE)msgBuffer;
Q_UNUSED(pReceiveMsg)
// The lobby app sent us data. This sample doesn't
// expected data from the app, but it is useful
@@ -275,6 +281,7 @@ namespace BlackSimPlugin
{
PDPL_MESSAGE_CONNECTION_SETTINGS pConnectionStatusMsg;
pConnectionStatusMsg = (PDPL_MESSAGE_CONNECTION_SETTINGS)msgBuffer;
Q_UNUSED(pConnectionStatusMsg)
// The app has changed the connection settings.
// This simple client doesn't handle this, but more complex clients may

View File

@@ -9,7 +9,7 @@ TEMPLATE = lib
CONFIG += plugin shared
CONFIG += blackmisc blackcore blacksim
LIBS += -lsimulator_fscommon -lFSUIPC_User
LIBS += -lsimulator_fscommon -lFSUIPC_User -luuid
# required for FSUIPC
win32:!win32-g++*: QMAKE_LFLAGS += /NODEFAULTLIB:LIBC.lib

View File

@@ -44,8 +44,8 @@ namespace BlackSimPlugin
ISimulator(parent),
m_fs9Host(new CFs9Host),
m_hostThread(this),
m_simulatorInfo(CSimulatorInfo::FS9()),
m_lobbyClient(new CLobbyClient(this)),
m_simulatorInfo(CSimulatorInfo::FS9()),
m_fsuipc(new FsCommon::CFsuipc())
{
// We move the host thread already in the constructor
@@ -332,7 +332,10 @@ namespace BlackSimPlugin
m_fs9ClientThreads.remove(client);
m_hashFs9Clients.remove(callsign);
break;
}
default:
break;
}
}