From: notaz Date: Thu, 15 Sep 2022 18:12:10 +0000 (+0300) Subject: misc: patch some issues indicated by clang X-Git-Tag: r24l~383 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1290ebe47bb6af9a832b438422c4d0e94deca4a7;p=pcsx_rearmed.git misc: patch some issues indicated by clang --- diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index f03efa39..d4213227 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -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(); } diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index e7e9bb23..ca1c92a6 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -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 diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 854bbb85..6853e30e 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -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]); diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c index 6215f587..a13da035 100644 --- a/plugins/dfxvideo/gpulib_if.c +++ b/plugins/dfxvideo/gpulib_if.c @@ -18,6 +18,10 @@ #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