Common: Fix unused function warning

This commit is contained in:
Stenzek 2023-10-11 18:51:12 +10:00 committed by Connor McLaughlin
parent 88f8ef0244
commit 4aaf6ba69e
1 changed files with 7 additions and 5 deletions

View File

@ -40,16 +40,18 @@
}; \
};
template<typename T> static T GetBufferT(u8* buffer, u32 offset) {
template <typename T>
[[maybe_unused]] __fi static T GetBufferT(u8* buffer, u32 offset)
{
T value;
std::memcpy(&value, buffer + offset, sizeof(value));
return value;
}
static u8 GetBufferU8(u8* buffer, u32 offset) { return GetBufferT<u8>(buffer, offset); }
static u16 GetBufferU16(u8* buffer, u32 offset) { return GetBufferT<u16>(buffer, offset); }
static u32 GetBufferU32(u8* buffer, u32 offset) { return GetBufferT<u32>(buffer, offset); }
static u64 GetBufferU64(u8* buffer, u32 offset) { return GetBufferT<u64>(buffer, offset); }
[[maybe_unused]] __fi static u8 GetBufferU8(u8* buffer, u32 offset) { return GetBufferT<u8>(buffer, offset); }
[[maybe_unused]] __fi static u16 GetBufferU16(u8* buffer, u32 offset) { return GetBufferT<u16>(buffer, offset); }
[[maybe_unused]] __fi static u32 GetBufferU32(u8* buffer, u32 offset) { return GetBufferT<u32>(buffer, offset); }
[[maybe_unused]] __fi static u64 GetBufferU64(u8* buffer, u32 offset) { return GetBufferT<u64>(buffer, offset); }
// --------------------------------------------------------------------------------------
// PageProtectionMode