From 6dff0b13a4a3a124ca5dd44175f1ee7ee656cf9a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 4 Jul 2014 22:11:13 -0400 Subject: [PATCH 1/4] Core: Remove some unused variables --- pcsx2/CDVD/CDVD.cpp | 1 - pcsx2/DebugTools/DisR5900asm.cpp | 3 --- 2 files changed, 4 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index e976d7811b..c071959a34 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -502,7 +502,6 @@ s32 cdvdReadSubQ(s32 lsn, cdvdSubQ* subq) static void cdvdDetectDisk() { - wxString str; cdvd.Type = DoCDVDdetectDiskType(); cdvdReloadElfInfo(); } diff --git a/pcsx2/DebugTools/DisR5900asm.cpp b/pcsx2/DebugTools/DisR5900asm.cpp index ecef2735ef..01dd2b27dc 100644 --- a/pcsx2/DebugTools/DisR5900asm.cpp +++ b/pcsx2/DebugTools/DisR5900asm.cpp @@ -607,9 +607,6 @@ void (*COP2SPECIAL2PrintTable[128])( string& output ) = void disR5900Fasm( string& output, u32 code, u32 pc ) { - string dbuf; - char obuf[48]; - opcode_addr = pc; disasmOpcode = code; From 1bc3f346b1b24f85659ed29b6ba9eadc2590e1fe Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sat, 5 Jul 2014 04:36:48 -0500 Subject: [PATCH 2/4] Fix HostSys::Munmap function declaration. It's arguments are defined to be (void*, size_t) but with the function declaration they were (void*, u32). --- common/src/Utilities/AlignedMalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/Utilities/AlignedMalloc.cpp b/common/src/Utilities/AlignedMalloc.cpp index 06ff8bd989..2a56355c4d 100644 --- a/common/src/Utilities/AlignedMalloc.cpp +++ b/common/src/Utilities/AlignedMalloc.cpp @@ -95,7 +95,7 @@ __fi void _memset16_unaligned( void* dest, u16 data, size_t size ) *dst = data; } -__fi void HostSys::Munmap( void* base, u32 size ) +__fi void HostSys::Munmap( void* base, size_t size ) { Munmap( (uptr)base, size ); } From 08ef4bfbff5bc35f3b0821492af4dc0db3608acb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sat, 5 Jul 2014 04:39:55 -0500 Subject: [PATCH 3/4] Wipe the clusterfsck that was the get16bits define in HashTools. This define takes a pointer(s8* in this case) and grabs 16bits of data from the array it points to. This can be done the generic way on all compilers, no need for specifying it another way. --- common/src/Utilities/HashTools.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/common/src/Utilities/HashTools.cpp b/common/src/Utilities/HashTools.cpp index c5c3ad3061..8ffdb0255e 100644 --- a/common/src/Utilities/HashTools.cpp +++ b/common/src/Utilities/HashTools.cpp @@ -29,16 +29,7 @@ namespace HashTools { /// const CommonHashClass GetCommonHash; -#undef get16bits -#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ - || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const u16 *) (d))) -#endif - -#if !defined (get16bits) -#define get16bits(d) ((((u32)(((const ubyte *)(d))[1])) << 8)\ - +(u32)(((const ubyte *)(d))[0]) ) -#endif /// /// Calculates a hash value for an arbitrary set of binary data. From 182e826dc5f5e097ccea540fd6aaf6132ad95a43 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sat, 5 Jul 2014 04:59:31 -0500 Subject: [PATCH 4/4] Fix SpatialArrayReserve::SetBlockSize function declaration to match definition. The function was defined to use uptr, but the declaration was using uint. --- common/src/Utilities/VirtualMemory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/Utilities/VirtualMemory.cpp b/common/src/Utilities/VirtualMemory.cpp index 2e8742354e..a0cfb50c41 100644 --- a/common/src/Utilities/VirtualMemory.cpp +++ b/common/src/Utilities/VirtualMemory.cpp @@ -455,7 +455,7 @@ SpatialArrayReserve& SpatialArrayReserve::SetBlockSizeInPages( uint pages ) // // This method must be called prior to accessing or modifying the array contents. Calls to // a modified buffer will be ignored (and generate an assertion in dev/debug modes). -uint SpatialArrayReserve::SetBlockSize( uint bytes ) +uptr SpatialArrayReserve::SetBlockSize( uptr bytes ) { SetBlockSizeInPages((bytes + __pagesize - 1) / __pagesize); return m_blocksize * __pagesize;