2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

video_core/memory_manager: Make Read() a const qualified member function

Given this doesn't actually alter internal state, this can be made a
const member function.
This commit is contained in:
Lioncash 2019-04-05 20:30:46 -04:00
parent 76ef6e5c2b
commit c13fbe6a41
2 changed files with 6 additions and 6 deletions

View file

@ -114,7 +114,7 @@ std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr addr) const {
} }
template <typename T> template <typename T>
T MemoryManager::Read(GPUVAddr addr) { T MemoryManager::Read(GPUVAddr addr) const {
if (!IsAddressValid(addr)) { if (!IsAddressValid(addr)) {
return {}; return {};
} }
@ -166,10 +166,10 @@ void MemoryManager::Write(GPUVAddr addr, T data) {
} }
} }
template u8 MemoryManager::Read<u8>(GPUVAddr addr); template u8 MemoryManager::Read<u8>(GPUVAddr addr) const;
template u16 MemoryManager::Read<u16>(GPUVAddr addr); template u16 MemoryManager::Read<u16>(GPUVAddr addr) const;
template u32 MemoryManager::Read<u32>(GPUVAddr addr); template u32 MemoryManager::Read<u32>(GPUVAddr addr) const;
template u64 MemoryManager::Read<u64>(GPUVAddr addr); template u64 MemoryManager::Read<u64>(GPUVAddr addr) const;
template void MemoryManager::Write<u8>(GPUVAddr addr, u8 data); template void MemoryManager::Write<u8>(GPUVAddr addr, u8 data);
template void MemoryManager::Write<u16>(GPUVAddr addr, u16 data); template void MemoryManager::Write<u16>(GPUVAddr addr, u16 data);
template void MemoryManager::Write<u32>(GPUVAddr addr, u32 data); template void MemoryManager::Write<u32>(GPUVAddr addr, u32 data);

View file

@ -53,7 +53,7 @@ public:
std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr) const; std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr) const;
template <typename T> template <typename T>
T Read(GPUVAddr addr); T Read(GPUVAddr addr) const;
template <typename T> template <typename T>
void Write(GPUVAddr addr, T data); void Write(GPUVAddr addr, T data);