mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
remove some UB
- savestates used to read a four bytes from a single byte value - a few unassigned variables - some other things - also make the ROR macro an inline function
This commit is contained in:
@ -261,6 +261,22 @@ void Savestate::Var64(u64* var)
|
||||
}
|
||||
}
|
||||
|
||||
void Savestate::Bool32(bool* var)
|
||||
{
|
||||
// for compability
|
||||
if (Saving)
|
||||
{
|
||||
u32 val = *var;
|
||||
Var32(&val);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 val;
|
||||
Var32(&val);
|
||||
*var = val != 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Savestate::VarArray(void* data, u32 len)
|
||||
{
|
||||
if (Error) return;
|
||||
@ -273,4 +289,4 @@ void Savestate::VarArray(void* data, u32 len)
|
||||
{
|
||||
fread(data, len, 1, file);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user