misc: patch some issues indicated by clang
authornotaz <notasas@gmail.com>
Thu, 15 Sep 2022 18:12:10 +0000 (21:12 +0300)
committernotaz <notasas@gmail.com>
Thu, 15 Sep 2022 18:12:10 +0000 (21:12 +0300)
libpcsxcore/cdriso.c
libpcsxcore/cdrom.c
libpcsxcore/misc.c
plugins/dfxvideo/gpulib_if.c

index be7300f..246b6a0 100644 (file)
@@ -1547,7 +1547,7 @@ static boolean CALLBACK ISOreadTrack(unsigned char *time) {
                fseek(subHandle, sector * SUB_FRAMESIZE, SEEK_SET);
                if (fread(subbuffer, 1, SUB_FRAMESIZE, subHandle) != SUB_FRAMESIZE)
                        /* Faulty subchannel data shouldn't cause a read failure */
-                       return 0;
+                       return 1;
 
                if (subChanRaw) DecodeRawSubData();
        }
index 3d38078..487dfb8 100644 (file)
@@ -545,7 +545,8 @@ static void cdrPlayInterrupt_Autopause()
 
 static int cdrSeekTime(unsigned char *target)
 {
-       int seekTime = abs(msf2sec(cdr.SetSectorPlay) - msf2sec(target)) * (cdReadTime / 200);
+       int diff = msf2sec(cdr.SetSectorPlay) - msf2sec(target);
+       int seekTime = abs(diff) * (cdReadTime / 200);
        /*
        * Gameblabla :
        * It was originally set to 1000000 for Driver, however it is not high enough for Worms Pinball
index c06a8a4..b3dfdf5 100644 (file)
@@ -90,7 +90,7 @@ static void mmssdd( char *b, char *p )
        time[0] = itob(time[0]); time[1] = itob(time[1]); time[2] = itob(time[2]);
 
 #define READTRACK() \
-       if (CDR_readTrack(time) == -1) return -1; \
+       if (!CDR_readTrack(time)) return -1; \
        buf = (void *)CDR_getBuffer(); \
        if (buf == NULL) return -1; \
        else CheckPPFCache((u8 *)buf, time[0], time[1], time[2]);
index 86cfd26..245d227 100644 (file)
 #include "../gpulib/gpu.h"
 #include "../../include/arm_features.h"
 
+#if defined(__GNUC__) && (__GNUC__ >= 6 || (defined(__clang_major__) && __clang_major__ >= 10))
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
 #define u32 uint32_t
 
 #define INFO_TW        0