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:15:27 +0000 (21:15 +0300)
libpcsxcore/cdriso.c
libpcsxcore/cdrom.c
libpcsxcore/misc.c
plugins/dfxvideo/gpulib_if.c

index f03efa3..d421322 100644 (file)
@@ -1812,7 +1812,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 e7e9bb2..ca1c92a 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 854bbb8..6853e30 100644 (file)
@@ -91,7 +91,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 6215f58..a13da03 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
+
 #ifdef THREAD_RENDERING
 #include "../gpulib/gpulib_thread_if.h"
 #define do_cmd_list real_do_cmd_list