From ebe9d3b0a2e6ec359f01c8f54c4aea99d833c115 Mon Sep 17 00:00:00 2001 From: Andrea V <1577639+karimodm@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:57:05 +0100 Subject: [PATCH] Introduced default constructors to fix compile --- src/core/hle/service/cmif_types.h | 6 ++++-- src/core/hle/service/set/settings_types.h | 8 ++++++++ src/core/hle/service/set/system_settings_server.cpp | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/cmif_types.h b/src/core/hle/service/cmif_types.h index dad358b87c..9dc90a50dc 100644 --- a/src/core/hle/service/cmif_types.h +++ b/src/core/hle/service/cmif_types.h @@ -12,8 +12,10 @@ namespace Service { // clang-format off template -struct AutoOut { - T raw; +class AutoOut { + public: + T raw; + AutoOut() : raw() {} }; template diff --git a/src/core/hle/service/set/settings_types.h b/src/core/hle/service/set/settings_types.h index 92c2948b00..848722e196 100644 --- a/src/core/hle/service/set/settings_types.h +++ b/src/core/hle/service/set/settings_types.h @@ -401,6 +401,10 @@ static_assert(sizeof(AccountNotificationSettings) == 0x18, /// This is nn::settings::factory::BatteryLot struct BatteryLot { std::array lot_number; + BatteryLot() = default; + BatteryLot(const char* str) { + std::copy(str, str + std::min(sizeof(lot_number), strlen(str)), lot_number.begin()); + } }; static_assert(sizeof(BatteryLot) == 0x18, "BatteryLot is an invalid size"); @@ -477,6 +481,10 @@ static_assert(sizeof(NotificationSettings) == 0x18, "NotificationSettings is an /// This is nn::settings::factory::SerialNumber struct SerialNumber { std::array serial_number; + SerialNumber() = default; + SerialNumber(const char* str) { + std::copy(str, str + std::min(sizeof(serial_number), strlen(str)), serial_number.begin()); + } }; static_assert(sizeof(SerialNumber) == 0x18, "SerialNumber is an invalid size"); diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 0dc8db8212..4ae3b0e700 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -932,14 +932,14 @@ Result ISystemSettingsServer::SetPrimaryAlbumStorage(PrimaryAlbumStorage primary Result ISystemSettingsServer::GetBatteryLot(Out out_battery_lot) { LOG_INFO(Service_SET, "called"); - *out_battery_lot = {"YUZU0EMULATOR14022024"}; + *out_battery_lot = BatteryLot("YUZU0EMULATOR14022024"); R_SUCCEED(); } Result ISystemSettingsServer::GetSerialNumber(Out out_console_serial) { LOG_INFO(Service_SET, "called"); - *out_console_serial = {"YUZ10000000001"}; + *out_console_serial = SerialNumber("YUZ10000000001"); R_SUCCEED(); }