Skip to content

Commit

Permalink
Common: Fix unused function warning
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 11, 2023
1 parent 88f8ef0 commit 4aaf6ba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/General.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4aaf6ba

Please sign in to comment.