mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-24 03:06:17 +00:00
libstratosphere: Make boolean autoparsing match official semantics.
This commit is contained in:
parent
25db9fcc4a
commit
9e558dafee
1 changed files with 4 additions and 0 deletions
|
@ -210,6 +210,10 @@ T GetValueFromIpcParsedCommand(IpcParsedCommand& r, IpcCommand& out_c, u8 *point
|
|||
} else if constexpr (std::is_same<T, PidDescriptor>::value) {
|
||||
cur_rawdata_index += sizeof(u64) / sizeof(u32);
|
||||
return PidDescriptor(r.Pid);
|
||||
} else if constexpr (std::is_same<T, bool>::value) {
|
||||
/* Official bools accept non-zero values with low bit unset as false. */
|
||||
cur_rawdata_index += size_in_raw_data<T>::value / sizeof(u32);
|
||||
return ((*(((u32 *)r.Raw + old_rawdata_index))) & 1) == 1;
|
||||
} else {
|
||||
cur_rawdata_index += size_in_raw_data<T>::value / sizeof(u32);
|
||||
return *((T *)((u32 *)r.Raw + old_rawdata_index));
|
||||
|
|
Loading…
Reference in a new issue