Skip to content

Commit

Permalink
Build: Fix up various warnings, increase variable readability
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Oct 10, 2023
1 parent 312a583 commit afa76b6
Show file tree
Hide file tree
Showing 7 changed files with 459 additions and 462 deletions.
11 changes: 11 additions & 0 deletions common/General.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
}; \
};

template<typename T> 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); }

// --------------------------------------------------------------------------------------
// PageProtectionMode
// --------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit afa76b6

Please sign in to comment.