forked from ShuriZma/suyu
1
0
Fork 0

Merge pull request #5360 from ReinUsesLisp/enforce-memclass-access

core: Silence Wclass-memaccess warnings and enforce it
This commit is contained in:
bunnei 2021-01-17 00:55:10 -08:00 committed by GitHub
commit e8401964b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 216 additions and 205 deletions

View File

@ -86,28 +86,28 @@ struct BehaviorFlags {
static_assert(sizeof(BehaviorFlags) == 0x4, "BehaviorFlags is an invalid size"); static_assert(sizeof(BehaviorFlags) == 0x4, "BehaviorFlags is an invalid size");
struct ADPCMContext { struct ADPCMContext {
u16 header{}; u16 header;
s16 yn1{}; s16 yn1;
s16 yn2{}; s16 yn2;
}; };
static_assert(sizeof(ADPCMContext) == 0x6, "ADPCMContext is an invalid size"); static_assert(sizeof(ADPCMContext) == 0x6, "ADPCMContext is an invalid size");
struct VoiceState { struct VoiceState {
s64 played_sample_count{}; s64 played_sample_count;
s32 offset{}; s32 offset;
s32 wave_buffer_index{}; s32 wave_buffer_index;
std::array<bool, AudioCommon::MAX_WAVE_BUFFERS> is_wave_buffer_valid{}; std::array<bool, AudioCommon::MAX_WAVE_BUFFERS> is_wave_buffer_valid;
s32 wave_buffer_consumed{}; s32 wave_buffer_consumed;
std::array<s32, AudioCommon::MAX_SAMPLE_HISTORY> sample_history{}; std::array<s32, AudioCommon::MAX_SAMPLE_HISTORY> sample_history;
s32 fraction{}; s32 fraction;
VAddr context_address{}; VAddr context_address;
Codec::ADPCM_Coeff coeff{}; Codec::ADPCM_Coeff coeff;
ADPCMContext context{}; ADPCMContext context;
std::array<s64, 2> biquad_filter_state{}; std::array<s64, 2> biquad_filter_state;
std::array<s32, AudioCommon::MAX_MIX_BUFFERS> previous_samples{}; std::array<s32, AudioCommon::MAX_MIX_BUFFERS> previous_samples;
u32 external_context_size{}; u32 external_context_size;
bool is_external_context_used{}; bool is_external_context_used;
bool voice_dropped{}; bool voice_dropped;
}; };
class VoiceChannelResource { class VoiceChannelResource {

View File

@ -14,8 +14,8 @@ constexpr u128 INVALID_UUID{{0, 0}};
struct UUID { struct UUID {
// UUIDs which are 0 are considered invalid! // UUIDs which are 0 are considered invalid!
u128 uuid = INVALID_UUID; u128 uuid;
constexpr UUID() = default; UUID() = default;
constexpr explicit UUID(const u128& id) : uuid{id} {} constexpr explicit UUID(const u128& id) : uuid{id} {}
constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {}

View File

@ -645,6 +645,7 @@ else()
-Werror=implicit-fallthrough -Werror=implicit-fallthrough
-Werror=sign-compare -Werror=sign-compare
$<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess>
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>

View File

@ -58,7 +58,7 @@ struct SaveDataAttribute {
SaveDataType type; SaveDataType type;
SaveDataRank rank; SaveDataRank rank;
u16 index; u16 index;
INSERT_PADDING_BYTES(4); INSERT_PADDING_BYTES_NOINIT(4);
u64 zero_1; u64 zero_1;
u64 zero_2; u64 zero_2;
u64 zero_3; u64 zero_3;
@ -72,7 +72,7 @@ struct SaveDataExtraData {
u64 owner_id; u64 owner_id;
s64 timestamp; s64 timestamp;
SaveDataFlags flags; SaveDataFlags flags;
INSERT_PADDING_BYTES(4); INSERT_PADDING_BYTES_NOINIT(4);
s64 available_size; s64 available_size;
s64 journal_size; s64 journal_size;
s64 commit_id; s64 commit_id;

View File

@ -146,7 +146,7 @@ static_assert(sizeof(BufferDescriptorC) == 8, "BufferDescriptorC size is incorre
struct DataPayloadHeader { struct DataPayloadHeader {
u32_le magic; u32_le magic;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
}; };
static_assert(sizeof(DataPayloadHeader) == 8, "DataPayloadHeader size is incorrect"); static_assert(sizeof(DataPayloadHeader) == 8, "DataPayloadHeader size is incorrect");
@ -174,7 +174,7 @@ struct DomainMessageHeader {
INSERT_PADDING_WORDS_NOINIT(2); INSERT_PADDING_WORDS_NOINIT(2);
}; };
std::array<u32, 4> raw{}; std::array<u32, 4> raw;
}; };
}; };
static_assert(sizeof(DomainMessageHeader) == 16, "DomainMessageHeader size is incorrect"); static_assert(sizeof(DomainMessageHeader) == 16, "DomainMessageHeader size is incorrect");

View File

@ -534,7 +534,7 @@ private:
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
Common::UUID user_id; Common::UUID user_id{Common::INVALID_UUID};
}; };
// 6.0.0+ // 6.0.0+

View File

@ -227,8 +227,8 @@ void ProfileManager::CloseUser(UUID uuid) {
/// Gets all valid user ids on the system /// Gets all valid user ids on the system
UserIDArray ProfileManager::GetAllUsers() const { UserIDArray ProfileManager::GetAllUsers() const {
UserIDArray output; UserIDArray output{};
std::transform(profiles.begin(), profiles.end(), output.begin(), std::ranges::transform(profiles, output.begin(),
[](const ProfileInfo& p) { return p.user_uuid; }); [](const ProfileInfo& p) { return p.user_uuid; });
return output; return output;
} }
@ -236,8 +236,8 @@ UserIDArray ProfileManager::GetAllUsers() const {
/// Get all the open users on the system and zero out the rest of the data. This is specifically /// Get all the open users on the system and zero out the rest of the data. This is specifically
/// needed for GetOpenUsers and we need to ensure the rest of the output buffer is zero'd out /// needed for GetOpenUsers and we need to ensure the rest of the output buffer is zero'd out
UserIDArray ProfileManager::GetOpenUsers() const { UserIDArray ProfileManager::GetOpenUsers() const {
UserIDArray output; UserIDArray output{};
std::transform(profiles.begin(), profiles.end(), output.begin(), [](const ProfileInfo& p) { std::ranges::transform(profiles, output.begin(), [](const ProfileInfo& p) {
if (p.is_open) if (p.is_open)
return p.user_uuid; return p.user_uuid;
return UUID{Common::INVALID_UUID}; return UUID{Common::INVALID_UUID};

View File

@ -23,12 +23,12 @@ using UserIDArray = std::array<Common::UUID, MAX_USERS>;
/// Contains extra data related to a user. /// Contains extra data related to a user.
/// TODO: RE this structure /// TODO: RE this structure
struct ProfileData { struct ProfileData {
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u32 icon_id{}; u32 icon_id;
u8 bg_color_id{}; u8 bg_color_id;
INSERT_PADDING_BYTES(0x7); INSERT_PADDING_BYTES_NOINIT(0x7);
INSERT_PADDING_BYTES(0x10); INSERT_PADDING_BYTES_NOINIT(0x10);
INSERT_PADDING_BYTES(0x60); INSERT_PADDING_BYTES_NOINIT(0x60);
}; };
static_assert(sizeof(ProfileData) == 0x80, "ProfileData structure has incorrect size"); static_assert(sizeof(ProfileData) == 0x80, "ProfileData structure has incorrect size");
@ -43,9 +43,9 @@ struct ProfileInfo {
}; };
struct ProfileBase { struct ProfileBase {
Common::UUID user_uuid{Common::INVALID_UUID}; Common::UUID user_uuid;
u64_le timestamp{}; u64_le timestamp;
ProfileUsername username{}; ProfileUsername username;
// Zero out all the fields to make the profile slot considered "Empty" // Zero out all the fields to make the profile slot considered "Empty"
void Invalidate() { void Invalidate() {

View File

@ -29,7 +29,7 @@ constexpr int DefaultSampleRate{48000};
struct AudoutParams { struct AudoutParams {
s32_le sample_rate; s32_le sample_rate;
u16_le channel_count; u16_le channel_count;
INSERT_PADDING_BYTES(2); INSERT_PADDING_BYTES_NOINIT(2);
}; };
static_assert(sizeof(AudoutParams) == 0x8, "AudoutParams is an invalid size"); static_assert(sizeof(AudoutParams) == 0x8, "AudoutParams is an invalid size");

View File

@ -141,7 +141,9 @@ bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) {
device_handle.device_index < DeviceIndex::MaxDeviceIndex; device_handle.device_index < DeviceIndex::MaxDeviceIndex;
} }
Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {} Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {
latest_vibration_values.fill({DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE});
}
Controller_NPad::~Controller_NPad() { Controller_NPad::~Controller_NPad() {
OnRelease(); OnRelease();
@ -732,7 +734,7 @@ bool Controller_NPad::VibrateControllerAtIndex(std::size_t npad_index, std::size
// Send an empty vibration to stop any vibrations. // Send an empty vibration to stop any vibrations.
vibrations[npad_index][device_index]->SetRumblePlay(0.0f, 160.0f, 0.0f, 320.0f); vibrations[npad_index][device_index]->SetRumblePlay(0.0f, 160.0f, 0.0f, 320.0f);
// Then reset the vibration value to its default value. // Then reset the vibration value to its default value.
latest_vibration_values[npad_index][device_index] = {}; latest_vibration_values[npad_index][device_index] = DEFAULT_VIBRATION_VALUE;
} }
return false; return false;

View File

@ -97,10 +97,10 @@ public:
}; };
struct DeviceHandle { struct DeviceHandle {
NpadType npad_type{}; NpadType npad_type;
u8 npad_id{}; u8 npad_id;
DeviceIndex device_index{}; DeviceIndex device_index;
INSERT_PADDING_BYTES(1); INSERT_PADDING_BYTES_NOINIT(1);
}; };
static_assert(sizeof(DeviceHandle) == 4, "DeviceHandle is an invalid size"); static_assert(sizeof(DeviceHandle) == 4, "DeviceHandle is an invalid size");
@ -120,13 +120,20 @@ public:
static_assert(sizeof(NpadStyleSet) == 4, "NpadStyleSet is an invalid size"); static_assert(sizeof(NpadStyleSet) == 4, "NpadStyleSet is an invalid size");
struct VibrationValue { struct VibrationValue {
f32 amp_low{0.0f}; f32 amp_low;
f32 freq_low{160.0f}; f32 freq_low;
f32 amp_high{0.0f}; f32 amp_high;
f32 freq_high{320.0f}; f32 freq_high;
}; };
static_assert(sizeof(VibrationValue) == 0x10, "Vibration is an invalid size"); static_assert(sizeof(VibrationValue) == 0x10, "Vibration is an invalid size");
static constexpr VibrationValue DEFAULT_VIBRATION_VALUE{
.amp_low = 0.0f,
.freq_low = 160.0f,
.amp_high = 0.0f,
.freq_high = 320.0f,
};
struct LedPattern { struct LedPattern {
explicit LedPattern(u64 light1, u64 light2, u64 light3, u64 light4) { explicit LedPattern(u64 light1, u64 light2, u64 light3, u64 light4) {
position1.Assign(light1); position1.Assign(light1);

View File

@ -401,9 +401,9 @@ void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) {
void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) { void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 basic_xpad_id{}; u32 basic_xpad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -431,9 +431,9 @@ void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) {
void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -452,9 +452,9 @@ void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -473,9 +473,9 @@ void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -494,9 +494,9 @@ void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -515,10 +515,10 @@ void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
bool enable_sixaxis_sensor_fusion{}; bool enable_sixaxis_sensor_fusion;
INSERT_PADDING_BYTES(3); INSERT_PADDING_BYTES_NOINIT(3);
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -556,9 +556,9 @@ void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -577,9 +577,9 @@ void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -599,9 +599,9 @@ void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -620,9 +620,9 @@ void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
void Hid::ActivateGesture(Kernel::HLERequestContext& ctx) { void Hid::ActivateGesture(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 unknown{}; u32 unknown;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -702,10 +702,10 @@ void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) {
void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
u64 unknown{}; u64 unknown;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -722,9 +722,9 @@ void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
void Hid::DisconnectNpad(Kernel::HLERequestContext& ctx) { void Hid::DisconnectNpad(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -756,9 +756,9 @@ void Hid::ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
// Should have no effect with how our npad sets up the data // Should have no effect with how our npad sets up the data
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 unknown{}; u32 unknown;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -800,9 +800,9 @@ void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) { void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -821,10 +821,10 @@ void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
// TODO: Check the differences between this and SetNpadJoyAssignmentModeSingleByDefault // TODO: Check the differences between this and SetNpadJoyAssignmentModeSingleByDefault
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
u64 npad_joy_device_type{}; u64 npad_joy_device_type;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -844,9 +844,9 @@ void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -952,9 +952,9 @@ void Hid::SwapNpadAssignment(Kernel::HLERequestContext& ctx) {
void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx) { void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
u32 npad_id{}; u32 npad_id;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -971,10 +971,10 @@ void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext
void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx) { void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
bool unintended_home_button_input_protection{}; bool unintended_home_button_input_protection;
INSERT_PADDING_BYTES(3); INSERT_PADDING_BYTES_NOINIT(3);
u32 npad_id{}; u32 npad_id;
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -1026,10 +1026,10 @@ void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) {
void Hid::SendVibrationValue(Kernel::HLERequestContext& ctx) { void Hid::SendVibrationValue(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle vibration_device_handle{}; Controller_NPad::DeviceHandle vibration_device_handle;
Controller_NPad::VibrationValue vibration_value{}; Controller_NPad::VibrationValue vibration_value;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -1050,9 +1050,9 @@ void Hid::SendVibrationValue(Kernel::HLERequestContext& ctx) {
void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) { void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle vibration_device_handle{}; Controller_NPad::DeviceHandle vibration_device_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -1147,9 +1147,9 @@ void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) { void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle vibration_device_handle{}; Controller_NPad::DeviceHandle vibration_device_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -1180,9 +1180,9 @@ void Hid::ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};
@ -1200,9 +1200,9 @@ void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
struct Parameters { struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle{}; Controller_NPad::DeviceHandle sixaxis_handle;
INSERT_PADDING_WORDS(1); INSERT_PADDING_WORDS_NOINIT(1);
u64 applet_resource_user_id{}; u64 applet_resource_user_id;
}; };
const auto parameters{rp.PopRaw<Parameters>()}; const auto parameters{rp.PopRaw<Parameters>()};

View File

@ -100,6 +100,7 @@ MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) {
.mole_scale = static_cast<u8>(bf.mole_scale.Value()), .mole_scale = static_cast<u8>(bf.mole_scale.Value()),
.mole_x = static_cast<u8>(bf.mole_x.Value()), .mole_x = static_cast<u8>(bf.mole_x.Value()),
.mole_y = static_cast<u8>(bf.mole_y.Value()), .mole_y = static_cast<u8>(bf.mole_y.Value()),
.padding = 0,
}; };
} }

View File

@ -27,58 +27,58 @@ enum class SourceFlag : u32 {
DECLARE_ENUM_FLAG_OPERATORS(SourceFlag); DECLARE_ENUM_FLAG_OPERATORS(SourceFlag);
struct MiiInfo { struct MiiInfo {
Common::UUID uuid{Common::INVALID_UUID}; Common::UUID uuid;
std::array<char16_t, 11> name{}; std::array<char16_t, 11> name;
u8 font_region{}; u8 font_region;
u8 favorite_color{}; u8 favorite_color;
u8 gender{}; u8 gender;
u8 height{}; u8 height;
u8 build{}; u8 build;
u8 type{}; u8 type;
u8 region_move{}; u8 region_move;
u8 faceline_type{}; u8 faceline_type;
u8 faceline_color{}; u8 faceline_color;
u8 faceline_wrinkle{}; u8 faceline_wrinkle;
u8 faceline_make{}; u8 faceline_make;
u8 hair_type{}; u8 hair_type;
u8 hair_color{}; u8 hair_color;
u8 hair_flip{}; u8 hair_flip;
u8 eye_type{}; u8 eye_type;
u8 eye_color{}; u8 eye_color;
u8 eye_scale{}; u8 eye_scale;
u8 eye_aspect{}; u8 eye_aspect;
u8 eye_rotate{}; u8 eye_rotate;
u8 eye_x{}; u8 eye_x;
u8 eye_y{}; u8 eye_y;
u8 eyebrow_type{}; u8 eyebrow_type;
u8 eyebrow_color{}; u8 eyebrow_color;
u8 eyebrow_scale{}; u8 eyebrow_scale;
u8 eyebrow_aspect{}; u8 eyebrow_aspect;
u8 eyebrow_rotate{}; u8 eyebrow_rotate;
u8 eyebrow_x{}; u8 eyebrow_x;
u8 eyebrow_y{}; u8 eyebrow_y;
u8 nose_type{}; u8 nose_type;
u8 nose_scale{}; u8 nose_scale;
u8 nose_y{}; u8 nose_y;
u8 mouth_type{}; u8 mouth_type;
u8 mouth_color{}; u8 mouth_color;
u8 mouth_scale{}; u8 mouth_scale;
u8 mouth_aspect{}; u8 mouth_aspect;
u8 mouth_y{}; u8 mouth_y;
u8 beard_color{}; u8 beard_color;
u8 beard_type{}; u8 beard_type;
u8 mustache_type{}; u8 mustache_type;
u8 mustache_scale{}; u8 mustache_scale;
u8 mustache_y{}; u8 mustache_y;
u8 glasses_type{}; u8 glasses_type;
u8 glasses_color{}; u8 glasses_color;
u8 glasses_scale{}; u8 glasses_scale;
u8 glasses_y{}; u8 glasses_y;
u8 mole_type{}; u8 mole_type;
u8 mole_scale{}; u8 mole_scale;
u8 mole_x{}; u8 mole_x;
u8 mole_y{}; u8 mole_y;
INSERT_PADDING_BYTES(1); u8 padding;
std::u16string Name() const; std::u16string Name() const;
}; };
@ -324,7 +324,7 @@ public:
ResultCode GetIndex(const MiiInfo& info, u32& index); ResultCode GetIndex(const MiiInfo& info, u32& index);
private: private:
const Common::UUID user_id; const Common::UUID user_id{Common::INVALID_UUID};
u64 update_counter{}; u64 update_counter{};
}; };

View File

@ -73,19 +73,19 @@ struct TimeSpanType {
static_assert(sizeof(TimeSpanType) == 8, "TimeSpanType is incorrect size"); static_assert(sizeof(TimeSpanType) == 8, "TimeSpanType is incorrect size");
struct ClockSnapshot { struct ClockSnapshot {
SystemClockContext user_context{}; SystemClockContext user_context;
SystemClockContext network_context{}; SystemClockContext network_context;
s64 user_time{}; s64 user_time;
s64 network_time{}; s64 network_time;
TimeZone::CalendarTime user_calendar_time{}; TimeZone::CalendarTime user_calendar_time;
TimeZone::CalendarTime network_calendar_time{}; TimeZone::CalendarTime network_calendar_time;
TimeZone::CalendarAdditionalInfo user_calendar_additional_time{}; TimeZone::CalendarAdditionalInfo user_calendar_additional_time;
TimeZone::CalendarAdditionalInfo network_calendar_additional_time{}; TimeZone::CalendarAdditionalInfo network_calendar_additional_time;
SteadyClockTimePoint steady_clock_time_point{}; SteadyClockTimePoint steady_clock_time_point;
TimeZone::LocationName location_name{}; TimeZone::LocationName location_name;
u8 is_automatic_correction_enabled{}; u8 is_automatic_correction_enabled;
u8 type{}; u8 type;
INSERT_PADDING_BYTES(0x2); INSERT_PADDING_BYTES_NOINIT(0x2);
static ResultCode GetCurrentTime(s64& current_time, static ResultCode GetCurrentTime(s64& current_time,
const SteadyClockTimePoint& steady_clock_time_point, const SteadyClockTimePoint& steady_clock_time_point,

View File

@ -45,23 +45,23 @@ static_assert(sizeof(TimeZoneRule) == 0x4000, "TimeZoneRule is incorrect size");
/// https://switchbrew.org/wiki/Glue_services#CalendarAdditionalInfo /// https://switchbrew.org/wiki/Glue_services#CalendarAdditionalInfo
struct CalendarAdditionalInfo { struct CalendarAdditionalInfo {
u32 day_of_week{}; u32 day_of_week;
u32 day_of_year{}; u32 day_of_year;
std::array<char, 8> timezone_name; std::array<char, 8> timezone_name;
u32 is_dst{}; u32 is_dst;
s32 gmt_offset{}; s32 gmt_offset;
}; };
static_assert(sizeof(CalendarAdditionalInfo) == 0x18, "CalendarAdditionalInfo is incorrect size"); static_assert(sizeof(CalendarAdditionalInfo) == 0x18, "CalendarAdditionalInfo is incorrect size");
/// https://switchbrew.org/wiki/Glue_services#CalendarTime /// https://switchbrew.org/wiki/Glue_services#CalendarTime
struct CalendarTime { struct CalendarTime {
s16 year{}; s16 year;
s8 month{}; s8 month;
s8 day{}; s8 day;
s8 hour{}; s8 hour;
s8 minute{}; s8 minute;
s8 second{}; s8 second;
INSERT_PADDING_BYTES(1); INSERT_PADDING_BYTES_NOINIT(1);
}; };
static_assert(sizeof(CalendarTime) == 0x8, "CalendarTime is incorrect size"); static_assert(sizeof(CalendarTime) == 0x8, "CalendarTime is incorrect size");

View File

@ -93,7 +93,7 @@ QtProfileSelectionDialog::QtProfileSelectionDialog(QWidget* parent)
const auto& profiles = profile_manager->GetAllUsers(); const auto& profiles = profile_manager->GetAllUsers();
for (const auto& user : profiles) { for (const auto& user : profiles) {
Service::Account::ProfileBase profile; Service::Account::ProfileBase profile{};
if (!profile_manager->GetProfileBase(user, profile)) if (!profile_manager->GetProfileBase(user, profile))
continue; continue;

View File

@ -40,7 +40,7 @@ QString GetImagePath(Common::UUID uuid) {
} }
QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) { QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) {
Service::Account::ProfileBase profile; Service::Account::ProfileBase profile{};
if (!manager.GetProfileBase(uuid, profile)) { if (!manager.GetProfileBase(uuid, profile)) {
return {}; return {};
} }
@ -147,7 +147,7 @@ void ConfigureProfileManager::SetConfiguration() {
void ConfigureProfileManager::PopulateUserList() { void ConfigureProfileManager::PopulateUserList() {
const auto& profiles = profile_manager->GetAllUsers(); const auto& profiles = profile_manager->GetAllUsers();
for (const auto& user : profiles) { for (const auto& user : profiles) {
Service::Account::ProfileBase profile; Service::Account::ProfileBase profile{};
if (!profile_manager->GetProfileBase(user, profile)) if (!profile_manager->GetProfileBase(user, profile))
continue; continue;
@ -212,7 +212,7 @@ void ConfigureProfileManager::RenameUser() {
const auto uuid = profile_manager->GetUser(user); const auto uuid = profile_manager->GetUser(user);
ASSERT(uuid); ASSERT(uuid);
Service::Account::ProfileBase profile; Service::Account::ProfileBase profile{};
if (!profile_manager->GetProfileBase(*uuid, profile)) if (!profile_manager->GetProfileBase(*uuid, profile))
return; return;