Merge pull request #509 from Diusrex/master

Added #pragma for warnings in MSVC warnings
master
Mattes D 2014-01-06 09:15:41 -08:00
commit 6dd44e6230
8 changed files with 89 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="CryptoPP"
ProjectGUID="{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
RootNamespace="cryptlib"
@ -60,6 +60,7 @@
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4702"
/>
<Tool
Name="VCManagedResourceCompilerTool"

View File

@ -14,7 +14,19 @@
#pragma warning(disable:4481)
// Disable some warnings that we don't care about:
#pragma warning(disable:4100)
#pragma warning(disable:4100) // Unreferenced formal parameter
// Useful warnings from warning level 4:
#pragma warning(3 : 4189) // Local variable is initialized but not referenced
#pragma warning(3 : 4702) // Unreachable code
#pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch
#pragma warning(3 : 4389) // Signed/unsigned mismatch
#pragma warning(3 : 4701) // Potentially unitialized local variable used
#pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data
#pragma warning(3 : 4310) // Cast truncates constant value
#pragma warning(3 : 4505) // Unreferenced local function has been removed
#pragma warning(3 : 4127) // Conditional expression is constant
#pragma warning(3 : 4706) // Assignment within conditional expression
#define OBSOLETE __declspec(deprecated)
@ -192,7 +204,7 @@ typedef unsigned short UInt16;
#ifdef _DEBUG
#define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) )
#else
#define ASSERT(x) ((void)0)
#define ASSERT(x) ((void)(x))
#endif
// Pretty much the same as ASSERT() but stays in Release builds

View File

@ -14,9 +14,14 @@ public:
void Lock(void);
void Unlock(void);
// IsLocked/IsLockedByCurrentThread are only used in ASSERT statements, but because of the changes with ASSERT they must always be defined
// The fake versions (in Release) will not effect the program in any way
#ifdef _DEBUG
bool IsLocked(void);
bool IsLockedByCurrentThread(void);
#else
bool IsLocked(void) { return false; }
bool IsLockedByCurrentThread(void) { return false; }
#endif // _DEBUG
private:

View File

@ -5,7 +5,6 @@
#include "Globals.h"
#include "ChunkDataSerializer.h"
#include "cryptopp/randpool.h"
#include "Protocol132.h"
#include "../Root.h"
#include "../Server.h"
@ -19,8 +18,20 @@
#include "../WorldStorage/FastNBT.h"
#include "../StringCompression.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4702)
#endif
#include "cryptopp/randpool.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#define HANDLE_PACKET_READ(Proc, Type, Var) \

View File

@ -10,9 +10,23 @@
#pragma once
#include "Protocol125.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4702)
#endif
#include "cryptopp/modes.h"
#include "cryptopp/aes.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif

View File

@ -16,7 +16,6 @@ Implements the 1.4.x protocol classes representing these protocols:
#include "../Root.h"
#include "../Server.h"
#include "../ClientHandle.h"
#include "cryptopp/randpool.h"
#include "../Item.h"
#include "ChunkDataSerializer.h"
#include "../Entities/Player.h"
@ -25,8 +24,20 @@ Implements the 1.4.x protocol classes representing these protocols:
#include "../Entities/Pickup.h"
#include "../Entities/FallingBlock.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4702)
#endif
#include "cryptopp/randpool.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#define HANDLE_PACKET_READ(Proc, Type, Var) \

View File

@ -16,9 +16,23 @@ Declares the 1.7.x protocol classes:
#include "Protocol.h"
#include "../ByteBuffer.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4702)
#endif
#include "cryptopp/modes.h"
#include "cryptopp/aes.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif

View File

@ -11,9 +11,24 @@
#include "OSSupport/SocketThreads.h"
#include "OSSupport/ListenThread.h"
#include "RCONServer.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4702)
#endif
#include "cryptopp/rsa.h"
#include "cryptopp/randpool.h"
#include "RCONServer.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif