Skip to content

Commit e1bd2bf

Browse files
committed
Compile errors and warnings fixed for GCC 4.6
1 parent 765337e commit e1bd2bf

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

MTA10_Server/mods/deathmatch/logic/CRPCFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void CRPCFunctions::RequestStealthKill ( NetBitStreamInterface & bitStream )
334334
{
335335
CLuaArguments Arguments;
336336
Arguments.PushElement ( pTarget );
337-
if ( m_pSourcePlayer->CallEvent ( "onPlayerStealthKill", Arguments, false ) )
337+
if ( m_pSourcePlayer->CallEvent ( "onPlayerStealthKill", Arguments ) )
338338
{
339339
// Start the stealth kill
340340
CStaticFunctionDefinitions::KillPed ( pTarget, m_pSourcePlayer, 4 /*WEAPONTYPE_KNIFE*/, 9/*BODYPART_HEAD*/, true );

MTA10_Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,9 +2567,6 @@ void Unescape ( std::string& str )
25672567

25682568
ResponseCode CResource::HandleRequestCall ( HttpRequest * ipoHttpRequest, HttpResponse * ipoHttpResponse, CAccount* account )
25692569
{
2570-
static int bAlreadyCalling = false; // a mini-mutex flag, seems to work :)
2571-
// This code runs multithreaded, we need to make sure multiple server requests don't overlap each other... (slows the server down quite a bit)
2572-
25732570
// Check for http general and if we have access to this resource
25742571
// if we're trying to return a http file. Otherwize it's the MTA
25752572
// client trying to download files.
@@ -2602,7 +2599,6 @@ ResponseCode CResource::HandleRequestCall ( HttpRequest * ipoHttpRequest, HttpRe
26022599
// If denied with both 'new way' and 'old way' then stop here
26032600
if ( !bResourceBlahHttp && ( !bResourceBlah || !bGeneralHttp ) )
26042601
{
2605-
bAlreadyCalling = false;
26062602
return g_pGame->GetHTTPD()->RequestLogin ( ipoHttpResponse );
26072603
}
26082604

@@ -2620,7 +2616,6 @@ ResponseCode CResource::HandleRequestCall ( HttpRequest * ipoHttpRequest, HttpRe
26202616
{
26212617
const char* szError = "error: invalid function name";
26222618
ipoHttpResponse->SetBody ( szError, strlen(szError) );
2623-
bAlreadyCalling = false;
26242619
return HTTPRESPONSECODE_200_OK;
26252620
}
26262621

@@ -2842,26 +2837,22 @@ ResponseCode CResource::HandleRequestCall ( HttpRequest * ipoHttpRequest, HttpRe
28422837
g_pGame->GetScriptDebugging()->SaveLuaDebugInfo( SLuaDebugInfo() );
28432838

28442839
ipoHttpResponse->SetBody ( strJSON.c_str (), strJSON.length () );
2845-
bAlreadyCalling = false;
28462840
return HTTPRESPONSECODE_200_OK;
28472841
}
28482842
else
28492843
{
2850-
bAlreadyCalling = false;
28512844
return g_pGame->GetHTTPD()->RequestLogin ( ipoHttpResponse );
28522845
}
28532846
}
28542847
else
28552848
{
2856-
bAlreadyCalling = false;
28572849
return g_pGame->GetHTTPD()->RequestLogin ( ipoHttpResponse );
28582850
}
28592851
}
28602852
}
28612853

28622854
const char* szError = "error: not found";
28632855
ipoHttpResponse->SetBody ( szError, strlen(szError) );
2864-
bAlreadyCalling = false;
28652856
return HTTPRESPONSECODE_200_OK;
28662857
}
28672858

MTA10_Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ bool CStaticFunctionDefinitions::SetElementModel ( CElement* pElement, unsigned
17411741
Arguments.PushNumber ( pPed->GetModel() ); // Get the old model
17421742
pPed->SetModel ( usModel ); // Set the new model
17431743
Arguments.PushNumber ( usModel ); // Get the new model
1744-
pPed->CallEvent ( "onElementModelChange", Arguments, false );
1744+
pPed->CallEvent ( "onElementModelChange", Arguments );
17451745
break;
17461746
}
17471747
case CElement::VEHICLE:
@@ -1753,7 +1753,7 @@ bool CStaticFunctionDefinitions::SetElementModel ( CElement* pElement, unsigned
17531753
Arguments.PushNumber ( pVehicle->GetModel () ); // Get the old model
17541754
pVehicle->SetModel ( usModel ); // Set the new model
17551755
Arguments.PushNumber ( usModel ); // Get the new model
1756-
pVehicle->CallEvent ( "onElementModelChange", Arguments, false );
1756+
pVehicle->CallEvent ( "onElementModelChange", Arguments );
17571757

17581758
// Check for any passengers above the max seat list
17591759
unsigned char ucMaxPassengers = pVehicle->GetMaxPassengers ();
@@ -1782,7 +1782,7 @@ bool CStaticFunctionDefinitions::SetElementModel ( CElement* pElement, unsigned
17821782
Arguments.PushNumber ( pObject->GetModel () ); // Get the old model
17831783
pObject->SetModel ( usModel ); // Set the new model
17841784
Arguments.PushNumber ( usModel ); // Get the new model
1785-
pObject->CallEvent ( "onElementModelChange", Arguments, false );
1785+
pObject->CallEvent ( "onElementModelChange", Arguments );
17861786
break;
17871787
}
17881788
default: return false;

Shared/sdk/CFastList.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ class CFastList
5050
, uiNextFrontIndex ( UINT_MAX / 2 - 1 )
5151
, uiNextBackIndex ( UINT_MAX / 2 )
5252
{
53-
// T must be a pointer
54-
void* ptr = (T)NULL;
55-
ptr = NULL;
53+
#ifdef MTA_DEBUG
54+
// T must be a pointer
55+
void* ptr = (T)NULL;
56+
ptr = NULL;
57+
#endif
5658
}
5759

5860
const T& front( void ) const

Shared/sdk/CScriptArgReader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CScriptArgReader
5151
{
5252
lua_Number number = lua_tonumber(m_luaVM, m_iIndex++);
5353

54-
if (isnan(number))
54+
if (std::isnan(number))
5555
{
5656
SetCustomError("Expected number, got NaN", "Bad argument");
5757
return;
@@ -77,7 +77,7 @@ class CScriptArgReader
7777
{
7878
lua_Number number = lua_tonumber(m_luaVM, m_iIndex++);
7979

80-
if (isnan(number))
80+
if (std::isnan(number))
8181
{
8282
SetCustomError("Expected number, got NaN", "Bad argument");
8383
return;

0 commit comments

Comments
 (0)