Skip to content
Snippets Groups Projects
Commit 76ac234b authored by Lioncash's avatar Lioncash
Browse files

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
parent f4722327
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,7 @@ VMAPermission SharedMemory::ConvertPermissions(MemoryPermission permission) { ...@@ -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;
} }
......
...@@ -115,7 +115,7 @@ public: ...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment