From cfb47e2e1938245bf314ce934aef3166c20ce85a Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Thu, 6 Jan 2011 12:25:01 +0000 Subject: [PATCH] Ran Cppcheck on SPU2-X, fixed a few things it found. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4179 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/PS2E-spu2.cpp | 3 +-- plugins/spu2-x/src/Windows/ConfigDebug.cpp | 3 +-- plugins/spu2-x/src/Windows/ConfigSoundtouch.cpp | 3 +-- plugins/spu2-x/src/Windows/SndOut_waveOut.cpp | 1 - plugins/spu2-x/src/Windows/UIHelpers.cpp | 4 ++-- plugins/spu2-x/src/spu2sys.cpp | 9 --------- 6 files changed, 5 insertions(+), 18 deletions(-) diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 2f88f52d92..71c2acf909 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -371,7 +371,7 @@ extern HWND hDebugDialog; static BOOL CALLBACK DebugProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { - int wmId,wmEvent; + int wmId; switch(uMsg) { @@ -385,7 +385,6 @@ static BOOL CALLBACK DebugProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) case WM_COMMAND: wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { diff --git a/plugins/spu2-x/src/Windows/ConfigDebug.cpp b/plugins/spu2-x/src/Windows/ConfigDebug.cpp index 45293c4d76..23abbff2c2 100644 --- a/plugins/spu2-x/src/Windows/ConfigDebug.cpp +++ b/plugins/spu2-x/src/Windows/ConfigDebug.cpp @@ -177,7 +177,7 @@ void EnableControls( HWND hWnd ) static BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { - int wmId,wmEvent; + int wmId; //wchar_t temp[384]={0}; switch(uMsg) @@ -211,7 +211,6 @@ static BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) case WM_COMMAND: wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { diff --git a/plugins/spu2-x/src/Windows/ConfigSoundtouch.cpp b/plugins/spu2-x/src/Windows/ConfigSoundtouch.cpp index b4f243387b..4cbee56144 100644 --- a/plugins/spu2-x/src/Windows/ConfigSoundtouch.cpp +++ b/plugins/spu2-x/src/Windows/ConfigSoundtouch.cpp @@ -66,7 +66,7 @@ void SoundtouchCfg::WriteSettings() BOOL CALLBACK SoundtouchCfg::DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { - int wmId,wmEvent; + int wmId; //wchar_t temp[384]={0}; switch(uMsg) @@ -87,7 +87,6 @@ BOOL CALLBACK SoundtouchCfg::DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM case WM_COMMAND: wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); // Parse the menu selections: if( wmId == IDOK ) { diff --git a/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp b/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp index 0ba241d5f5..fa1c36f977 100644 --- a/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp +++ b/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp @@ -205,7 +205,6 @@ private: static BOOL CALLBACK ConfigProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { int wmId,wmEvent; - int tSel=0; switch(uMsg) { diff --git a/plugins/spu2-x/src/Windows/UIHelpers.cpp b/plugins/spu2-x/src/Windows/UIHelpers.cpp index 9bb0d2cc41..2e1be74ca7 100644 --- a/plugins/spu2-x/src/Windows/UIHelpers.cpp +++ b/plugins/spu2-x/src/Windows/UIHelpers.cpp @@ -29,7 +29,7 @@ HRESULT GUIDFromString(const char *str, LPGUID guid) struct T{ // this is a hack because for some reason sscanf writes too much :/ GUID g; - int k; + int k; // << not used but still needed as of January 6th, 2011 } t; int r = sscanf_s(str,"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", @@ -83,7 +83,7 @@ BOOL DoHandleScrollMessage( HWND hwndDisplay, WPARAM wParam, LPARAM lParam ) { int wmId = LOWORD(wParam); int wmEvent = HIWORD(wParam); - static char temp[64]; + switch(wmId) { //case TB_ENDTRACK: diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index 4952845210..3fbb740937 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -449,18 +449,9 @@ __forceinline void TimeUpdate(u32 cClocks) } } -static u16 mask = 0xFFFF; - __forceinline void UpdateSpdifMode() { int OPM=PlayMode; - u16 last = 0; - - if(mask&Spdif.Out) - { - last = mask & Spdif.Out; - mask=mask&(~Spdif.Out); - } if(Spdif.Out&0x4) // use 24/32bit PCM data streaming {