diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-07-19 16:10:12 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-07-19 17:05:12 -0400 |
| commit | ff500a7b6838f2eaca25b79ce602c499a71b9c10 (patch) | |
| tree | 7813699b6de1c54556817cba997c870cb4846b35 /src/core/hle/kernel/hle_ipc.cpp | |
| parent | 7eace8f512305baabef78f5c93dff06b2a4bf47e (diff) | |
hle_ipc: Introduce generic WriteBuffer overload for multiple container types
This introduces a slightly more generic variant of WriteBuffer().
Notably, this variant doesn't constrain the arguments to only accepting
std::vector instances. It accepts whatever adheres to the
ContiguousContainer concept in the C++ standard library.
This essentially means, std::array, std::string, and std::vector can be
used directly with this interface. The interface no longer forces you to
solely use containers that dynamically allocate.
To ensure our overloads play nice with one another, we only enable the
container-based WriteBuffer if the argument is not a pointer, otherwise
we fall back to the pointer-based one.
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 911e6fbc1..8f40bdd5a 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -301,10 +301,6 @@ size_t HLERequestContext::WriteBuffer(const void* buffer, size_t size, int buffe return size; } -size_t HLERequestContext::WriteBuffer(const std::vector<u8>& buffer, int buffer_index) const { - return WriteBuffer(buffer.data(), buffer.size(), buffer_index); -} - size_t HLERequestContext::GetReadBufferSize(int buffer_index) const { const bool is_buffer_a{BufferDescriptorA().size() && BufferDescriptorA()[buffer_index].Size()}; return is_buffer_a ? BufferDescriptorA()[buffer_index].Size() |
