From ff3b22e1ff8a29fb70c06b5037f3d31f93b7ff14 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 30 Dec 2012 03:28:50 -0600 Subject: [PATCH 1/3] Clear up some warnings that crop up from -Wextra --- Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp | 2 +- Source/Core/Core/Src/HW/EXI_DeviceEthernet.h | 2 +- Source/Core/Core/Src/HW/EXI_DeviceIPL.h | 2 +- .../Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 6 +++--- Source/Core/VideoCommon/Src/VideoCommon.h | 17 +++++++---------- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp index 4197d01350..50c7de4cd2 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp @@ -290,7 +290,7 @@ bool CEXIETHERNET::IsWriteCommand(u32 const data) return IsMXCommand(data) ? !!(data & (1 << 30)) : !!(data & (1 << 14)); } -char const * const CEXIETHERNET::GetRegisterName() const +const char* CEXIETHERNET::GetRegisterName() const { #define STR_RETURN(x) case x: return #x; diff --git a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h index 6a3a552f38..0ee352eea5 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h @@ -297,7 +297,7 @@ public: bool IsMXCommand(u32 const data); bool IsWriteCommand(u32 const data); - char const * const GetRegisterName() const; + const char* GetRegisterName() const; void MXHardReset(); void MXCommandHandler(u32 data, u32 size); void DirectFIFOWrite(u8 *data, u32 size); diff --git a/Source/Core/Core/Src/HW/EXI_DeviceIPL.h b/Source/Core/Core/Src/HW/EXI_DeviceIPL.h index 4788f21adb..ed5cf0c922 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceIPL.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceIPL.h @@ -78,7 +78,7 @@ private: virtual void TransferByte(u8 &_uByte); bool IsWriteCommand() const { return !!(m_uAddress & (1 << 31)); } - u32 const CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; } + const u32 CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; } void LoadFileToIPL(std::string filename, u32 offset); }; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 6b490a1922..2061a106e0 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -196,7 +196,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) switch (Mode){ case 0: { - if (SeekPosition >=0 && SeekPosition <= fileSize) + if (SeekPosition <= fileSize) { m_SeekPos = SeekPosition; ReturnValue = m_SeekPos; @@ -206,7 +206,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) case 1: { u32 wantedPos = SeekPosition+m_SeekPos; - if (wantedPos >=0 && wantedPos <= fileSize) + if (wantedPos <= fileSize) { m_SeekPos = wantedPos; ReturnValue = m_SeekPos; @@ -216,7 +216,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress) case 2: { u64 wantedPos = fileSize+m_SeekPos; - if (wantedPos >=0 && wantedPos <= fileSize) + if (wantedPos <= fileSize) { m_SeekPos = wantedPos; ReturnValue = m_SeekPos; diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index f067fb9d6b..1eeed20b82 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -44,17 +44,14 @@ enum EFB_HEIGHT = 528, }; -enum -{ - // XFB width is decided by EFB copy operation. The VI can do horizontal - // scaling (TODO: emulate). - MAX_XFB_WIDTH = EFB_WIDTH, +// XFB width is decided by EFB copy operation. The VI can do horizontal +// scaling (TODO: emulate). +const u32 MAX_XFB_WIDTH = EFB_WIDTH; - // Although EFB height is 528, 574-line XFB's can be created either with - // vertical scaling by the EFB copy operation or copying to multiple XFB's - // that are next to each other in memory (TODO: handle that situation). - MAX_XFB_HEIGHT = 574 -}; +// Although EFB height is 528, 574-line XFB's can be created either with +// vertical scaling by the EFB copy operation or copying to multiple XFB's +// that are next to each other in memory (TODO: handle that situation). +const u32 MAX_XFB_HEIGHT = 574; // Logging // ---------- From 64afbade33f0c048472a214ef3841c6687eadeeb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 30 Dec 2012 04:32:37 -0600 Subject: [PATCH 2/3] Fix 4 warnings on OSX --- Source/Core/DolphinWX/Src/GLInterface/WX.cpp | 1 + Source/Plugins/Plugin_VideoSoftware/Src/EfbInterface.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/GLInterface/WX.cpp b/Source/Core/DolphinWX/Src/GLInterface/WX.cpp index 0db1f8d632..d5415c8ed9 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WX.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/WX.cpp @@ -50,6 +50,7 @@ bool cInterfaceWX::Create(void *&window_handle) GLWin.glCanvas->Show(true); if (GLWin.glCtxt == NULL) // XXX dirty hack GLWin.glCtxt = new wxGLContext(GLWin.glCanvas); + return true; } bool cInterfaceWX::MakeCurrent() diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/EfbInterface.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/EfbInterface.cpp index f2631c9238..6722ec7935 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/EfbInterface.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/EfbInterface.cpp @@ -355,7 +355,7 @@ namespace EfbInterface dstClr = (~srcClr) & dstClr; break; case 5: // noop - dstClr = dstClr; + // Do nothing break; case 6: // xor dstClr = srcClr ^ dstClr; From 71bb297f2cecc94ca6d045a877f0731e1507471f Mon Sep 17 00:00:00 2001 From: rog Date: Sun, 30 Dec 2012 06:48:37 -0500 Subject: [PATCH 3/3] Always count gc controller inputs. --- Source/Core/Core/Src/HW/SI_DeviceGCController.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp index 74c020fd39..8c4c562b82 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp @@ -132,14 +132,12 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) if(Movie::IsPlayingInput()) { Movie::PlayController(&PadStatus, ISIDevice::m_iDeviceNumber); - if(!Movie::IsUsingWiimote(0)) - Movie::InputUpdate(); + Movie::InputUpdate(); } else if(Movie::IsRecordingInput()) { Movie::RecordInput(&PadStatus, ISIDevice::m_iDeviceNumber); - if(!Movie::IsUsingWiimote(0)) - Movie::InputUpdate(); + Movie::InputUpdate(); } else Movie::CheckPadStatus(&PadStatus, ISIDevice::m_iDeviceNumber);