changeset 640:f26682a2825b trunk

[svn] Addresses most of the warnings in the code, and uses a -W CFLAG to disable the non-null checks. From external contributor Harald van Dijk (Gentoo).
author chainsaw
date Sat, 18 Feb 2006 16:15:16 -0800
parents 9d2c175e458e
children 76ebe33bb152
files Plugins/Input/sexypsf/Makefile.in Plugins/Input/sexypsf/Misc.c Plugins/Input/sexypsf/PsxMem.c Plugins/Input/sexypsf/PsxMem.h
diffstat 4 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/sexypsf/Makefile.in	Sat Feb 18 14:02:57 2006 -0800
+++ b/Plugins/Input/sexypsf/Makefile.in	Sat Feb 18 16:15:16 2006 -0800
@@ -23,4 +23,4 @@
 
 OBJECTS = ${SOURCES:.c=.o}
 
-CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) -I../../../intl -I../../.. -Ispu/ -I.
+CFLAGS += -Wno-nonnull -fPIC -DPIC $(GTK_CFLAGS) -I../../../intl -I../../.. -Ispu/ -I.
--- a/Plugins/Input/sexypsf/Misc.c	Sat Feb 18 14:02:57 2006 -0800
+++ b/Plugins/Input/sexypsf/Misc.c	Sat Feb 18 16:15:16 2006 -0800
@@ -226,7 +226,7 @@
 {
         FILE *fp;
         EXE_HEADER tmpHead;
-        char *in,*out=0;
+        unsigned char *in,*out=0;
 	u8 head[4];
         u32 reserved;
         u32 complen;
--- a/Plugins/Input/sexypsf/PsxMem.c	Sat Feb 18 14:02:57 2006 -0800
+++ b/Plugins/Input/sexypsf/PsxMem.c	Sat Feb 18 16:15:16 2006 -0800
@@ -21,7 +21,7 @@
 
 #include "PsxCommon.h"
 
-void LoadPSXMem(u32 address, s32 length, char *data)
+void LoadPSXMem(u32 address, s32 length, unsigned char *data)
 {
  //printf("%08x %08x\n",address,length);
  while(length>0)
@@ -72,11 +72,11 @@
 	memcpy(psxMemLUT + 0x8000, psxMemLUT, 0x80 * sizeof *psxMemLUT);
 	memcpy(psxMemLUT + 0xa000, psxMemLUT, 0x80 * sizeof *psxMemLUT);
 
-	for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f00] = (u32)&psxP[i << 16];
+	for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f00] = &psxP[i << 16];
 
-	for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f80] = (u32)&psxH[i << 16];
+	for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f80] = &psxH[i << 16];
 
-	for (i=0; i<0x08; i++) psxMemLUT[i + 0xbfc0] = (u32)&psxR[i << 16];
+	for (i=0; i<0x08; i++) psxMemLUT[i + 0xbfc0] = &psxR[i << 16];
 
 	return 0;
 }
@@ -102,7 +102,8 @@
 	if (psxMemLUT)
 		free(psxMemLUT);
 
-	psxM = psxP = psxH = psxR = psxMemLUT = NULL;
+	psxM = psxP = psxH = psxR = NULL;
+	psxMemLUT = NULL;
 }
 
 u8 psxMemRead8(u32 mem) {
--- a/Plugins/Input/sexypsf/PsxMem.h	Sat Feb 18 14:02:57 2006 -0800
+++ b/Plugins/Input/sexypsf/PsxMem.h	Sat Feb 18 16:15:16 2006 -0800
@@ -41,14 +41,14 @@
 }
 #endif
 
-s8 *psxM;
+char *psxM;
 #define psxMu32(mem)	(*(u32*)&psxM[(mem) & 0x1fffff])
 
-s8 *psxP;
-s8 *psxR;
+char *psxP;
+char *psxR;
 #define psxRu32(mem)	(*(u32*)&psxR[(mem) & 0x7ffff])
 
-s8 *psxH;
+char *psxH;
 
 #define psxHu8(mem)	(*(u8*) &psxH[(mem) & 0xffff])
 
@@ -57,7 +57,7 @@
 
 char **psxMemLUT;
 
-#define PSXM(mem)		(psxMemLUT[(mem) >> 16] == 0 ? "" : (void*)(psxMemLUT[(mem) >> 16] + ((mem) & 0xffff)))
+#define PSXM(mem)		(psxMemLUT[(mem) >> 16] == 0 ? NULL : (void*)(psxMemLUT[(mem) >> 16] + ((mem) & 0xffff)))
 
 #define PSXMu8(mem)	(*(u8 *)PSXM(mem))
 #define PSXMu32(mem)    (*(u32*)PSXM(mem))
@@ -76,6 +76,6 @@
 void psxMemWrite16(u32 mem, u16 value);
 void psxMemWrite32(u32 mem, u32 value);
 
-void LoadPSXMem(u32 address, s32 length, char *data);
+void LoadPSXMem(u32 address, s32 length, unsigned char *data);
 
 #endif /* __PSXMEMORY_H__ */