From: notaz Date: Mon, 16 Aug 2021 22:09:20 +0000 (+0300) Subject: deal with some more annoying warnings X-Git-Tag: r23~141 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cf51e0893f3646f4f6217b9701c0ab199d8a6ac;p=pcsx_rearmed.git deal with some more annoying warnings Especially main.c as it's regenerated after each commit. --- diff --git a/libpcsxcore/debug.c b/libpcsxcore/debug.c index 763dc453..d7b2d21e 100644 --- a/libpcsxcore/debug.c +++ b/libpcsxcore/debug.c @@ -20,6 +20,11 @@ #include "debug.h" #include "socket.h" +// XXX: don't care but maybe fix it someday +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic ignored "-Wrestrict" +#endif + /* PCSX Debug console protocol description, version 1.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/libpcsxcore/disr3000a.c b/libpcsxcore/disr3000a.c index 23667c1a..a350da1a 100644 --- a/libpcsxcore/disr3000a.c +++ b/libpcsxcore/disr3000a.c @@ -23,6 +23,11 @@ #include "psxcommon.h" +// XXX: don't care but maybe fix it someday +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic ignored "-Wrestrict" +#endif + char ostr[256]; // Names of registers diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index e6d8a11e..0423310b 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -779,11 +779,11 @@ void ReleasePlugins() { if (Config.UseNet && hNETDriver != NULL) NET_shutdown(); - if (hCDRDriver != NULL) SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; - if (hGPUDriver != NULL) SysCloseLibrary(hGPUDriver); hGPUDriver = NULL; - if (hSPUDriver != NULL) SysCloseLibrary(hSPUDriver); hSPUDriver = NULL; - if (hPAD1Driver != NULL) SysCloseLibrary(hPAD1Driver); hPAD1Driver = NULL; - if (hPAD2Driver != NULL) SysCloseLibrary(hPAD2Driver); hPAD2Driver = NULL; + if (hCDRDriver != NULL) { SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; } + if (hGPUDriver != NULL) { SysCloseLibrary(hGPUDriver); hGPUDriver = NULL; } + if (hSPUDriver != NULL) { SysCloseLibrary(hSPUDriver); hSPUDriver = NULL; } + if (hPAD1Driver != NULL) { SysCloseLibrary(hPAD1Driver); hPAD1Driver = NULL; } + if (hPAD2Driver != NULL) { SysCloseLibrary(hPAD2Driver); hPAD2Driver = NULL; } if (Config.UseNet && hNETDriver != NULL) { SysCloseLibrary(hNETDriver); hNETDriver = NULL; @@ -802,7 +802,7 @@ void ReleasePlugins() { int ReloadCdromPlugin() { if (hCDRDriver != NULL || cdrIsoActive()) CDR_shutdown(); - if (hCDRDriver != NULL) SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; + if (hCDRDriver != NULL) { SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; } if (UsingIso()) { LoadCDRplugin(NULL); diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index ecd4264d..8d4cb27f 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -35,6 +35,10 @@ #include "gpu.h" #include +#if (defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wpointer-sign" +#endif + #undef SysPrintf #define SysPrintf if (Config.PsxOut) printf @@ -2090,8 +2094,6 @@ static void buopen(int mcd, u8 *ptr, u8 *cfg) */ void psxBios_open() { // 0x32 - int i; - char *ptr; void *pa0 = Ra0; #ifdef PSXBIOS_LOG diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index 9f5444ec..8ef794b1 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -31,6 +31,13 @@ extern "C" { #include "config.h" +// XXX: don't care but maybe fix it someday +#if defined(__GNUC__) && __GNUC__ >= 8 +#pragma GCC diagnostic ignored "-Wformat-truncation" +#pragma GCC diagnostic ignored "-Wformat-overflow" +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif + // System includes #include #include diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 35823dac..6b9e2b7a 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -64,7 +64,6 @@ static const u32 HSyncTotal[] = { 263, 313 }; #define VBlankStart 240 #define VERBOSE_LEVEL 0 -static const s32 VerboseLevel = VERBOSE_LEVEL; /******************************************************************************/ @@ -89,7 +88,7 @@ static void verboseLog( u32 level, const char *str, ... ) { #if VERBOSE_LEVEL > 0 - if( level <= VerboseLevel ) + if( level <= VERBOSE_LEVEL ) { va_list va; char buf[ 4096 ];