1
0
Fork 0
forked from suyu/suyu

kernel/shared_memory: Make GetPointer() take a std::size_t instead of a u32

Makes the interface nicer to use in terms of 64-bit code, as it makes it
less likely for one to get truncation warnings (and also makes sense in
the context of the rest of the interface where 64-bit types are used for
sizes and offsets
This commit is contained in:
Lioncash 2018-11-19 08:50:28 -05:00
parent f472232705
commit 76ac234bf6
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ VMAPermission SharedMemory::ConvertPermissions(MemoryPermission permission) {
return static_cast<VMAPermission>(masked_permissions); return static_cast<VMAPermission>(masked_permissions);
} }
u8* SharedMemory::GetPointer(u32 offset) { u8* SharedMemory::GetPointer(std::size_t offset) {
return backing_block->data() + backing_block_offset + offset; return backing_block->data() + backing_block_offset + offset;
} }

View file

@ -115,7 +115,7 @@ public:
* @param offset Offset from the start of the shared memory block to get pointer * @param offset Offset from the start of the shared memory block to get pointer
* @return Pointer to the shared memory block from the specified offset * @return Pointer to the shared memory block from the specified offset
*/ */
u8* GetPointer(u32 offset = 0); u8* GetPointer(std::size_t offset = 0);
private: private:
explicit SharedMemory(KernelCore& kernel); explicit SharedMemory(KernelCore& kernel);