Skip to content

Commit

Permalink
'Fixed' Linux compile warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Sep 15, 2015
1 parent 6fb63b1 commit 02f5e7e
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion MTA10_Server/core/CCrashHandler.cpp
Expand Up @@ -77,7 +77,7 @@ void CCrashHandler::Init ( const SString& strInServerPath )
#ifndef WIN32

// Save basic backtrace info into a file. Forced inline to avoid backtrace pollution
__attribute__((always_inline))
inline __attribute__((always_inline))
static void SaveBacktraceSummary()
{
// Collect backtrace information
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/core/CModManagerImpl.h
Expand Up @@ -29,7 +29,7 @@ class CModManagerImpl : public CModManager
{
public:
CModManagerImpl ( CServerImpl* pServer );
~CModManagerImpl ( void );
virtual ~CModManagerImpl ( void );

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

Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/core/CServerImpl.cpp
Expand Up @@ -29,7 +29,7 @@
#include <unistd.h>

// This is probably safer than changing MTAPlatform.h against compatibility issues
#undef Printf
#undef Print
#define Print printf
#endif

Expand Down
4 changes: 3 additions & 1 deletion MTA10_Server/core/Server.cpp
Expand Up @@ -14,7 +14,9 @@
#include "CServerImpl.h"
#define ALLOC_STATS_MODULE_NAME "core"
#include "SharedUtil.hpp"
#include "SharedUtil.Tests.hpp"
#if defined(_DEBUG)
#include "SharedUtil.Tests.hpp"
#endif
#ifdef WIN_x86
// TODO - 64 bit file hooks
#include "SharedUtil.Win32Utf8FileHooks.hpp"
Expand Down
5 changes: 2 additions & 3 deletions MTA10_Server/mods/deathmatch/logic/CAccountManager.cpp
Expand Up @@ -290,19 +290,18 @@ bool CAccountManager::LoadXML ( CXMLNode* pParent )
}
else
{
CAccount* pAccount = NULL;
pAttribute = pAccountNode->GetAttributes ().Find ( "serial" );
if ( pAttribute )
{
//Insert the entry into the accounts database
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() );
pAccount = new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, pAttribute->GetValue () );
new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, pAttribute->GetValue () );
}
else
{
//Insert the entry into the accounts database
m_pDatabaseManager->Execf ( m_hDbConnection, "INSERT INTO accounts (name, password) VALUES(?,?)", SQLITE_TEXT, strName.c_str(), SQLITE_TEXT, strPassword.c_str() );
pAccount = new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, "" );
new CAccount ( this, true, strName, strPassword, "", m_iAccounts++, "" );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/CDatabaseManager.cpp
Expand Up @@ -444,7 +444,7 @@ void CDatabaseManagerImpl::SetLogLevel ( EJobLogLevelType logLevel, const SStrin
CDbOptionsMap argMap;
argMap.Set ( "name", strLogFilename );
argMap.Set ( "level", logLevel );
CDbJobData* pJobData = m_JobQueue->AddCommand ( EJobCommand::SETLOGLEVEL, NULL, argMap.ToString () );
CDbJobData* pJobData = m_JobQueue->AddCommand ( EJobCommand::SETLOGLEVEL, 0, argMap.ToString () );
m_JobQueue->FreeCommand ( pJobData );
}

Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/CGame.cpp
Expand Up @@ -989,7 +989,7 @@ bool CGame::ProcessPacket ( CPacket& Packet )
{
// Can we handle it?
ePacketID PacketID = Packet.GetPacketID ();
switch ( PacketID )
switch ( (int)PacketID )
{
case PACKET_ID_PLAYER_JOINDATA:
{
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/CPacketTranslator.cpp
Expand Up @@ -31,7 +31,7 @@ CPacket* CPacketTranslator::Translate ( const NetServerPlayerID& Socket, ePacket
{
// Create the packet class
CPacket* pTemp = NULL;
switch ( PacketID )
switch ( (int)PacketID )
{
case PACKET_ID_PLAYER_JOIN:
pTemp = new CPlayerJoinPacket;
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/CXMLConfig.h
Expand Up @@ -21,7 +21,7 @@ class CXMLConfig
{
public:
CXMLConfig ( const char* szFileName );
~CXMLConfig ( void );
virtual ~CXMLConfig ( void );

inline std::string& GetFileName ( void ) { return m_strFileName; }
void SetFileName ( const char* szFileName );
Expand Down
3 changes: 1 addition & 2 deletions MTA10_Server/mods/deathmatch/logic/Utils.cpp
Expand Up @@ -374,13 +374,12 @@ bool IsValidOrganizationPath ( const char *szDir )
if ( uiLen > 0 && szDir [ uiLen - 1 ] == '/' ) // will return false if ending with an invalid character, mainly used for linux (#6871)
return false;

unsigned char c, c_d;
unsigned char c;
bool bInsideBraces = false;

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

// Enforce braces around visible letters
if ( !bInsideBraces && IsVisibleCharacter ( c ) && c != '[' && c != ']' && c != '/' && c != '\\' )
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/lua/CLuaModule.h
Expand Up @@ -47,7 +47,7 @@ class CLuaModule : public ILuaModuleManager10
public:

CLuaModule ( CLuaModuleManager* pLuaModuleManager, CScriptDebugging* pScriptDebugging, const char* szFileName, const char* szShortFileName );
~CLuaModule ( void );
virtual ~CLuaModule ( void );

// functions for external modules until DP2.3
void Printf ( const char * szFormat, ... );
Expand Down
Expand Up @@ -12,7 +12,7 @@ class CSimPacket
{
public:
CSimPacket ( void ) { DEBUG_CREATE_COUNT( "CSimPacket" ); }
~CSimPacket ( void ) { DEBUG_DESTROY_COUNT( "CSimPacket" ); }
virtual ~CSimPacket ( void ) { DEBUG_DESTROY_COUNT( "CSimPacket" ); }

virtual ePacketID GetPacketID ( void ) const = 0;
virtual ePacketOrdering GetPacketOrdering ( void ) const { return PACKET_ORDERING_DEFAULT; }
Expand Down
2 changes: 1 addition & 1 deletion Shared/XML/CXMLImpl.h
Expand Up @@ -19,7 +19,7 @@ class CXMLImpl : public CXML
{
public:
CXMLImpl ( void );
~CXMLImpl ( void );
virtual ~CXMLImpl ( void );

CXMLFile* CreateXML ( const char* szFilename, bool bUseIDs );
void DeleteXML ( CXMLFile* pFile );
Expand Down
3 changes: 2 additions & 1 deletion Shared/animation/CEasingCurve.cpp
Expand Up @@ -32,7 +32,8 @@ class CComplexEasingFunction
m_fPeriod ( period ),
m_fOvershoot ( overshoot)
{ }

virtual ~CComplexEasingFunction( void ) {}

virtual double valueForProgress ( double a_fProgress ) const = 0;

eType m_eType;
Expand Down
12 changes: 6 additions & 6 deletions initial-install.sh
Expand Up @@ -43,13 +43,13 @@ cd ../..
# building in parallel mode (use -j<JOBS>)
if [ $1 = "-g" ]; then
make \
CFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized' \
CXXFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -std=gnu++0x' \
CPPFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized' >_make.log
CFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' \
CXXFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing -std=c++0x' \
CPPFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' >_make.log
else
make \
CFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized' \
CXXFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized -std=gnu++0x' \
CPPFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized' >_make.log
CFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' \
CXXFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing -std=c++0x' \
CPPFLAGS='-O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' >_make.log
fi

0 comments on commit 02f5e7e

Please sign in to comment.