diff options
| author | 2018-07-19 16:10:12 -0400 | |
|---|---|---|
| committer | 2018-07-19 17:05:12 -0400 | |
| commit | ff500a7b6838f2eaca25b79ce602c499a71b9c10 (patch) | |
| tree | 7813699b6de1c54556817cba997c870cb4846b35 /src/core/hle/service/audio | |
| parent | Merge pull request #714 from lioncash/index (diff) | |
| download | yuzu-ff500a7b6838f2eaca25b79ce602c499a71b9c10.tar.gz yuzu-ff500a7b6838f2eaca25b79ce602c499a71b9c10.tar.xz yuzu-ff500a7b6838f2eaca25b79ce602c499a71b9c10.zip | |
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/service/audio')
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 8bf273b22..4217ea4fb 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -168,7 +168,7 @@ void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) { | |||
| 168 | IPC::RequestParser rp{ctx}; | 168 | IPC::RequestParser rp{ctx}; |
| 169 | 169 | ||
| 170 | const std::string audio_interface = "AudioInterface"; | 170 | const std::string audio_interface = "AudioInterface"; |
| 171 | ctx.WriteBuffer(audio_interface.c_str(), audio_interface.size()); | 171 | ctx.WriteBuffer(audio_interface); |
| 172 | 172 | ||
| 173 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); | 173 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); |
| 174 | 174 | ||
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index b7f591c6d..3bb15bd9f 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -299,7 +299,7 @@ private: | |||
| 299 | IPC::RequestParser rp{ctx}; | 299 | IPC::RequestParser rp{ctx}; |
| 300 | 300 | ||
| 301 | const std::string audio_interface = "AudioInterface"; | 301 | const std::string audio_interface = "AudioInterface"; |
| 302 | ctx.WriteBuffer(audio_interface.c_str(), audio_interface.size()); | 302 | ctx.WriteBuffer(audio_interface); |
| 303 | 303 | ||
| 304 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); | 304 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); |
| 305 | rb.Push(RESULT_SUCCESS); | 305 | rb.Push(RESULT_SUCCESS); |
| @@ -324,7 +324,7 @@ private: | |||
| 324 | IPC::RequestParser rp{ctx}; | 324 | IPC::RequestParser rp{ctx}; |
| 325 | 325 | ||
| 326 | const std::string audio_interface = "AudioDevice"; | 326 | const std::string audio_interface = "AudioDevice"; |
| 327 | ctx.WriteBuffer(audio_interface.c_str(), audio_interface.size()); | 327 | ctx.WriteBuffer(audio_interface); |
| 328 | 328 | ||
| 329 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); | 329 | IPC::ResponseBuilder rb = rp.MakeBuilder(3, 0, 0); |
| 330 | rb.Push(RESULT_SUCCESS); | 330 | rb.Push(RESULT_SUCCESS); |