diff options
| author | 2019-04-05 20:30:46 -0400 | |
|---|---|---|
| committer | 2019-04-05 20:30:48 -0400 | |
| commit | c13fbe6a41a8e496e6b7de38a15669344e9cab7a (patch) | |
| tree | 51933c4b7a07f8cb1a7d1ee1c5bb1bc3cfaf42f4 | |
| parent | video_core/memory_manager: Make ReadBlock() a const qualifier member function (diff) | |
| download | yuzu-c13fbe6a41a8e496e6b7de38a15669344e9cab7a.tar.gz yuzu-c13fbe6a41a8e496e6b7de38a15669344e9cab7a.tar.xz yuzu-c13fbe6a41a8e496e6b7de38a15669344e9cab7a.zip | |
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.
| -rw-r--r-- | src/video_core/memory_manager.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/memory_manager.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 2b3651f20..8417324ff 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp | |||
| @@ -114,7 +114,7 @@ std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr addr) const { | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | template <typename T> | 116 | template <typename T> |
| 117 | T MemoryManager::Read(GPUVAddr addr) { | 117 | T MemoryManager::Read(GPUVAddr addr) const { |
| 118 | if (!IsAddressValid(addr)) { | 118 | if (!IsAddressValid(addr)) { |
| 119 | return {}; | 119 | return {}; |
| 120 | } | 120 | } |
| @@ -166,10 +166,10 @@ void MemoryManager::Write(GPUVAddr addr, T data) { | |||
| 166 | } | 166 | } |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | template u8 MemoryManager::Read<u8>(GPUVAddr addr); | 169 | template u8 MemoryManager::Read<u8>(GPUVAddr addr) const; |
| 170 | template u16 MemoryManager::Read<u16>(GPUVAddr addr); | 170 | template u16 MemoryManager::Read<u16>(GPUVAddr addr) const; |
| 171 | template u32 MemoryManager::Read<u32>(GPUVAddr addr); | 171 | template u32 MemoryManager::Read<u32>(GPUVAddr addr) const; |
| 172 | template u64 MemoryManager::Read<u64>(GPUVAddr addr); | 172 | template u64 MemoryManager::Read<u64>(GPUVAddr addr) const; |
| 173 | template void MemoryManager::Write<u8>(GPUVAddr addr, u8 data); | 173 | template void MemoryManager::Write<u8>(GPUVAddr addr, u8 data); |
| 174 | template void MemoryManager::Write<u16>(GPUVAddr addr, u16 data); | 174 | template void MemoryManager::Write<u16>(GPUVAddr addr, u16 data); |
| 175 | template void MemoryManager::Write<u32>(GPUVAddr addr, u32 data); | 175 | template void MemoryManager::Write<u32>(GPUVAddr addr, u32 data); |
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 273d538b8..178e2f655 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h | |||
| @@ -53,7 +53,7 @@ public: | |||
| 53 | std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr) const; | 53 | std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr) const; |
| 54 | 54 | ||
| 55 | template <typename T> | 55 | template <typename T> |
| 56 | T Read(GPUVAddr addr); | 56 | T Read(GPUVAddr addr) const; |
| 57 | 57 | ||
| 58 | template <typename T> | 58 | template <typename T> |
| 59 | void Write(GPUVAddr addr, T data); | 59 | void Write(GPUVAddr addr, T data); |