summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-03-25 23:18:56 +0100
committerGitHub <noreply@github.com>2017-03-25 23:18:56 +0100
commit86e6b44271fcfddb68b2680525f23217c4360198 (patch)
treede4fce5495b936da0459991aeeda2d084d4a8b4f /Source/Core
parent4d8d0451e3cd73a2d0afa3bc15ac427fb26e3c1d (diff)
parent8387b00f4282a02429df073a8719e8ad12c65187 (diff)
Merge pull request #5146 from ligfx/mmuwarning
MMU: rewrite loop to avoid warning
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/MMU.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/Core/PowerPC/MMU.cpp b/Source/Core/Core/PowerPC/MMU.cpp
index 31b0e7501f..557ae8746a 100644
--- a/Source/Core/Core/PowerPC/MMU.cpp
+++ b/Source/Core/Core/PowerPC/MMU.cpp
@@ -274,12 +274,11 @@ static void WriteToHardware(u32 em_address, const T data)
}
T val = bswap(data);
u32 addr_translated = translated_addr.address;
- for (u32 addr = em_address; addr < em_address + sizeof(T);
- addr++, addr_translated++, val >>= 8)
+ for (size_t i = 0; i < sizeof(T); i++, addr_translated++)
{
- if (addr == em_address_next_page)
+ if (em_address + i == em_address_next_page)
addr_translated = addr_next_page.address;
- WriteToHardware<flag, u8, true>(addr_translated, (u8)val);
+ WriteToHardware<flag, u8, true>(addr_translated, static_cast<u8>(val >> (i * 8)));
}
return;
}