mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Implement std::bit_cast<>
Partial implementation of std::bit_cast from C++20. Also fix most strict-aliasing rule break warnings (gcc).
This commit is contained in:
parent
790962425c
commit
dfd50d0185
24 changed files with 145 additions and 176 deletions
|
|
@ -440,7 +440,7 @@ namespace
|
|||
{
|
||||
be_t<u32> stored_val = as_const_span<const be_t<u32>>(orig_buffer)[idx];
|
||||
u32 swapped_val = stored_val;
|
||||
f32 float_val = (f32&)swapped_val;
|
||||
f32 float_val = std::bit_cast<f32>(swapped_val);
|
||||
u8 val = float_val * 255.f;
|
||||
return{ val, val, val };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue