mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-22 20:06:40 +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:
|
||||
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 {
|
||||
AMS_ASSERT(offset >= 0);
|
||||
AMS_ASSERT(buffer != nullptr || size == 0);
|
||||
AMS_UNUSED(offset);
|
||||
|
||||
if (size > 0) {
|
||||
std::memset(buffer, 0, size);
|
||||
if (size > 0) {
|
||||
std::memset(buffer, 0, size);
|
||||
}
|
||||
R_SUCCEED();
|
||||
}
|
||||
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 {
|
||||
AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_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 {
|
||||
AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
AMS_ASSERT(out != nullptr);
|
||||
*out = std::numeric_limits<s64>::max();
|
||||
R_SUCCEED();
|
||||
}
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
AMS_ASSERT(out != nullptr);
|
||||
*out = std::numeric_limits<s64>::max();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
R_SUCCEED();
|
||||
}
|
||||
virtual Result Flush() override {
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
AMS_UNUSED(offset, buffer, size);
|
||||
R_THROW(fs::ResultUnsupportedWriteForZeroStorage());
|
||||
}
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
AMS_UNUSED(offset, buffer, size);
|
||||
R_THROW(fs::ResultUnsupportedWriteForZeroStorage());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
AMS_UNUSED(size);
|
||||
R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage());
|
||||
}
|
||||
virtual Result SetSize(s64 size) override {
|
||||
AMS_UNUSED(size);
|
||||
R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage());
|
||||
}
|
||||
};
|
||||
private:
|
||||
ZeroStorage m_zero_storage;
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace ams::fssystem {
|
|||
/* Check if we have a rights id. */
|
||||
constexpr const u8 ZeroRightsId[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) {
|
||||
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