Merge pull request #13910 from Tilka/ub

Fix some undefined behavior
This commit is contained in:
Tilka
2025-08-30 06:17:45 +01:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -203,8 +203,8 @@ private:
EventType* m_ev_lost = nullptr; EventType* m_ev_lost = nullptr;
CPUThreadConfigCallback::ConfigChangedCallbackID m_registered_config_callback_id; CPUThreadConfigCallback::ConfigChangedCallbackID m_registered_config_callback_id;
float m_config_oc_factor = 0.0f; float m_config_oc_factor = 1.0f;
float m_config_oc_inv_factor = 0.0f; float m_config_oc_inv_factor = 1.0f;
bool m_config_sync_on_skip_idle = false; bool m_config_sync_on_skip_idle = false;
s64 m_throttle_reference_cycle = 0; s64 m_throttle_reference_cycle = 0;

View File

@@ -454,7 +454,7 @@ private:
u32 m_even_field_last_hl = 0; // index last halfline of the even field u32 m_even_field_last_hl = 0; // index last halfline of the even field
u32 m_odd_field_last_hl = 0; // index last halfline of the odd field u32 m_odd_field_last_hl = 0; // index last halfline of the odd field
float m_config_vi_oc_factor = 0.0f; float m_config_vi_oc_factor = 1.0f;
Config::ConfigChangedCallbackID m_config_changed_callback_id; Config::ConfigChangedCallbackID m_config_changed_callback_id;
Core::System& m_system; Core::System& m_system;

View File

@@ -28,7 +28,7 @@ constexpr u16 LegalNitroChannelMask = 0b0011'1111'1111'1110u;
u16 SelectWifiChannel(u16 enabled_channels_mask, u16 current_channel) u16 SelectWifiChannel(u16 enabled_channels_mask, u16 current_channel)
{ {
const Common::BitSet<u16> enabled_channels{enabled_channels_mask & LegalChannelMask}; const Common::BitSet<u16> enabled_channels(enabled_channels_mask & LegalChannelMask);
u16 next_channel = current_channel; u16 next_channel = current_channel;
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
{ {