From 415213c97e0e35ea392114c71d8a10371c64d6fd Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 15 Sep 2022 21:12:10 +0300 Subject: [PATCH] misc: patch some issues indicated by clang --- libpcsxcore/cdriso.c | 2 +- libpcsxcore/cdrom.c | 3 ++- libpcsxcore/misc.c | 2 +- plugins/dfxvideo/gpulib_if.c | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index be7300f5..246b6a06 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -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(); } diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 3d380785..487dfb8d 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 c06a8a4f..b3dfdf53 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -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]); diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c index 86cfd268..245d2274 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 + #define u32 uint32_t #define INFO_TW 0 -- 2.39.5