Skip to content

Commit c41f39a

Browse files
committed
'Fixed' Linux compile warnings.
1 parent d753afd commit c41f39a

File tree

15 files changed

+24
-23
lines changed

15 files changed

+24
-23
lines changed

MTA10_Server/core/CCrashHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void CCrashHandler::Init ( const SString& strInServerPath )
7777
#ifndef WIN32
7878

7979
// Save basic backtrace info into a file. Forced inline to avoid backtrace pollution
80-
__attribute__((always_inline))
80+
inline __attribute__((always_inline))
8181
static void SaveBacktraceSummary()
8282
{
8383
// Collect backtrace information

MTA10_Server/core/CModManagerImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CModManagerImpl : public CModManager
2929
{
3030
public:
3131
CModManagerImpl ( CServerImpl* pServer );
32-
~CModManagerImpl ( void );
32+
virtual ~CModManagerImpl ( void );
3333

3434
inline void SetServerPath ( const char* szServerPath ) { m_strServerPath = szServerPath; };
3535

MTA10_Server/core/CServerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <unistd.h>
3030

3131
// This is probably safer than changing MTAPlatform.h against compatibility issues
32-
#undef Printf
32+
#undef Print
3333
#define Print printf
3434
#endif
3535

MTA10_Server/core/Server.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include "CServerImpl.h"
1515
#define ALLOC_STATS_MODULE_NAME "core"
1616
#include "SharedUtil.hpp"
17-
#include "SharedUtil.Tests.hpp"
17+
#if defined(_DEBUG)
18+
#include "SharedUtil.Tests.hpp"
19+
#endif
1820
#ifdef WIN_x86
1921
// TODO - 64 bit file hooks
2022
#include "SharedUtil.Win32Utf8FileHooks.hpp"

MTA10_Server/mods/deathmatch/logic/CAccountManager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,18 @@ bool CAccountManager::LoadXML ( CXMLNode* pParent )
290290
}
291291
else
292292
{
293-
CAccount* pAccount = NULL;
294293
pAttribute = pAccountNode->GetAttributes ().Find ( "serial" );
295294
if ( pAttribute )
296295
{
297296
//Insert the entry into the accounts database
298297
m_pDatabaseManager->Execf ( m_hDbConnection, "INSERT INTO accounts (name, password, serial) VALUES(?,?,?)", SQLITE_TEXT, strName.c_str(), SQLITE_TEXT, strPassword.c_str(), SQLITE_TEXT, pAttribute->GetValue().c_str() );
299-
pAccount = new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, pAttribute->GetValue () );
298+
new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, pAttribute->GetValue () );
300299
}
301300
else
302301
{
303302
//Insert the entry into the accounts database
304303
m_pDatabaseManager->Execf ( m_hDbConnection, "INSERT INTO accounts (name, password) VALUES(?,?)", SQLITE_TEXT, strName.c_str(), SQLITE_TEXT, strPassword.c_str() );
305-
pAccount = new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, "" );
304+
new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, "" );
306305
}
307306
}
308307
}

MTA10_Server/mods/deathmatch/logic/CDatabaseManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void CDatabaseManagerImpl::SetLogLevel ( EJobLogLevelType logLevel, const SStrin
444444
CDbOptionsMap argMap;
445445
argMap.Set ( "name", strLogFilename );
446446
argMap.Set ( "level", logLevel );
447-
CDbJobData* pJobData = m_JobQueue->AddCommand ( EJobCommand::SETLOGLEVEL, NULL, argMap.ToString () );
447+
CDbJobData* pJobData = m_JobQueue->AddCommand ( EJobCommand::SETLOGLEVEL, 0, argMap.ToString () );
448448
m_JobQueue->FreeCommand ( pJobData );
449449
}
450450

MTA10_Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ bool CGame::ProcessPacket ( CPacket& Packet )
989989
{
990990
// Can we handle it?
991991
ePacketID PacketID = Packet.GetPacketID ();
992-
switch ( PacketID )
992+
switch ( (int)PacketID )
993993
{
994994
case PACKET_ID_PLAYER_JOINDATA:
995995
{

MTA10_Server/mods/deathmatch/logic/CPacketTranslator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CPacket* CPacketTranslator::Translate ( const NetServerPlayerID& Socket, ePacket
3131
{
3232
// Create the packet class
3333
CPacket* pTemp = NULL;
34-
switch ( PacketID )
34+
switch ( (int)PacketID )
3535
{
3636
case PACKET_ID_PLAYER_JOIN:
3737
pTemp = new CPlayerJoinPacket;

MTA10_Server/mods/deathmatch/logic/CXMLConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CXMLConfig
2121
{
2222
public:
2323
CXMLConfig ( const char* szFileName );
24-
~CXMLConfig ( void );
24+
virtual ~CXMLConfig ( void );
2525

2626
inline std::string& GetFileName ( void ) { return m_strFileName; }
2727
void SetFileName ( const char* szFileName );

MTA10_Server/mods/deathmatch/logic/Utils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,12 @@ bool IsValidOrganizationPath ( const char *szDir )
374374
if ( uiLen > 0 && szDir [ uiLen - 1 ] == '/' ) // will return false if ending with an invalid character, mainly used for linux (#6871)
375375
return false;
376376

377-
unsigned char c, c_d;
377+
unsigned char c;
378378
bool bInsideBraces = false;
379379

380380
// iterate through the char array
381381
for ( unsigned int i = 0; i < uiLen; i++ ) {
382382
c = szDir[i]; // current character
383-
c_d = ( i < ( uiLen - 1 ) ) ? szDir[i+1] : 0; // one character ahead, if any
384383

385384
// Enforce braces around visible letters
386385
if ( !bInsideBraces && IsVisibleCharacter ( c ) && c != '[' && c != ']' && c != '/' && c != '\\' )

0 commit comments

Comments
 (0)