mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-25 16:54:41 +00:00
[common] rework BitField and BitUtil, use concepts whenever possible (#4076)
test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
@@ -284,9 +284,9 @@ u8 RingController::GetCrcValue(const std::vector<u8>& data) const {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
requires std::is_trivially_copyable_v<T>
|
||||
u64 RingController::GetData(const T& reply, std::span<u8> out_data) const {
|
||||
static_assert(std::is_trivially_copyable_v<T>);
|
||||
const auto data_size = static_cast<u64>((std::min)(sizeof(reply), out_data.size()));
|
||||
const auto data_size = u64((std::min)(sizeof(reply), out_data.size()));
|
||||
std::memcpy(out_data.data(), &reply, data_size);
|
||||
return data_size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user