diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-11 22:39:25 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-18 16:53:47 +0100 |
commit | e696ed1f4d20f28f8b26c637498962938df7d96f (patch) | |
tree | 79222d795725ba7b19f0aa9326041e236f9a22d8 /src/core/hle/service/am/am.cpp | |
parent | qt/main: Register Qt Software Keyboard frontend with AM (diff) | |
download | yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.gz yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.bz2 yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.lz yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.xz yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.tar.zst yuzu-e696ed1f4d20f28f8b26c637498962938df7d96f.zip |
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 53580d673..fc464270e 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -501,6 +501,8 @@ IStorage::IStorage(std::vector<u8> buffer) RegisterHandlers(functions); } +IStorage::~IStorage() = default; + const std::vector<u8>& IStorage::GetData() const { return buffer; } @@ -670,6 +672,8 @@ IStorageAccessor::IStorageAccessor(IStorage& storage) RegisterHandlers(functions); } +IStorageAccessor::~IStorageAccessor() = default; + void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; @@ -685,7 +689,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) { const u64 offset{rp.Pop<u64>()}; const std::vector<u8> data{ctx.ReadBuffer()}; - const auto size = std::min<std::size_t>(data.size(), backing.buffer.size() - offset); + const auto size = std::min(data.size(), backing.buffer.size() - offset); std::memcpy(&backing.buffer[offset], data.data(), size); @@ -701,7 +705,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { const u64 offset{rp.Pop<u64>()}; std::size_t size{ctx.GetWriteBufferSize()}; - size = std::min<std::size_t>(size, backing.buffer.size() - offset); + size = std::min(size, backing.buffer.size() - offset); ctx.WriteBuffer(backing.buffer.data() + offset, size); @@ -787,9 +791,9 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex return; } - std::vector<u8> memory(shared_mem->size); - std::memcpy(memory.data(), shared_mem->backing_block->data() + shared_mem->backing_block_offset, - memory.size()); + const auto mem_begin = shared_mem->backing_block->begin() + shared_mem->backing_block_offset; + const auto mem_end = mem_begin + shared_mem->size; + std::vector<u8> memory{mem_begin, mem_end}; IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); |