fix various warnings
authornotaz <notasas@gmail.com>
Wed, 21 Nov 2012 01:47:35 +0000 (03:47 +0200)
committernotaz <notasas@gmail.com>
Sat, 24 Nov 2012 02:25:25 +0000 (04:25 +0200)
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
libpcsxcore/cdrom.c
libpcsxcore/misc.c

index 49d5476..a2a811f 100644 (file)
--- 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
 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"
 
 # dynarec
 ifeq "$(USE_DYNAREC)" "1"
index 1d581e4..327ddb1 100644 (file)
@@ -122,11 +122,11 @@ unsigned char Test23[] = { 0x43, 0x58, 0x44, 0x32, 0x39 ,0x34, 0x30, 0x51 };
 
 static struct CdrStat stat;
 
 
 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];
 }
 
        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;
        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) {
 }
 
 void cdrWrite1(unsigned char rt) {
-       char set_loc[3];
+       u8 set_loc[3];
        int i;
 
 #ifdef CDR_LOG
        int i;
 
 #ifdef CDR_LOG
index 27b9499..ad2e5d5 100644 (file)
@@ -93,8 +93,9 @@ void mmssdd( char *b, char *p )
 
 #define READTRACK() \
        if (CDR_readTrack(time) == -1) return -1; \
 
 #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(); \
 
 #define READDIR(_dir) \
        READTRACK(); \
@@ -104,9 +105,9 @@ void mmssdd( char *b, char *p )
        READTRACK(); \
        memcpy(_dir + 2048, buf + 12, 2048);
 
        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;
        struct iso_directory_record *dir;
-       char ddir[4096];
+       u8 ddir[4096];
        u8 *buf;
        int i;
 
        u8 *buf;
        int i;
 
@@ -169,7 +170,7 @@ int LoadCdrom() {
        struct iso_directory_record *dir;
        u8 time[4], *buf;
        u8 mdir[4096];
        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
 
        // 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) {
                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++;
                                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;
 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;
        u32 size, addr;
+       void *mem;
 
        sscanf(filename, "cdrom:\\%256s", exename);
 
 
        sscanf(filename, "cdrom:\\%256s", exename);
 
@@ -288,7 +291,9 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) {
                incTime();
                READTRACK();
 
                incTime();
                READTRACK();
 
-               memcpy((void *)PSXM(addr), buf + 12, 2048);
+               mem = PSXM(addr);
+               if (mem)
+                       memcpy(mem, buf + 12, 2048);
 
                size -= 2048;
                addr += 2048;
 
                size -= 2048;
                addr += 2048;
@@ -299,7 +304,8 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) {
 
 int CheckCdrom() {
        struct iso_directory_record *dir;
 
 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;
        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();
 
        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) {
                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) {
                        if (GetCdromFile(mdir, time, exename) == -1) {
                                char *ptr = strstr(buf + 12, "cdrom:");                 // possibly the executable is in some subdir
                                if (ptr != NULL) {