From 5ff1fcd604a91924398076e444b10cadb622e7d7 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Mon, 4 Nov 2019 06:57:47 +0100 Subject: [PATCH] Fix "misleading-indentation" warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC helpfully indicates, that: warning: this ‘if’ clause does not guard (…) this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’. Also, improve readability while we're touching these lines. --- src/hardware/memory.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/hardware/memory.cpp b/src/hardware/memory.cpp index 5069b8a5..60dd5608 100644 --- a/src/hardware/memory.cpp +++ b/src/hardware/memory.cpp @@ -472,17 +472,21 @@ bool mem_unalignedreadd_checked(PhysPt address, Bit32u * val) { return false; } -bool mem_unalignedwritew_checked(PhysPt address,Bit16u val) { - if (mem_writeb_checked(address,(Bit8u)(val & 0xff))) return true;val>>=8; - if (mem_writeb_checked(address+1,(Bit8u)(val & 0xff))) return true; +bool mem_unalignedwritew_checked(PhysPt address, Bit16u val) { + if (mem_writeb_checked(address+0, (Bit8u)(val & 0xff))) return true; + val >>= 8; + if (mem_writeb_checked(address+1, (Bit8u)(val & 0xff))) return true; return false; } -bool mem_unalignedwrited_checked(PhysPt address,Bit32u val) { - if (mem_writeb_checked(address,(Bit8u)(val & 0xff))) return true;val>>=8; - if (mem_writeb_checked(address+1,(Bit8u)(val & 0xff))) return true;val>>=8; - if (mem_writeb_checked(address+2,(Bit8u)(val & 0xff))) return true;val>>=8; - if (mem_writeb_checked(address+3,(Bit8u)(val & 0xff))) return true; +bool mem_unalignedwrited_checked(PhysPt address, Bit32u val) { + if (mem_writeb_checked(address+0, (Bit8u)(val & 0xff))) return true; + val >>= 8; + if (mem_writeb_checked(address+1, (Bit8u)(val & 0xff))) return true; + val >>= 8; + if (mem_writeb_checked(address+2, (Bit8u)(val & 0xff))) return true; + val >>= 8; + if (mem_writeb_checked(address+3, (Bit8u)(val & 0xff))) return true; return false; }