mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-26 13:52:21 +00:00
libstrat: fix more minor style issues pointed out by Pharynx
This commit is contained in:
parent
4e6bd19fcd
commit
fca213460b
2 changed files with 30 additions and 30 deletions
|
@ -29,42 +29,42 @@ namespace ams::fssystem {
|
||||||
public:
|
public:
|
||||||
ZeroStorage() { /* ... */ }
|
ZeroStorage() { /* ... */ }
|
||||||
virtual ~ZeroStorage() { /* ... */ }
|
virtual ~ZeroStorage() { /* ... */ }
|
||||||
|
public:
|
||||||
|
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
||||||
|
AMS_ASSERT(offset >= 0);
|
||||||
|
AMS_ASSERT(buffer != nullptr || size == 0);
|
||||||
|
AMS_UNUSED(offset);
|
||||||
|
|
||||||
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
if (size > 0) {
|
||||||
AMS_ASSERT(offset >= 0);
|
std::memset(buffer, 0, size);
|
||||||
AMS_ASSERT(buffer != nullptr || size == 0);
|
}
|
||||||
AMS_UNUSED(offset);
|
R_SUCCEED();
|
||||||
|
|
||||||
if (size > 0) {
|
|
||||||
std::memset(buffer, 0, size);
|
|
||||||
}
|
}
|
||||||
R_SUCCEED();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||||
AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size);
|
AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size);
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Result GetSize(s64 *out) override {
|
virtual Result GetSize(s64 *out) override {
|
||||||
AMS_ASSERT(out != nullptr);
|
AMS_ASSERT(out != nullptr);
|
||||||
*out = std::numeric_limits<s64>::max();
|
*out = std::numeric_limits<s64>::max();
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Result Flush() override {
|
virtual Result Flush() override {
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||||
AMS_UNUSED(offset, buffer, size);
|
AMS_UNUSED(offset, buffer, size);
|
||||||
R_THROW(fs::ResultUnsupportedWriteForZeroStorage());
|
R_THROW(fs::ResultUnsupportedWriteForZeroStorage());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Result SetSize(s64 size) override {
|
virtual Result SetSize(s64 size) override {
|
||||||
AMS_UNUSED(size);
|
AMS_UNUSED(size);
|
||||||
R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage());
|
R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
ZeroStorage m_zero_storage;
|
ZeroStorage m_zero_storage;
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace ams::fssystem {
|
||||||
/* Check if we have a rights id. */
|
/* Check if we have a rights id. */
|
||||||
constexpr const u8 ZeroRightsId[NcaHeader::RightsIdSize] = {};
|
constexpr const u8 ZeroRightsId[NcaHeader::RightsIdSize] = {};
|
||||||
if (crypto::IsSameBytes(ZeroRightsId, m_header.rights_id, NcaHeader::RightsIdSize)) {
|
if (crypto::IsSameBytes(ZeroRightsId, m_header.rights_id, NcaHeader::RightsIdSize)) {
|
||||||
/* If we do, then we don't have an external key, so we need to generate decryption keys if software keys are available. */
|
/* If we don't, then we don't have an external key, so we need to generate decryption keys if software keys are available. */
|
||||||
if (crypto_cfg.is_available_sw_key) {
|
if (crypto_cfg.is_available_sw_key) {
|
||||||
crypto_cfg.generate_key(m_decryption_keys[NcaHeader::DecryptionKey_AesCtr], crypto::AesDecryptor128::KeySize, m_header.encrypted_key_area + NcaHeader::DecryptionKey_AesCtr * crypto::AesDecryptor128::KeySize, crypto::AesDecryptor128::KeySize, GetKeyTypeValue(m_header.key_index, m_header.GetProperKeyGeneration()));
|
crypto_cfg.generate_key(m_decryption_keys[NcaHeader::DecryptionKey_AesCtr], crypto::AesDecryptor128::KeySize, m_header.encrypted_key_area + NcaHeader::DecryptionKey_AesCtr * crypto::AesDecryptor128::KeySize, crypto::AesDecryptor128::KeySize, GetKeyTypeValue(m_header.key_index, m_header.GetProperKeyGeneration()));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue