From 857275a93c8e222bc800999f08d4b42e327f4c1b Mon Sep 17 00:00:00 2001
From: notaz <notasas@gmail.com>
Date: Sun, 31 Oct 2021 14:40:30 +0200
Subject: [PATCH] assorted warning fixes

---
 Makefile                     |  6 ++++++
 frontend/menu.c              | 11 ++++++-----
 libpcsxcore/psxbios.c        |  6 +++---
 libpcsxcore/psxhle.c         |  2 +-
 libpcsxcore/psxhle.h         |  2 +-
 plugins/dfxvideo/gpulib_if.c |  4 ++++
 plugins/gpu-gles/gpuDraw.c   |  8 ++++----
 7 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 0998f586..e3b90998 100644
--- a/Makefile
+++ b/Makefile
@@ -290,6 +290,12 @@ endif
 
 .PHONY: all clean target_ plugins_ clean_plugins FORCE
 
+ifneq "$(PLATFORM)" "pandora"
+ifdef CPATH
+$(warning warning: CPATH is defined)
+endif
+endif
+
 # ----------- release -----------
 
 VER ?= $(shell git describe HEAD)
diff --git a/frontend/menu.c b/frontend/menu.c
index 05dde461..37956ffe 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -1256,10 +1256,11 @@ static const char h_scaler[]    = "int. 2x  - scales w. or h. 2x if it fits on s
 				  "int. 4:3 - uses integer if possible, else fractional";
 static const char h_cscaler[]   = "Displays the scaler layer, you can resize it\n"
 				  "using d-pad or move it using R+d-pad";
-static const char h_overlay[]   = "Overlay provides hardware accelerated scaling";
 static const char h_soft_filter[] = "Works only if game uses low resolution modes";
-static const char h_scanline_l[]  = "Scanline brightness, 0-100%";
 static const char h_gamma[]     = "Gamma/brightness adjustment (default 100)";
+#ifdef __ARM_NEON__
+static const char h_scanline_l[]  = "Scanline brightness, 0-100%";
+#endif
 
 static int menu_loop_cscaler(int id, int keys)
 {
@@ -1579,10 +1580,10 @@ static const char h_cfg_fl[]     = "Frame Limiter keeps the game from running to
 static const char h_cfg_xa[]     = "Disables XA sound, which can sometimes improve performance";
 static const char h_cfg_cdda[]   = "Disable CD Audio for a performance boost\n"
 				   "(proper .cue/.bin dump is needed otherwise)";
-static const char h_cfg_sio[]    = "You should not need this, breaks games";
+//static const char h_cfg_sio[]    = "You should not need this, breaks games";
 static const char h_cfg_spuirq[] = "Compatibility tweak; should be left off";
-static const char h_cfg_rcnt1[]  = "Parasite Eve 2, Vandal Hearts 1/2 Fix\n"
-				   "(timing hack, breaks other games)";
+//static const char h_cfg_rcnt1[]  = "Parasite Eve 2, Vandal Hearts 1/2 Fix\n"
+//				   "(timing hack, breaks other games)";
 static const char h_cfg_rcnt2[]  = "InuYasha Sengoku Battle Fix\n"
 				   "(timing hack, breaks other games)";
 static const char h_cfg_nodrc[]  = "Disable dynamic recompiler and use interpreter\n"
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index ed95b06f..a0588be9 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -2032,10 +2032,10 @@ void psxBios_UnDeliverEvent() { // 0x20
 
 char ffile[64], *pfile;
 int nfile;
-static void buopen(int mcd, u8 *ptr, u8 *cfg)
+static void buopen(int mcd, char *ptr, char *cfg)
 {
 	int i;
-	u8 *fptr = ptr;
+	char *fptr = ptr;
 
 	strcpy(FDesc[1 + mcd].name, Ra0+5);
 	FDesc[1 + mcd].offset = 0;
@@ -2066,7 +2066,7 @@ static void buopen(int mcd, u8 *ptr, u8 *cfg)
 			fptr[6] = 0x00;
 			fptr[7] = 0x00;
 			strcpy(fptr+0xa, FDesc[1 + mcd].name);
-			pptr = fptr2 = fptr;
+			pptr = fptr2 = (u8 *)fptr;
 			for(j=2; j<=nblk; j++) {
 				int k;
 				for(i++; i<16; i++) {
diff --git a/libpcsxcore/psxhle.c b/libpcsxcore/psxhle.c
index 52227a40..064d4011 100644
--- a/libpcsxcore/psxhle.c
+++ b/libpcsxcore/psxhle.c
@@ -89,7 +89,7 @@ static void hleExecRet() {
 	psxRegs.pc = psxRegs.GPR.n.ra;
 }
 
-const void (*psxHLEt[8])() = {
+void (* const psxHLEt[])() = {
 	hleDummy, hleA0, hleB0, hleC0,
 	hleBootstrap, hleExecRet,
 	hleDummy, hleDummy
diff --git a/libpcsxcore/psxhle.h b/libpcsxcore/psxhle.h
index 0529c389..04126345 100644
--- a/libpcsxcore/psxhle.h
+++ b/libpcsxcore/psxhle.h
@@ -28,7 +28,7 @@ extern "C" {
 #include "r3000a.h"
 #include "plugins.h"
 
-extern const void (*psxHLEt[8])();
+extern void (* const psxHLEt[8])();
 
 #ifdef __cplusplus
 }
diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c
index 01b8dde2..ff0c96c7 100644
--- a/plugins/dfxvideo/gpulib_if.c
+++ b/plugins/dfxvideo/gpulib_if.c
@@ -260,6 +260,10 @@ unsigned short sSetMask = 0;
 unsigned long  lSetMask = 0;
 long           lLowerpart;
 
+#if defined(__GNUC__) && __GNUC__ >= 6
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
 #include "soft.c"
 #include "prim.c"
 
diff --git a/plugins/gpu-gles/gpuDraw.c b/plugins/gpu-gles/gpuDraw.c
index 34d1c3bd..c49eac5f 100644
--- a/plugins/gpu-gles/gpuDraw.c
+++ b/plugins/gpu-gles/gpuDraw.c
@@ -291,7 +291,7 @@ bool TestEGLError(const char* pszLocation)
 	EGLint iErr = eglGetError();
 	if (iErr != EGL_SUCCESS)
 	{
-		printf("%s failed (0x%x).\n", pszLocation, iErr);
+		printf("%s failed (0x%x).\n", pszLocation, (int)iErr);
 		return FALSE;
 	}
 
@@ -572,7 +572,7 @@ void GLcleanup()
 //              real psx polygon coord mapping right... the following
 //              works not to bad with many games, though
 
-__inline BOOL CheckCoord4()
+static __inline BOOL CheckCoord4()
 {
  if(lx0<0)
   {
@@ -638,7 +638,7 @@ __inline BOOL CheckCoord4()
  return FALSE;
 }
 
-__inline BOOL CheckCoord3()
+static __inline BOOL CheckCoord3()
 {
  if(lx0<0)
   {
@@ -675,7 +675,7 @@ __inline BOOL CheckCoord3()
 }
 
 
-__inline BOOL CheckCoord2()
+static __inline BOOL CheckCoord2()
 {
  if(lx0<0)
   {
-- 
2.39.5