From c316b3713bd6058a0cdedf8b0d5768e7dd35656a Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Wed, 23 Oct 2024 23:02:43 +0200 Subject: [PATCH] Correct operator precedence In the previous version, != took precedence over ^ so that (((*A)>>11)&0x1) != 0 was evaluated first and then xored with the left hand side. Here I remove all the unnecessary parens except the ones suggested by GCC -Wparentheses. And add the parens that are actually needed in order to evaluate !=0 last. --- yabause/src/sys/vdp1/src/vdp1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yabause/src/sys/vdp1/src/vdp1.c b/yabause/src/sys/vdp1/src/vdp1.c index 6ffc9b50f7..b3dcd050e7 100644 --- a/yabause/src/sys/vdp1/src/vdp1.c +++ b/yabause/src/sys/vdp1/src/vdp1.c @@ -82,7 +82,7 @@ static void checkFBSync(); int CONVERTCMD(s32 *A) { s32 toto = (*A); - if ((((*A)>>12)&0x1)^(((*A)>>11)&0x1) != 0) { + if (((*A>>12 & 0x1) ^ (*A>>11 & 0x1)) != 0) { return 1; } if (((*A)>>11)&0x1) (*A) |= 0xF800;