From 7f506be2ee7cd0b432cc00d085406c01c7df4b0e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 4 Apr 2019 12:56:04 -0400 Subject: hle/service: Resolve unused variable warnings In several places, we have request parsers where there's nothing to really parse, simply because the HLE function in question operates on buffers. In these cases we can just remove these instances altogether. In the other cases, we can retrieve the relevant members from the parser and at least log them out, giving them some use. --- src/core/hle/service/audio/audout_u.cpp | 4 ---- src/core/hle/service/audio/audren_u.cpp | 13 ++++++------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/core/hle/service/audio') diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 21f5e64c7..39acb7b23 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -150,7 +150,6 @@ private: void GetReleasedAudioOutBufferImpl(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Audio, "called {}", ctx.Description()); - IPC::RequestParser rp{ctx}; const u64 max_count{ctx.GetWriteBufferSize() / sizeof(u64)}; const auto released_buffers{audio_core.GetTagsAndReleaseBuffers(stream, max_count)}; @@ -194,12 +193,9 @@ private: void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Audio, "called"); - IPC::RequestParser rp{ctx}; - ctx.WriteBuffer(DefaultDevice); IPC::ResponseBuilder rb{ctx, 3}; - rb.Push(RESULT_SUCCESS); rb.Push(1); // Amount of audio devices } diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index c9de10a24..1dde6edb7 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -10,6 +10,7 @@ #include "common/alignment.h" #include "common/common_funcs.h" #include "common/logging/log.h" +#include "common/string_util.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" @@ -184,7 +185,6 @@ public: private: void ListAudioDeviceName(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_Audio, "(STUBBED) called"); - IPC::RequestParser rp{ctx}; constexpr std::array audio_interface{{"AudioInterface"}}; ctx.WriteBuffer(audio_interface); @@ -195,13 +195,13 @@ private: } void SetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_Audio, "(STUBBED) called"); - IPC::RequestParser rp{ctx}; - f32 volume = static_cast(rp.Pop()); + const f32 volume = rp.Pop(); - auto file_buffer = ctx.ReadBuffer(); - auto end = std::find(file_buffer.begin(), file_buffer.end(), '\0'); + const auto device_name_buffer = ctx.ReadBuffer(); + const std::string name = Common::StringFromBuffer(device_name_buffer); + + LOG_WARNING(Service_Audio, "(STUBBED) called. name={}, volume={}", name, volume); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); @@ -209,7 +209,6 @@ private: void GetActiveAudioDeviceName(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_Audio, "(STUBBED) called"); - IPC::RequestParser rp{ctx}; constexpr std::array audio_interface{{"AudioDevice"}}; ctx.WriteBuffer(audio_interface); -- cgit v1.2.3