Merge pull request #8911 from lioncash/cexpr-string

audio_device: Make AudioDeviceName constructor constexpr
This commit is contained in:
Morph 2022-09-16 10:18:58 -04:00 committed by GitHub
commit 60aa942210
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 27 deletions

View file

@ -246,9 +246,8 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
const auto write_count =
static_cast<u32>(ctx.GetWriteBufferSize() / sizeof(AudioDevice::AudioDeviceName));
std::vector<AudioDevice::AudioDeviceName> device_names{};
std::string print_names{};
if (write_count > 0) {
device_names.push_back(AudioDevice::AudioDeviceName("DeviceOut"));
device_names.emplace_back("DeviceOut");
LOG_DEBUG(Service_Audio, "called. \nName=DeviceOut");
} else {
LOG_DEBUG(Service_Audio, "called. Empty buffer passed in.");

View file

@ -252,7 +252,7 @@ private:
std::vector<AudioDevice::AudioDeviceName> out_names{};
u32 out_count = impl->ListAudioDeviceName(out_names, in_count);
const u32 out_count = impl->ListAudioDeviceName(out_names, in_count);
std::string out{};
for (u32 i = 0; i < out_count; i++) {
@ -365,7 +365,7 @@ private:
std::vector<AudioDevice::AudioDeviceName> out_names{};
u32 out_count = impl->ListAudioOutputDeviceName(out_names, in_count);
const u32 out_count = impl->ListAudioOutputDeviceName(out_names, in_count);
std::string out{};
for (u32 i = 0; i < out_count; i++) {