diff --git a/Utilities/rFile.cpp b/Utilities/rFile.cpp index e6f657d39e..39fa91eceb 100644 --- a/Utilities/rFile.cpp +++ b/Utilities/rFile.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Log.h" +#pragma warning(disable : 4996) #include #include #include diff --git a/Utilities/rMsgBox.cpp b/Utilities/rMsgBox.cpp index cd3a46be0d..cf4c027096 100644 --- a/Utilities/rMsgBox.cpp +++ b/Utilities/rMsgBox.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "restore_new.h" +#pragma warning(disable : 4996) #include #include "define_new_memleakdetect.h" #include "rMsgBox.h" diff --git a/Utilities/rPlatform.cpp b/Utilities/rPlatform.cpp index a947b7a00f..57a32e1425 100644 --- a/Utilities/rPlatform.cpp +++ b/Utilities/rPlatform.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "restore_new.h" +#pragma warning(disable : 4996) #include #include "define_new_memleakdetect.h" diff --git a/Utilities/rTime.cpp b/Utilities/rTime.cpp index fccb0ac7df..194394317c 100644 --- a/Utilities/rTime.cpp +++ b/Utilities/rTime.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "rTime.h" - +#pragma warning(disable : 4996) #include std::string rDefaultDateTimeFormat = "%c"; diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 65e1d3e394..b4d18eb92d 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -5,6 +5,7 @@ #include "key_vault.h" #include "unpkg.h" #include "restore_new.h" +#pragma warning(disable : 4996) #include #include "define_new_memleakdetect.h" diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index 28b464c100..954f29eb22 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -6,7 +6,7 @@ #include "utils.h" #include "Emu/FS/vfsLocalFile.h" #include "unself.h" - +#pragma warning(disable : 4996) #include #include diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.cpp index e8155b89a3..adcb26a2a6 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.cpp @@ -15,7 +15,7 @@ void XAudio2Thread::Init() { HRESULT hr = S_OK; -#if (_WIN32_WINNT < 0x0602) +#if (FORCED_WINVER < 0x0602) hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr)) { @@ -53,7 +53,7 @@ void XAudio2Thread::Quit() m_xaudio2_instance->Release(); m_xaudio2_instance = nullptr; -#if (_WIN32_WINNT < 0x0602) +#if (FORCED_WINVER < 0x0602) CoUninitialize(); #endif } diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.h b/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.h index 3a362714ad..3771f7bd3e 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.h +++ b/rpcs3/Emu/Audio/XAudio2/XAudio2Thread.h @@ -4,10 +4,9 @@ #if defined (_WIN32) // forced define Win7, delete this for using XAudio2 2.8 -#define WINVER 0x0601 -#define _WIN32_WINNT 0x0601 +#define FORCED_WINVER 0x0601 -#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) +#if (FORCED_WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) #include #pragma comment(lib,"xaudio2.lib") #else diff --git a/rpcs3/Emu/CPU/CPUDecoder.h b/rpcs3/Emu/CPU/CPUDecoder.h index 0a0aea1e0c..68f21cf542 100644 --- a/rpcs3/Emu/CPU/CPUDecoder.h +++ b/rpcs3/Emu/CPU/CPUDecoder.h @@ -1,6 +1,5 @@ #pragma once #include "CPUInstrTable.h" -#pragma warning( disable : 4800 ) class CPUDecoder { diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index f65cfbdcb2..11feecb3ef 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -325,7 +325,7 @@ vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const path = m_devices[max_i]->GetLocalPath(); - for (u32 i = max_eq; i < ps3_path_blocks.size(); i++) + for (size_t i = max_eq; i < ps3_path_blocks.size(); i++) { path += "/" + ps3_path_blocks[i]; } @@ -382,7 +382,7 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) path = m_devices[max_i]->GetPs3Path(); - for (u32 i = max_eq; i < local_path_blocks.size(); i++) + for (size_t i = max_eq; i < local_path_blocks.size(); i++) { path += "/" + local_path_blocks[i]; } diff --git a/rpcs3/Emu/FS/vfsStreamMemory.cpp b/rpcs3/Emu/FS/vfsStreamMemory.cpp index f385a4ecb3..5ce30c3a7c 100644 --- a/rpcs3/Emu/FS/vfsStreamMemory.cpp +++ b/rpcs3/Emu/FS/vfsStreamMemory.cpp @@ -6,15 +6,15 @@ vfsStreamMemory::vfsStreamMemory() : vfsStream() { } -vfsStreamMemory::vfsStreamMemory(u64 addr, u64 size) : vfsStream() +vfsStreamMemory::vfsStreamMemory(u32 addr, u32 size) : vfsStream() { Open(addr, size); } -void vfsStreamMemory::Open(u64 addr, u64 size) +void vfsStreamMemory::Open(u32 addr, u32 size) { m_addr = addr; - m_size = size ? size : ~0ULL; + m_size = size ? size : 0x100000000ull - addr; // determine max possible size vfsStream::Reset(); } @@ -26,24 +26,24 @@ u64 vfsStreamMemory::GetSize() u64 vfsStreamMemory::Write(const void* src, u64 size) { - if(Tell() + size > GetSize()) + assert(Tell() < m_size); + if (Tell() + size > m_size) { - size = GetSize() - Tell(); + size = m_size - Tell(); } - memcpy(vm::get_ptr(m_addr + Tell()), src, size); - + memcpy(vm::get_ptr(vm::cast(m_addr + Tell())), src, size); return vfsStream::Write(src, size); } u64 vfsStreamMemory::Read(void* dst, u64 size) { - if(Tell() + size > GetSize()) + assert(Tell() < GetSize()); + if (Tell() + size > GetSize()) { size = GetSize() - Tell(); } - memcpy(dst, vm::get_ptr(m_addr + Tell()), size); - + memcpy(dst, vm::get_ptr(vm::cast(m_addr + Tell())), size); return vfsStream::Read(dst, size); } diff --git a/rpcs3/Emu/FS/vfsStreamMemory.h b/rpcs3/Emu/FS/vfsStreamMemory.h index 00cb675013..1e3e06a73b 100644 --- a/rpcs3/Emu/FS/vfsStreamMemory.h +++ b/rpcs3/Emu/FS/vfsStreamMemory.h @@ -3,14 +3,14 @@ struct vfsStreamMemory : public vfsStream { - u64 m_addr; + u32 m_addr; u64 m_size; public: vfsStreamMemory(); - vfsStreamMemory(u64 addr, u64 size = 0); + vfsStreamMemory(u32 addr, u32 size = 0); - void Open(u64 addr, u64 size = 0); + void Open(u32 addr, u32 size = 0); virtual u64 GetSize() override; diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 825c1c4007..66792d0ea4 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -14,6 +14,8 @@ #endif // This header should be frontend-agnostic, so don't assume wx includes everything +#pragma warning( disable : 4800 ) + #include #include #include