diff options
| author | 2019-11-14 16:29:31 -0500 | |
|---|---|---|
| committer | 2019-11-14 16:31:52 -0500 | |
| commit | 2c4c2b5eeeae29413a59548bda40b225c443ce91 (patch) | |
| tree | d583634f9bc508c35c805611d01aad9ed355e7cb /src | |
| parent | Merge pull request #3089 from SciresM/play_statistics (diff) | |
| download | yuzu-2c4c2b5eeeae29413a59548bda40b225c443ce91.tar.gz yuzu-2c4c2b5eeeae29413a59548bda40b225c443ce91.tar.xz yuzu-2c4c2b5eeeae29413a59548bda40b225c443ce91.zip | |
service/am: Remove unnecessary Skip calls
We can simplify these by wrapping the necessary members in structs and
then simply reading out the whole struct.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d52ec4387..d79997fe0 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1336,12 +1336,16 @@ void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) { | |||
| 1336 | } | 1336 | } |
| 1337 | 1337 | ||
| 1338 | void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) { | 1338 | void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) { |
| 1339 | struct Parameters { | ||
| 1340 | FileSys::SaveDataType type; | ||
| 1341 | u128 user_id; | ||
| 1342 | u64 new_normal_size; | ||
| 1343 | u64 new_journal_size; | ||
| 1344 | }; | ||
| 1345 | static_assert(sizeof(Parameters) == 40); | ||
| 1346 | |||
| 1339 | IPC::RequestParser rp{ctx}; | 1347 | IPC::RequestParser rp{ctx}; |
| 1340 | const auto type{rp.PopRaw<FileSys::SaveDataType>()}; | 1348 | const auto [type, user_id, new_normal_size, new_journal_size] = rp.PopRaw<Parameters>(); |
| 1341 | rp.Skip(1, false); | ||
| 1342 | const auto user_id{rp.PopRaw<u128>()}; | ||
| 1343 | const auto new_normal_size{rp.PopRaw<u64>()}; | ||
| 1344 | const auto new_journal_size{rp.PopRaw<u64>()}; | ||
| 1345 | 1349 | ||
| 1346 | LOG_DEBUG(Service_AM, | 1350 | LOG_DEBUG(Service_AM, |
| 1347 | "called with type={:02X}, user_id={:016X}{:016X}, new_normal={:016X}, " | 1351 | "called with type={:02X}, user_id={:016X}{:016X}, new_normal={:016X}, " |
| @@ -1360,10 +1364,14 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) { | |||
| 1360 | } | 1364 | } |
| 1361 | 1365 | ||
| 1362 | void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) { | 1366 | void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) { |
| 1367 | struct Parameters { | ||
| 1368 | FileSys::SaveDataType type; | ||
| 1369 | u128 user_id; | ||
| 1370 | }; | ||
| 1371 | static_assert(sizeof(Parameters) == 24); | ||
| 1372 | |||
| 1363 | IPC::RequestParser rp{ctx}; | 1373 | IPC::RequestParser rp{ctx}; |
| 1364 | const auto type{rp.PopRaw<FileSys::SaveDataType>()}; | 1374 | const auto [type, user_id] = rp.PopRaw<Parameters>(); |
| 1365 | rp.Skip(1, false); | ||
| 1366 | const auto user_id{rp.PopRaw<u128>()}; | ||
| 1367 | 1375 | ||
| 1368 | LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type), | 1376 | LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type), |
| 1369 | user_id[1], user_id[0]); | 1377 | user_id[1], user_id[0]); |