From e0ec9ffc36892319a5cd847dfd42f6aba4671685 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 26 Oct 2022 11:15:25 -0400 Subject: audio_in/out_system: Pass Initialize members by value where applicable applet_resource_user_id isn't actually modified and is just assigned to a member variable, so this doesn't need to be a mutable reference. Similarly, the device name itself isn't modified and is only moved. We pass by value here, since we can still perform the move, but eliminate a sneaky set of calls that can unintentionally destroy the original string. Given how nested the calls are, it's good to get rid of this potential vector for a use-after-move bug. --- src/core/hle/service/audio/audin_u.cpp | 2 +- src/core/hle/service/audio/audout_u.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index 48a9a73a0..608925dfc 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp @@ -17,7 +17,7 @@ using namespace AudioCore::AudioIn; class IAudioIn final : public ServiceFramework { public: explicit IAudioIn(Core::System& system_, Manager& manager, size_t session_id, - std::string& device_name, const AudioInParameter& in_params, u32 handle, + const std::string& device_name, const AudioInParameter& in_params, u32 handle, u64 applet_resource_user_id) : ServiceFramework{system_, "IAudioIn"}, service_context{system_, "IAudioIn"}, event{service_context.CreateEvent("AudioInEvent")}, diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 49c092301..122290c6a 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -24,7 +24,7 @@ using namespace AudioCore::AudioOut; class IAudioOut final : public ServiceFramework { public: explicit IAudioOut(Core::System& system_, AudioCore::AudioOut::Manager& manager, - size_t session_id, std::string& device_name, + size_t session_id, const std::string& device_name, const AudioOutParameter& in_params, u32 handle, u64 applet_resource_user_id) : ServiceFramework{system_, "IAudioOut", ServiceThreadType::CreateNew}, service_context{system_, "IAudioOut"}, event{service_context.CreateEvent( -- cgit v1.2.3