ams: replace most remaining operator & with std::addressof

This commit is contained in:
Michael Scire
2021-10-09 14:49:53 -07:00
parent ce8aacef21
commit 1ab0bd1765
109 changed files with 587 additions and 586 deletions

View File

@@ -297,28 +297,28 @@ namespace ams::mitm {
void ReadStorageCalibrationBinary(CalibrationInfo *out) {
FsStorage calibration_binary_storage;
R_ABORT_UNLESS(fsOpenBisStorage(&calibration_binary_storage, FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(&calibration_binary_storage); };
R_ABORT_UNLESS(fsOpenBisStorage(std::addressof(calibration_binary_storage), FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(std::addressof(calibration_binary_storage)); };
R_ABORT_UNLESS(fsStorageRead(&calibration_binary_storage, 0, out, sizeof(*out)));
R_ABORT_UNLESS(fsStorageRead(std::addressof(calibration_binary_storage), 0, out, sizeof(*out)));
}
constexpr inline const u8 SecureCalibrationBinaryBackupIv[crypto::Aes128CtrDecryptor::IvSize] = {};
void ReadStorageEncryptedSecureCalibrationBinaryBackupUnsafe(SecureCalibrationInfoBackup *out) {
FsStorage calibration_binary_storage;
R_ABORT_UNLESS(fsOpenBisStorage(&calibration_binary_storage, FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(&calibration_binary_storage); };
R_ABORT_UNLESS(fsOpenBisStorage(std::addressof(calibration_binary_storage), FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(std::addressof(calibration_binary_storage)); };
R_ABORT_UNLESS(fsStorageRead(&calibration_binary_storage, SecureCalibrationInfoBackupOffset, out, sizeof(*out)));
R_ABORT_UNLESS(fsStorageRead(std::addressof(calibration_binary_storage), SecureCalibrationInfoBackupOffset, out, sizeof(*out)));
}
void WriteStorageEncryptedSecureCalibrationBinaryBackupUnsafe(const SecureCalibrationInfoBackup *src) {
FsStorage calibration_binary_storage;
R_ABORT_UNLESS(fsOpenBisStorage(&calibration_binary_storage, FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(&calibration_binary_storage); };
R_ABORT_UNLESS(fsOpenBisStorage(std::addressof(calibration_binary_storage), FsBisPartitionId_CalibrationBinary));
ON_SCOPE_EXIT { fsStorageClose(std::addressof(calibration_binary_storage)); };
R_ABORT_UNLESS(fsStorageWrite(&calibration_binary_storage, SecureCalibrationInfoBackupOffset, src, sizeof(*src)));
R_ABORT_UNLESS(fsStorageWrite(std::addressof(calibration_binary_storage), SecureCalibrationInfoBackupOffset, src, sizeof(*src)));
}
void GenerateSecureCalibrationBinaryBackupKey(void *dst, size_t dst_size) {