mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-30 15:37:53 -05:00
core: Fix clang build
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
This commit is contained in:
@ -23,7 +23,7 @@ void Controller_DebugPad::OnRelease() {}
|
||||
|
||||
void Controller_DebugPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
shared_memory.header.timestamp = core_timing.GetCPUTicks();
|
||||
shared_memory.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
shared_memory.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -33,9 +33,11 @@ void Controller_DebugPad::OnUpdate(const Core::Timing::CoreTiming& core_timing,
|
||||
}
|
||||
shared_memory.header.entry_count = 16;
|
||||
|
||||
const auto& last_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
|
||||
const auto& last_entry =
|
||||
shared_memory.pad_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
shared_memory.pad_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
@ -19,7 +19,7 @@ void Controller_Gesture::OnRelease() {}
|
||||
|
||||
void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
shared_memory.header.timestamp = core_timing.GetCPUTicks();
|
||||
shared_memory.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
shared_memory.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -29,9 +29,11 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u
|
||||
}
|
||||
shared_memory.header.entry_count = 16;
|
||||
|
||||
const auto& last_entry = shared_memory.gesture_states[shared_memory.header.last_entry_index];
|
||||
const auto& last_entry =
|
||||
shared_memory.gesture_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = shared_memory.gesture_states[shared_memory.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
shared_memory.gesture_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
@ -21,7 +21,7 @@ void Controller_Keyboard::OnRelease() {}
|
||||
|
||||
void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
shared_memory.header.timestamp = core_timing.GetCPUTicks();
|
||||
shared_memory.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
shared_memory.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -31,9 +31,11 @@ void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing,
|
||||
}
|
||||
shared_memory.header.entry_count = 16;
|
||||
|
||||
const auto& last_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
|
||||
const auto& last_entry =
|
||||
shared_memory.pad_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
shared_memory.pad_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
@ -19,7 +19,7 @@ void Controller_Mouse::OnRelease() {}
|
||||
|
||||
void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
shared_memory.header.timestamp = core_timing.GetCPUTicks();
|
||||
shared_memory.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
shared_memory.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -29,9 +29,11 @@ void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
}
|
||||
shared_memory.header.entry_count = 16;
|
||||
|
||||
auto& last_entry = shared_memory.mouse_states[shared_memory.header.last_entry_index];
|
||||
auto& last_entry =
|
||||
shared_memory.mouse_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = shared_memory.mouse_states[shared_memory.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
shared_memory.mouse_states[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
@ -341,26 +341,29 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
}
|
||||
for (std::size_t i = 0; i < shared_memory_entries.size(); i++) {
|
||||
auto& npad = shared_memory_entries[i];
|
||||
const std::array<NPadGeneric*, 7> controller_npads{&npad.main_controller_states,
|
||||
&npad.handheld_states,
|
||||
&npad.dual_states,
|
||||
&npad.left_joy_states,
|
||||
&npad.right_joy_states,
|
||||
&npad.pokeball_states,
|
||||
&npad.libnx};
|
||||
const std::array controller_npads{
|
||||
&npad.main_controller_states,
|
||||
&npad.handheld_states,
|
||||
&npad.dual_states,
|
||||
&npad.left_joy_states,
|
||||
&npad.right_joy_states,
|
||||
&npad.pokeball_states,
|
||||
&npad.libnx,
|
||||
};
|
||||
|
||||
for (auto* main_controller : controller_npads) {
|
||||
main_controller->common.entry_count = 16;
|
||||
main_controller->common.total_entry_count = 17;
|
||||
|
||||
const auto& last_entry =
|
||||
main_controller->npad[main_controller->common.last_entry_index];
|
||||
main_controller->npad[static_cast<u64>(main_controller->common.last_entry_index)];
|
||||
|
||||
main_controller->common.timestamp = core_timing.GetCPUTicks();
|
||||
main_controller->common.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
main_controller->common.last_entry_index =
|
||||
(main_controller->common.last_entry_index + 1) % 17;
|
||||
|
||||
auto& cur_entry = main_controller->npad[main_controller->common.last_entry_index];
|
||||
auto& cur_entry =
|
||||
main_controller->npad[static_cast<u64>(main_controller->common.last_entry_index)];
|
||||
|
||||
cur_entry.timestamp = last_entry.timestamp + 1;
|
||||
cur_entry.timestamp2 = cur_entry.timestamp;
|
||||
@ -371,22 +374,29 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
if (controller_type == NPadControllerType::None || !connected_controllers[i].is_connected) {
|
||||
continue;
|
||||
}
|
||||
const u32 npad_index = static_cast<u32>(i);
|
||||
const auto npad_index = static_cast<u32>(i);
|
||||
|
||||
RequestPadStateUpdate(npad_index);
|
||||
auto& pad_state = npad_pad_states[npad_index];
|
||||
|
||||
auto& main_controller =
|
||||
npad.main_controller_states.npad[npad.main_controller_states.common.last_entry_index];
|
||||
npad.main_controller_states
|
||||
.npad[static_cast<u64>(npad.main_controller_states.common.last_entry_index)];
|
||||
auto& handheld_entry =
|
||||
npad.handheld_states.npad[npad.handheld_states.common.last_entry_index];
|
||||
auto& dual_entry = npad.dual_states.npad[npad.dual_states.common.last_entry_index];
|
||||
auto& left_entry = npad.left_joy_states.npad[npad.left_joy_states.common.last_entry_index];
|
||||
npad.handheld_states
|
||||
.npad[static_cast<u64>(npad.handheld_states.common.last_entry_index)];
|
||||
auto& dual_entry =
|
||||
npad.dual_states.npad[static_cast<u64>(npad.dual_states.common.last_entry_index)];
|
||||
auto& left_entry =
|
||||
npad.left_joy_states
|
||||
.npad[static_cast<u64>(npad.left_joy_states.common.last_entry_index)];
|
||||
auto& right_entry =
|
||||
npad.right_joy_states.npad[npad.right_joy_states.common.last_entry_index];
|
||||
npad.right_joy_states
|
||||
.npad[static_cast<u64>(npad.right_joy_states.common.last_entry_index)];
|
||||
auto& pokeball_entry =
|
||||
npad.pokeball_states.npad[npad.pokeball_states.common.last_entry_index];
|
||||
auto& libnx_entry = npad.libnx.npad[npad.libnx.common.last_entry_index];
|
||||
npad.pokeball_states
|
||||
.npad[static_cast<u64>(npad.pokeball_states.common.last_entry_index)];
|
||||
auto& libnx_entry = npad.libnx.npad[static_cast<u64>(npad.libnx.common.last_entry_index)];
|
||||
|
||||
libnx_entry.connection_status.raw = 0;
|
||||
libnx_entry.connection_status.IsConnected.Assign(1);
|
||||
@ -500,13 +510,14 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
sixaxis_sensor->common.total_entry_count = 17;
|
||||
|
||||
const auto& last_entry =
|
||||
sixaxis_sensor->sixaxis[sixaxis_sensor->common.last_entry_index];
|
||||
sixaxis_sensor->sixaxis[static_cast<u64>(sixaxis_sensor->common.last_entry_index)];
|
||||
|
||||
sixaxis_sensor->common.timestamp = core_timing.GetCPUTicks();
|
||||
sixaxis_sensor->common.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
sixaxis_sensor->common.last_entry_index =
|
||||
(sixaxis_sensor->common.last_entry_index + 1) % 17;
|
||||
|
||||
auto& cur_entry = sixaxis_sensor->sixaxis[sixaxis_sensor->common.last_entry_index];
|
||||
auto& cur_entry =
|
||||
sixaxis_sensor->sixaxis[static_cast<u64>(sixaxis_sensor->common.last_entry_index)];
|
||||
|
||||
cur_entry.timestamp = last_entry.timestamp + 1;
|
||||
cur_entry.timestamp2 = cur_entry.timestamp;
|
||||
@ -529,17 +540,21 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
|
||||
}
|
||||
|
||||
auto& full_sixaxis_entry =
|
||||
npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index];
|
||||
npad.sixaxis_full.sixaxis[static_cast<u64>(npad.sixaxis_full.common.last_entry_index)];
|
||||
auto& handheld_sixaxis_entry =
|
||||
npad.sixaxis_handheld.sixaxis[npad.sixaxis_handheld.common.last_entry_index];
|
||||
npad.sixaxis_handheld
|
||||
.sixaxis[static_cast<u64>(npad.sixaxis_handheld.common.last_entry_index)];
|
||||
auto& dual_left_sixaxis_entry =
|
||||
npad.sixaxis_dual_left.sixaxis[npad.sixaxis_dual_left.common.last_entry_index];
|
||||
npad.sixaxis_dual_left
|
||||
.sixaxis[static_cast<u64>(npad.sixaxis_dual_left.common.last_entry_index)];
|
||||
auto& dual_right_sixaxis_entry =
|
||||
npad.sixaxis_dual_right.sixaxis[npad.sixaxis_dual_right.common.last_entry_index];
|
||||
npad.sixaxis_dual_right
|
||||
.sixaxis[static_cast<u64>(npad.sixaxis_dual_right.common.last_entry_index)];
|
||||
auto& left_sixaxis_entry =
|
||||
npad.sixaxis_left.sixaxis[npad.sixaxis_left.common.last_entry_index];
|
||||
npad.sixaxis_left.sixaxis[static_cast<u64>(npad.sixaxis_left.common.last_entry_index)];
|
||||
auto& right_sixaxis_entry =
|
||||
npad.sixaxis_right.sixaxis[npad.sixaxis_right.common.last_entry_index];
|
||||
npad.sixaxis_right
|
||||
.sixaxis[static_cast<u64>(npad.sixaxis_right.common.last_entry_index)];
|
||||
|
||||
switch (controller_type) {
|
||||
case NPadControllerType::None:
|
||||
|
@ -22,12 +22,12 @@ void Controller_Stubbed::OnUpdate(const Core::Timing::CoreTiming& core_timing, u
|
||||
return;
|
||||
}
|
||||
|
||||
CommonHeader header{};
|
||||
header.timestamp = core_timing.GetCPUTicks();
|
||||
header.total_entry_count = 17;
|
||||
header.entry_count = 0;
|
||||
header.last_entry_index = 0;
|
||||
|
||||
const CommonHeader header{
|
||||
.timestamp = static_cast<s64>(core_timing.GetCPUTicks()),
|
||||
.total_entry_count = 17,
|
||||
.last_entry_index = 0,
|
||||
.entry_count = 0,
|
||||
};
|
||||
std::memcpy(data + common_offset, &header, sizeof(CommonHeader));
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ void Controller_Touchscreen::OnRelease() {}
|
||||
|
||||
void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
shared_memory.header.timestamp = core_timing.GetCPUTicks();
|
||||
shared_memory.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
shared_memory.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -33,9 +33,12 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin
|
||||
shared_memory.header.entry_count = 16;
|
||||
|
||||
const auto& last_entry =
|
||||
shared_memory.shared_memory_entries[shared_memory.header.last_entry_index];
|
||||
shared_memory
|
||||
.shared_memory_entries[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = shared_memory.shared_memory_entries[shared_memory.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
shared_memory
|
||||
.shared_memory_entries[static_cast<u64>(shared_memory.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
@ -69,6 +69,6 @@ private:
|
||||
TouchScreenSharedMemory shared_memory{};
|
||||
std::unique_ptr<Input::TouchDevice> touch_device;
|
||||
std::unique_ptr<Input::TouchDevice> touch_btn_device;
|
||||
s64_le last_touch{};
|
||||
u64_le last_touch{};
|
||||
};
|
||||
} // namespace Service::HID
|
||||
|
@ -20,7 +20,7 @@ void Controller_XPad::OnRelease() {}
|
||||
void Controller_XPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
|
||||
std::size_t size) {
|
||||
for (auto& xpad_entry : shared_memory.shared_memory_entries) {
|
||||
xpad_entry.header.timestamp = core_timing.GetCPUTicks();
|
||||
xpad_entry.header.timestamp = static_cast<s64>(core_timing.GetCPUTicks());
|
||||
xpad_entry.header.total_entry_count = 17;
|
||||
|
||||
if (!IsControllerActivated()) {
|
||||
@ -30,9 +30,11 @@ void Controller_XPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
|
||||
}
|
||||
xpad_entry.header.entry_count = 16;
|
||||
|
||||
const auto& last_entry = xpad_entry.pad_states[xpad_entry.header.last_entry_index];
|
||||
const auto& last_entry =
|
||||
xpad_entry.pad_states[static_cast<u64>(xpad_entry.header.last_entry_index)];
|
||||
xpad_entry.header.last_entry_index = (xpad_entry.header.last_entry_index + 1) % 17;
|
||||
auto& cur_entry = xpad_entry.pad_states[xpad_entry.header.last_entry_index];
|
||||
auto& cur_entry =
|
||||
xpad_entry.pad_states[static_cast<u64>(xpad_entry.header.last_entry_index)];
|
||||
|
||||
cur_entry.sampling_number = last_entry.sampling_number + 1;
|
||||
cur_entry.sampling_number2 = cur_entry.sampling_number;
|
||||
|
Reference in New Issue
Block a user