Merge pull request #5572 from shuffle2/msvc-w4

msvc: use /W4 (and fixes to make it work)
This commit is contained in:
shuffle2
2017-06-07 20:33:54 -07:00
committed by GitHub
64 changed files with 254 additions and 173 deletions
+1
View File
@@ -61,6 +61,7 @@
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Source\VSProps\Base.props" />
<Import Project="..\..\Source\VSProps\ClDisableAllWarnings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
+1 -2
View File
@@ -25,8 +25,7 @@ private:
public:
StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
~StreamingVoiceContext();
virtual ~StreamingVoiceContext();
void Stop();
void Play();
+1 -2
View File
@@ -25,8 +25,7 @@ private:
public:
StreamingVoiceContext2_7(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
~StreamingVoiceContext2_7();
virtual ~StreamingVoiceContext2_7();
void Stop();
void Play();
+1
View File
@@ -27,6 +27,7 @@ class Section
public:
Section(LayerType layer, System system, const std::string& name);
virtual ~Section() = default;
virtual bool Exists(const std::string& key) const;
bool Delete(const std::string& key);
+9
View File
@@ -15,6 +15,11 @@
#include "Common/Crypto/bn.h"
#include "Common/Crypto/ec.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4505)
#endif
// y**2 + x*y = x**3 + x + b
UNUSED static const u8 ec_b[30] = {0x00, 0x66, 0x64, 0x7e, 0xde, 0x6c, 0x33, 0x2c, 0x7f, 0x8c,
0x09, 0x23, 0xbb, 0x58, 0x21, 0x3b, 0x33, 0x3b, 0x20, 0xe9,
@@ -404,3 +409,7 @@ void ec_priv_to_pub(const u8* k, u8* Q)
{
point_mul(Q, k, ec_G);
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
+3 -3
View File
@@ -631,9 +631,9 @@ void CopyDir(const std::string& source_path, const std::string& dest_path)
// Returns the current directory
std::string GetCurrentDir()
{
char* dir;
// Get the current working directory (getcwd uses malloc)
if (!(dir = __getcwd(nullptr, 0)))
char* dir = __getcwd(nullptr, 0);
if (!dir)
{
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", GetLastErrorMsg().c_str());
return nullptr;
@@ -986,7 +986,7 @@ u64 IOFile::Tell() const
if (IsOpen())
return ftello(m_file);
else
return -1;
return UINT64_MAX;
}
bool IOFile::Flush()
+4 -3
View File
@@ -248,8 +248,8 @@ bool cInterfaceWGL::Create(void* window_handle, bool core)
return false;
}
int pixel_format;
if (!(pixel_format = ChoosePixelFormat(m_dc, &pfd)))
int pixel_format = ChoosePixelFormat(m_dc, &pfd);
if (!pixel_format)
{
PanicAlert("(2) Can't find a suitable PixelFormat.");
return false;
@@ -261,7 +261,8 @@ bool cInterfaceWGL::Create(void* window_handle, bool core)
return false;
}
if (!(m_rc = wglCreateContext(m_dc)))
m_rc = wglCreateContext(m_dc);
if (!m_rc)
{
PanicAlert("(4) Can't create an OpenGL rendering context.");
return false;
+1 -1
View File
@@ -198,7 +198,7 @@ inline int IntLog2(u64 val)
return 63 - __builtin_clzll(val);
#elif defined(_MSC_VER)
unsigned long result = -1;
unsigned long result = ULONG_MAX;
_BitScanReverse64(&result, val);
return result;
+3 -3
View File
@@ -29,8 +29,8 @@ std::string Profiler::s_lazy_result = "";
int Profiler::s_lazy_delay = 0;
Profiler::Profiler(const std::string& name)
: m_name(name), m_usecs(0), m_usecs_min(-1), m_usecs_max(0), m_usecs_quad(0), m_calls(0),
m_depth(0)
: m_name(name), m_usecs(0), m_usecs_min(UINT64_MAX), m_usecs_max(0), m_usecs_quad(0),
m_calls(0), m_depth(0)
{
m_time = Common::Timer::GetTimeUs();
s_max_length = std::max<u32>(s_max_length, u32(m_name.length()));
@@ -154,7 +154,7 @@ std::string Profiler::Read()
buffer << std::setw(PROFILER_FIELD_LENGTH) << std::right << m_usecs_max;
m_usecs = 0;
m_usecs_min = -1;
m_usecs_min = UINT64_MAX;
m_usecs_max = 0;
m_usecs_quad = 0;
m_calls = 0;
+9
View File
@@ -49,6 +49,11 @@
#include <unistd.h> // for unlink()
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4310)
#endif
/* Believe me, you *don't* want to change these constants !! */
#define BYTES_PER_SECTOR 512
#define RESERVED_SECTORS 32
@@ -289,3 +294,7 @@ FailWrite:
ERROR_LOG(COMMON, "unlink(%s) failed: %s", filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
+3 -6
View File
@@ -62,11 +62,8 @@ void SwitchCurrentThread()
}
// Sets the debugger-visible name of the current thread.
// Uses undocumented (actually, it is now documented) trick.
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp
// This is implemented much nicer in upcoming msvc++, see:
// http://msdn.microsoft.com/en-us/library/xcb2z8hs(VS.100).aspx
// Uses trick documented in:
// https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code
void SetCurrentThreadName(const char* szThreadName)
{
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
@@ -83,7 +80,7 @@ void SetCurrentThreadName(const char* szThreadName)
info.dwType = 0x1000;
info.szName = szThreadName;
info.dwThreadID = -1; // dwThreadID;
info.dwThreadID = static_cast<DWORD>(-1);
info.dwFlags = 0;
__try
+2 -1
View File
@@ -471,7 +471,8 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry>* ops)
std::transform(s.begin(), s.end(), s.begin(), toupper);
}
if ((ret = alphatobin(uCodes, vCodes, (int)vCodes.size())))
ret = alphatobin(uCodes, vCodes, (int)vCodes.size());
if (ret)
{
// Return value is index + 1, 0 being the success flag value.
PanicAlertT("Action Replay Code Decryption Error:\nParity Check Failed\n\nCulprit Code:\n%s",
+1 -1
View File
@@ -57,7 +57,7 @@ const ConfigInfo<bool> GFX_ENABLE_GPU_TEXTURE_DECODING{
const ConfigInfo<bool> GFX_ENABLE_PIXEL_LIGHTING{{System::GFX, "Settings", "EnablePixelLighting"},
false};
const ConfigInfo<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"}, true};
const ConfigInfo<int> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1};
const ConfigInfo<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1};
const ConfigInfo<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false};
const ConfigInfo<int> GFX_EFB_SCALE{{System::GFX, "Settings", "EFBScale"},
static_cast<int>(SCALE_1X)};
+1 -1
View File
@@ -47,7 +47,7 @@ extern const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS;
extern const ConfigInfo<bool> GFX_ENABLE_GPU_TEXTURE_DECODING;
extern const ConfigInfo<bool> GFX_ENABLE_PIXEL_LIGHTING;
extern const ConfigInfo<bool> GFX_FAST_DEPTH_CALC;
extern const ConfigInfo<int> GFX_MSAA;
extern const ConfigInfo<u32> GFX_MSAA;
extern const ConfigInfo<bool> GFX_SSAA;
extern const ConfigInfo<int> GFX_EFB_SCALE;
extern const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE;
+2 -2
View File
@@ -42,7 +42,7 @@ u32 CDump::GetGPR(int _step, int _gpr)
u32 offset = _step * STRUCTUR_SIZE;
if (offset >= m_size)
return -1;
return UINT32_MAX;
return Read32(offset + OFFSET_GPR + (_gpr * 4));
}
@@ -52,7 +52,7 @@ u32 CDump::GetPC(int _step)
u32 offset = _step * STRUCTUR_SIZE;
if (offset >= m_size)
return -1;
return UINT32_MAX;
return Read32(offset + OFFSET_PC);
}
+3 -1
View File
@@ -247,8 +247,10 @@ u32 UnPatch(const std::string& patch_name)
return addr;
}
for (const auto& symbol : g_symbolDB.GetSymbolsFromName(patch_name))
const auto& symbols = g_symbolDB.GetSymbolsFromName(patch_name);
if (symbols.size())
{
const auto& symbol = symbols[0];
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
{
s_original_instructions.erase(addr);
+1 -1
View File
@@ -63,7 +63,7 @@ protected:
CMailHandler& m_mail_handler;
enum EDSP_Codes
enum EDSP_Codes : u32
{
DSP_INIT = 0xDCD10000,
DSP_RESUME = 0xDCD10001,
+2 -2
View File
@@ -349,8 +349,8 @@ static void DTKStreamingCallback(const std::vector<u8>& audio_data, s64 cycles_l
// Determine which audio data to read next.
static const int MAXIMUM_SAMPLES = 48000 / 2000 * 7; // 3.5ms of 48kHz samples
u64 read_offset;
u32 read_length;
u64 read_offset = 0;
u32 read_length = 0;
if (s_stream && AudioInterface::IsPlaying())
{
read_offset = s_audio_position;
@@ -157,7 +157,7 @@ bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid)
if (adapter == INVALID_HANDLE_VALUE)
{
INFO_LOG(SP1, "Failed to open TAP at %s", device_path);
INFO_LOG(SP1, "Failed to open TAP at %s", device_path.c_str());
return false;
}
return true;
+10 -6
View File
@@ -20,14 +20,14 @@ template <typename T>
class ReadHandlingMethod
{
public:
virtual ~ReadHandlingMethod() {}
virtual ~ReadHandlingMethod() = default;
virtual void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const = 0;
};
template <typename T>
class WriteHandlingMethod
{
public:
virtual ~WriteHandlingMethod() {}
virtual ~WriteHandlingMethod() = default;
virtual void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const = 0;
};
@@ -39,7 +39,7 @@ class ConstantHandlingMethod : public ReadHandlingMethod<T>
{
public:
explicit ConstantHandlingMethod(T value) : value_(value) {}
virtual ~ConstantHandlingMethod() {}
virtual ~ConstantHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{
v.VisitConstant(value_);
@@ -62,7 +62,7 @@ class NopHandlingMethod : public WriteHandlingMethod<T>
{
public:
NopHandlingMethod() {}
virtual ~NopHandlingMethod() {}
virtual ~NopHandlingMethod() = default;
void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); }
};
template <typename T>
@@ -79,7 +79,7 @@ class DirectHandlingMethod : public ReadHandlingMethod<T>, public WriteHandlingM
{
public:
DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {}
virtual ~DirectHandlingMethod() {}
virtual ~DirectHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{
v.VisitDirect(addr_, mask_);
@@ -132,7 +132,7 @@ public:
{
}
virtual ~ComplexHandlingMethod() {}
virtual ~ComplexHandlingMethod() = default;
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
{
v.VisitComplex(&read_lambda_);
@@ -304,6 +304,8 @@ void ReadHandler<T>::ResetMethod(ReadHandlingMethod<T>* method)
struct FuncCreatorVisitor : public ReadHandlingMethodVisitor<T>
{
virtual ~FuncCreatorVisitor() = default;
std::function<T(u32)> ret;
void VisitConstant(T value) override
@@ -356,6 +358,8 @@ void WriteHandler<T>::ResetMethod(WriteHandlingMethod<T>* method)
struct FuncCreatorVisitor : public WriteHandlingMethodVisitor<T>
{
virtual ~FuncCreatorVisitor() = default;
std::function<void(u32, T)> ret;
void VisitNop() override

Some files were not shown because too many files have changed in this diff Show More