From dc4efc3644f53e3a8c2281f151aee62e546cfa7d Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 4 Dec 2022 05:34:27 +1000 Subject: [PATCH] Fix typos and whitespace in `MemoryApi.cs` --- .../Api/Classes/MemoryApi.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs index 1014e2ff37..0cfc267379 100644 --- a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs @@ -231,8 +231,8 @@ namespace BizHawk.Client.Common } var data = new byte[count]; using (d.EnterExit()) - { - for (var i = 0; i < count; i++) data[i] = d.PeekByte(addr + i); + { + for (var i = 0; i < count; i++) data[i] = d.PeekByte(addr + i); } return SHA256Checksum.ComputeDigestHex(data); } @@ -249,8 +249,8 @@ namespace BizHawk.Client.Common var indexAfterLast = Math.Min(lastReqAddr, d.Size - 1) - addr + 1; var bytes = new byte[length]; using (d.EnterExit()) - { - for (var i = addr < 0 ? -addr : 0; i != indexAfterLast; i++) bytes[i] = d.PeekByte(addr + i); + { + for (var i = addr < 0 ? -addr : 0; i != indexAfterLast; i++) bytes[i] = d.PeekByte(addr + i); } if (lastReqAddr >= d.Size) LogCallback($"Warning: Attempted reads on addresses {d.Size}..{lastReqAddr} outside range of domain {d.Name} in {nameof(ReadByteRange)}()"); return bytes; @@ -264,14 +264,14 @@ namespace BizHawk.Client.Common LogCallback($"Error: the domain {d.Name} is not writable"); return; } - if (addr < 0) LogCallback($"Warning: Attempted reads on addresses {addr}..-1 outside range of domain {d.Name} in {nameof(WriteByteRange)}()"); + if (addr < 0) LogCallback($"Warning: Attempted writes on addresses {addr}..-1 outside range of domain {d.Name} in {nameof(WriteByteRange)}()"); var lastReqAddr = addr + memoryblock.Count - 1; var indexAfterLast = Math.Min(lastReqAddr, d.Size - 1) - addr + 1; using (d.EnterExit()) - { - for (var i = addr < 0 ? (int)-addr : 0; i != indexAfterLast; i++) d.PokeByte(addr + i, memoryblock[i]); + { + for (var i = addr < 0 ? (int)-addr : 0; i != indexAfterLast; i++) d.PokeByte(addr + i, memoryblock[i]); } - if (lastReqAddr >= d.Size) LogCallback($"Warning: Attempted reads on addresses {d.Size}..{lastReqAddr} outside range of domain {d.Name} in {nameof(WriteByteRange)}()"); + if (lastReqAddr >= d.Size) LogCallback($"Warning: Attempted writes on addresses {d.Size}..{lastReqAddr} outside range of domain {d.Name} in {nameof(WriteByteRange)}()"); } public float ReadFloat(long addr, string domain = null)