From 305c8c935f912467121a473f945a42a325034417 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 21 Nov 2012 03:47:35 +0200 Subject: [PATCH] fix various warnings the idea here was to disable them to avoid drifting from pcsx-reloaded, but there doesn't seems to be much need for syncing. --- Makefile | 3 +-- libpcsxcore/cdrom.c | 6 +++--- libpcsxcore/misc.c | 28 +++++++++++++++++----------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 49d5476a..a2a811f7 100644 --- a/Makefile +++ b/Makefile @@ -47,8 +47,7 @@ ifeq "$(HAVE_NEON)" "1" OBJS += libpcsxcore/gte_neon.o endif libpcsxcore/gte.o libpcsxcore/gte_nf.o: CFLAGS += -fno-strict-aliasing -libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign -libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull +libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull # dynarec ifeq "$(USE_DYNAREC)" "1" diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 1d581e4c..327ddb1d 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -122,11 +122,11 @@ unsigned char Test23[] = { 0x43, 0x58, 0x44, 0x32, 0x39 ,0x34, 0x30, 0x51 }; static struct CdrStat stat; -static unsigned int msf2sec(char *msf) { +static unsigned int msf2sec(u8 *msf) { return ((msf[0] * 60 + msf[1]) * 75) + msf[2]; } -static void sec2msf(unsigned int s, char *msf) { +static void sec2msf(unsigned int s, u8 *msf) { msf[0] = s / 75 / 60; s = s - msf[0] * 75 * 60; msf[1] = s / 75; @@ -1484,7 +1484,7 @@ unsigned char cdrRead1(void) { } void cdrWrite1(unsigned char rt) { - char set_loc[3]; + u8 set_loc[3]; int i; #ifdef CDR_LOG diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 27b94993..ad2e5d55 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -93,8 +93,9 @@ void mmssdd( char *b, char *p ) #define READTRACK() \ if (CDR_readTrack(time) == -1) return -1; \ - buf = CDR_getBuffer(); \ - if (buf == NULL) return -1; else CheckPPFCache(buf, time[0], time[1], time[2]); + buf = (void *)CDR_getBuffer(); \ + if (buf == NULL) return -1; \ + else CheckPPFCache((u8 *)buf, time[0], time[1], time[2]); #define READDIR(_dir) \ READTRACK(); \ @@ -104,9 +105,9 @@ void mmssdd( char *b, char *p ) READTRACK(); \ memcpy(_dir + 2048, buf + 12, 2048); -int GetCdromFile(u8 *mdir, u8 *time, s8 *filename) { +int GetCdromFile(u8 *mdir, u8 *time, char *filename) { struct iso_directory_record *dir; - char ddir[4096]; + u8 ddir[4096]; u8 *buf; int i; @@ -169,7 +170,7 @@ int LoadCdrom() { struct iso_directory_record *dir; u8 time[4], *buf; u8 mdir[4096]; - s8 exename[256]; + char exename[256]; // not the best place to do it, but since BIOS boot logo killer // is just below, do it here @@ -207,7 +208,7 @@ int LoadCdrom() { if (GetCdromFile(mdir, time, exename) == -1) { sscanf((char *)buf + 12, "BOOT = cdrom:%256s", exename); if (GetCdromFile(mdir, time, exename) == -1) { - char *ptr = strstr(buf + 12, "cdrom:"); + char *ptr = strstr((char *)buf + 12, "cdrom:"); if (ptr != NULL) { ptr += 6; while (*ptr == '\\' || *ptr == '/') ptr++; @@ -258,8 +259,10 @@ int LoadCdrom() { int LoadCdromFile(const char *filename, EXE_HEADER *head) { struct iso_directory_record *dir; u8 time[4],*buf; - u8 mdir[4096], exename[256]; + u8 mdir[4096]; + char exename[256]; u32 size, addr; + void *mem; sscanf(filename, "cdrom:\\%256s", exename); @@ -288,7 +291,9 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) { incTime(); READTRACK(); - memcpy((void *)PSXM(addr), buf + 12, 2048); + mem = PSXM(addr); + if (mem) + memcpy(mem, buf + 12, 2048); size -= 2048; addr += 2048; @@ -299,7 +304,8 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) { int CheckCdrom() { struct iso_directory_record *dir; - unsigned char time[4], *buf; + unsigned char time[4]; + char *buf; unsigned char mdir[4096]; char exename[256]; int i, c; @@ -327,9 +333,9 @@ int CheckCdrom() { if (GetCdromFile(mdir, time, "SYSTEM.CNF;1") != -1) { READTRACK(); - sscanf((char *)buf + 12, "BOOT = cdrom:\\%256s", exename); + sscanf(buf + 12, "BOOT = cdrom:\\%256s", exename); if (GetCdromFile(mdir, time, exename) == -1) { - sscanf((char *)buf + 12, "BOOT = cdrom:%256s", exename); + sscanf(buf + 12, "BOOT = cdrom:%256s", exename); if (GetCdromFile(mdir, time, exename) == -1) { char *ptr = strstr(buf + 12, "cdrom:"); // possibly the executable is in some subdir if (ptr != NULL) { -- 2.39.5