From fd5eec01f16990a3564e16421c7ce307c674dd45 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Thu, 17 Nov 2011 20:49:47 +0000 Subject: Patch 10831 from Durandal_1707: This should bring the number of warnings when compiling the Mac version with Clang and the -Wall option down to zero. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72386 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/cdrom.c | 47 +++++++++++++++++++++++++++++------------------ plugins/dfsound/openal.c | 15 ++++++++------- plugins/dfsound/spu.c | 2 ++ plugins/dfsound/stdafx.h | 6 ++++++ plugins/dfsound/xa.c | 4 ++-- plugins/dfxvideo/zn.c | 2 +- plugins/peopsxgl/draw.h | 1 + 7 files changed, 49 insertions(+), 28 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 889beb9a..055a15a0 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -135,6 +135,20 @@ extern long CALLBACK ISOinit(void); extern void CALLBACK SPUirq(void); extern SPUregisterCallback SPU_registerCallback; +// A bit of a kludge, but it will get rid of the "macro redefined" warnings + +#ifdef H_SPUirqAddr +#undef H_SPUirqAddr +#endif + +#ifdef H_SPUaddr +#undef H_SPUaddr +#endif + +#ifdef H_SPUctrl +#undef H_SPUctrl +#endif + #define H_SPUirqAddr 0x1f801da4 #define H_SPUaddr 0x1f801da6 #define H_SPUctrl 0x1f801daa @@ -2318,13 +2332,12 @@ void psxDma3(u32 madr, u32 bcr, u32 chcr) { /* #if 1 - /* - GS CDX: Enhancement CD crash - - Setloc 0:0:0 - - CdlPlay - - Spams DMA3 and gets buffer overrun - */ -/* + + // GS CDX: Enhancement CD crash + // - Setloc 0:0:0 + // - CdlPlay + // - Spams DMA3 and gets buffer overrun + if( (cdr.pTransfer-cdr.Transfer) + cdsize > 2352 ) { // avoid crash - probably should wrap here @@ -2355,17 +2368,15 @@ void psxDma3(u32 madr, u32 bcr, u32 chcr) { } else { int lcv; - /* - CDROM wrapping - - Ape Escape - used several times - Gameshark Lite - opening movie - - Gameshark CDX: enhancement CD patcher - - calls CdlPlay @ 0:2:0 - - spams DMA3 and overruns buffer - */ -/* + // CDROM wrapping + // + // Ape Escape - used several times + // Gameshark Lite - opening movie + // + // Gameshark CDX: enhancement CD patcher + // - calls CdlPlay @ 0:2:0 + // - spams DMA3 and overruns buffer + for( lcv = 0; lcv < cdsize; lcv++ ) { // wrap cdrom ptr diff --git a/plugins/dfsound/openal.c b/plugins/dfsound/openal.c index ccc40dcf..05076b4d 100755 --- a/plugins/dfsound/openal.c +++ b/plugins/dfsound/openal.c @@ -72,8 +72,9 @@ static ALfloat ListenerOri[] = {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}; static ALenum format = AL_FORMAT_STEREO16; static ALuint sampleRate = 44100; -static ALuint sampleQuality = 16; -static ALuint channels = 2; + +static ALuint UNUSED_VARIABLE sampleQuality = 16; +static ALuint UNUSED_VARIABLE channels = 2; /******************************************************************************/ /* Error handling. @@ -161,10 +162,10 @@ void SetupSound() } // ALC info. - const ALCubyte* deviceName = (ALCubyte*)alcGetString(pDevice, ALC_DEVICE_SPECIFIER); + const ALCubyte* UNUSED_VARIABLE deviceName = (ALCubyte*)alcGetString(pDevice, ALC_DEVICE_SPECIFIER); //printf("[SPU] ALC_DEVICE_SPECIFIER = %s.\n", deviceName); - const ALCubyte* extensionList = (ALCubyte*)alcGetString(pDevice, ALC_EXTENSIONS); + const ALCubyte* UNUSED_VARIABLE extensionList = (ALCubyte*)alcGetString(pDevice, ALC_EXTENSIONS); //printf("[SPU] ALC_EXTENSIONS = %s.\n", extensionList); // Create audio context. @@ -184,13 +185,13 @@ void SetupSound() } // AL info. - const ALubyte* version = (ALubyte*)alGetString(AL_VERSION); + const ALubyte* UNUSED_VARIABLE version = (ALubyte*)alGetString(AL_VERSION); //printf("[SPU] AL_VERSION = %s.\n", version); - const ALubyte* renderer = (ALubyte*)alGetString(AL_RENDERER); + const ALubyte* UNUSED_VARIABLE renderer = (ALubyte*)alGetString(AL_RENDERER); //printf("[SPU] AL_RENDERER = %s.\n", renderer); - const ALubyte* vendor = (ALubyte*)alGetString(AL_VENDOR); + const ALubyte* UNUSED_VARIABLE vendor = (ALubyte*)alGetString(AL_VENDOR); //printf("[SPU] AL_VENDOR = %s.\n", vendor); // Create buffers. diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index e21a6629..55a2d38f 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -27,6 +27,8 @@ #ifdef _WINDOWS #include "debug.h" #include "record.h" +#elif defined(_MACOSX) +#include "maccfg.h" #endif #ifdef ENABLE_NLS diff --git a/plugins/dfsound/stdafx.h b/plugins/dfsound/stdafx.h index 15ad99fa..812ebb9d 100644 --- a/plugins/dfsound/stdafx.h +++ b/plugins/dfsound/stdafx.h @@ -65,4 +65,10 @@ #endif +#if defined (__GNUC__) || defined (__clang__) +#define UNUSED_VARIABLE __attribute__((unused)) +#else +#define UNUSED_VARIABLE +#endif + #include "psemuxa.h" diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c index 6dd689be..1becc903 100644 --- a/plugins/dfsound/xa.c +++ b/plugins/dfsound/xa.c @@ -45,8 +45,8 @@ uint32_t * CDDAEnd = NULL; int iLeftXAVol = 0x8000; int iRightXAVol = 0x8000; -static int gauss_ptr = 0; -static int gauss_window[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +static int UNUSED_VARIABLE gauss_ptr = 0; +static int UNUSED_VARIABLE gauss_window[8] = {0, 0, 0, 0, 0, 0, 0, 0}; #define gvall0 gauss_window[gauss_ptr] #define gvall(x) gauss_window[(gauss_ptr+x)&3] diff --git a/plugins/dfxvideo/zn.c b/plugins/dfxvideo/zn.c index 38b906ba..c4de91a1 100644 --- a/plugins/dfxvideo/zn.c +++ b/plugins/dfxvideo/zn.c @@ -72,7 +72,7 @@ int iTileCheat=0; typedef struct GPUOTAG { uint32_t Version; // Version of structure - currently 1 - long hWnd; // Window handle + unsigned long hWnd; // Window handle uint32_t ScreenRotation; // 0 = 0CW, 1 = 90CW, 2 = 180CW, 3 = 270CW = 90CCW uint32_t GPUVersion; // 0 = a, 1 = b, 2 = c const char* GameName; // NULL terminated string diff --git a/plugins/peopsxgl/draw.h b/plugins/peopsxgl/draw.h index 82f920db..e561c996 100644 --- a/plugins/peopsxgl/draw.h +++ b/plugins/peopsxgl/draw.h @@ -50,6 +50,7 @@ void SetOGLDisplaySettings (BOOL DisplaySet); void ReadConfig(void); void WriteConfig(void); void SetExtGLFuncs(void); +void CreateScanLines(void); /////////////////////////////////////////////////////////////////////// -- cgit v1.2.3