Skip to content

Commit c979281

Browse files
Reverted the revert of r144
1 parent 3ccf218 commit c979281

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

sockets/extra/CLuaArgument.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
*
1717
*********************************************************/
1818

19+
#ifdef WIN32
20+
#pragma warning (disable : 4996) // DISABLE: 'strcpy': This function or variable may be unsafe.
21+
#endif
22+
1923
#include "CLuaArgument.h"
2024
#include <assert.h>
2125
#include <cstring>

sockets/extra/CLuaArguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bool CLuaArguments::Call ( lua_State* luaVM, const char* szFunction ) const
102102
int iret = lua_pcall ( luaVM, m_Arguments.size (), 0, 0 ) ;
103103
if ( iret == LUA_ERRRUN || iret == LUA_ERRMEM )
104104
{
105-
const char* szRes = lua_tostring( luaVM, -1 );
105+
//const char* szRes = lua_tostring( luaVM, -1 );
106106
return false; // the function call failed
107107
}
108108

sockets/ml_sockets.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ MTAEXPORT bool InitModule ( ILuaModuleManager10 *pManager, char *szModuleName, c
3232

3333
#ifdef WIN32
3434
WSADATA wsaData;
35-
memset(&wsaData, 0, sizeof(WSADATA)); // Same as ZeroMemory.
36-
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0)
35+
if ( WSAStartup ( MAKEWORD ( 2, 2 ), &wsaData ) != 0 )
3736
{
3837
pModuleManager->ErrorPrintf("[Sockets] Can't start Winsock, aborting...");
3938
return false;
@@ -54,9 +53,9 @@ MTAEXPORT void RegisterFunctions ( lua_State * luaVM )
5453
pModuleManager->RegisterFunction ( luaVM, "sockClose", CFunctions::sockClose );
5554

5655
// Add events
57-
CFunctions::AddEvent(luaVM, "onSockOpened");
58-
CFunctions::AddEvent(luaVM, "onSockData");
59-
CFunctions::AddEvent(luaVM, "onSockClosed");
56+
CFunctions::AddEvent ( luaVM, "onSockOpened" );
57+
CFunctions::AddEvent ( luaVM, "onSockData" );
58+
CFunctions::AddEvent ( luaVM, "onSockClosed" );
6059
}
6160
}
6261

@@ -70,11 +69,11 @@ MTAEXPORT bool DoPulse ( void )
7069
MTAEXPORT bool ShutdownModule ( void )
7170
{
7271
// Stop all sockets before shutting down the module
73-
CSocketManager::HandleStop();
72+
CSocketManager::HandleStop ( );
7473

7574
#ifdef WIN32
7675
// Cleanup Winsock stuff
77-
WSACleanup();
76+
WSACleanup ( );
7877
#endif
7978

8079
return true;

sockets/ml_sockets.vcproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
TreatWChar_tAsBuiltInType="true"
5454
UsePrecompiledHeader="0"
5555
WarningLevel="3"
56-
Detect64BitPortabilityProblems="true"
56+
Detect64BitPortabilityProblems="false"
5757
DebugInformationFormat="4"
5858
/>
5959
<Tool
@@ -138,7 +138,7 @@
138138
TreatWChar_tAsBuiltInType="true"
139139
UsePrecompiledHeader="0"
140140
WarningLevel="3"
141-
Detect64BitPortabilityProblems="true"
141+
Detect64BitPortabilityProblems="false"
142142
DebugInformationFormat="3"
143143
/>
144144
<Tool

0 commit comments

Comments
 (0)