diff --git a/src/core/bus.cpp b/src/core/bus.cpp index f5f0f1379..c157faef0 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -390,7 +390,7 @@ bool Bus::DoState(StateWrapper& sw) sw.Do(&g_spu_access_time); sw.DoBytes(g_ram, g_ram_size); - if (sw.GetVersion() < 58) + if (sw.GetVersion() < 58) [[unlikely]] { WARNING_LOG("Overwriting loaded BIOS with old save state."); sw.DoBytes(g_bios, BIOS_SIZE); diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index ee572d35a..e97d03fd8 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -240,7 +240,7 @@ bool CPU::DoState(StateWrapper& sw) sw.Do(&g_state.branch_was_taken); sw.Do(&g_state.exception_raised); sw.DoEx(&g_state.bus_error, 61, false); - if (sw.GetVersion() < 59) + if (sw.GetVersion() < 59) [[unlikely]] { bool interrupt_delay; sw.Do(&interrupt_delay); @@ -251,7 +251,7 @@ bool CPU::DoState(StateWrapper& sw) sw.Do(&g_state.next_load_delay_value); // Compatibility with old states. - if (sw.GetVersion() < 59) + if (sw.GetVersion() < 59) [[unlikely]] { g_state.load_delay_reg = static_cast(std::min(static_cast(g_state.load_delay_reg), static_cast(Reg::count))); @@ -262,10 +262,10 @@ bool CPU::DoState(StateWrapper& sw) sw.Do(&g_state.cache_control.bits); sw.DoBytes(g_state.scratchpad.data(), g_state.scratchpad.size()); - if (!GTE::DoState(sw)) + if (!GTE::DoState(sw)) [[unlikely]] return false; - if (sw.GetVersion() < 48) + if (sw.GetVersion() < 48) [[unlikely]] { DebugAssert(sw.IsReading()); ClearICache(); diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index c411bb3bb..f5416862e 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -252,7 +252,7 @@ bool GPU::DoState(StateWrapper& sw, GPUTexture** host_texture, bool update_displ sw.Do(&m_draw_mode.palette_reg.bits); sw.Do(&m_draw_mode.texture_window_value); - if (sw.GetVersion() < 62) + if (sw.GetVersion() < 62) [[unlikely]] { // texture_page_x, texture_page_y, texture_palette_x, texture_palette_y DebugAssert(sw.IsReading()); diff --git a/src/core/pad.cpp b/src/core/pad.cpp index 42d8960b5..45cebefc5 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -487,7 +487,7 @@ bool Pad::DoState(StateWrapper& sw, bool is_memory_state) { for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++) { - if ((sw.GetVersion() < 50) && (i >= 2)) + if ((sw.GetVersion() < 50) && (i >= 2)) [[unlikely]] { // loading from old savestate which only had max 2 controllers. // honoring load_devices_from_save_states in this case seems debatable, but might as well... @@ -519,7 +519,7 @@ bool Pad::DoState(StateWrapper& sw, bool is_memory_state) } } - if (sw.GetVersion() >= 50) + if (sw.GetVersion() >= 50) [[unlikely]] { for (u32 i = 0; i < NUM_MULTITAPS; i++) { diff --git a/src/core/playstation_mouse.cpp b/src/core/playstation_mouse.cpp index 3070295f0..7ebd35ee7 100644 --- a/src/core/playstation_mouse.cpp +++ b/src/core/playstation_mouse.cpp @@ -45,7 +45,7 @@ bool PlayStationMouse::DoState(StateWrapper& sw, bool apply_input_state) float delta_x = m_delta_x; float delta_y = m_delta_y; sw.Do(&button_state); - if (sw.GetVersion() >= 60) + if (sw.GetVersion() >= 60) [[unlikely]] { sw.Do(&delta_x); sw.Do(&delta_y); diff --git a/src/core/system.cpp b/src/core/system.cpp index 952189c81..97004db61 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2400,7 +2400,7 @@ bool System::DoState(StateWrapper& sw, GPUTexture** host_texture, bool update_di if (!is_memory_state) { - if (sw.GetVersion() >= 56) + if (sw.GetVersion() >= 56) [[unlikely]] { if (!sw.DoMarker("Cheevos")) return false; diff --git a/src/core/timing_event.cpp b/src/core/timing_event.cpp index 1ff4705bc..b316de1fe 100644 --- a/src/core/timing_event.cpp +++ b/src/core/timing_event.cpp @@ -385,7 +385,7 @@ bool DoState(StateWrapper& sw) event->m_interval = interval; } - if (sw.GetVersion() < 43) + if (sw.GetVersion() < 43) [[unlikely]] { u32 last_event_run_time = 0; sw.Do(&last_event_run_time); diff --git a/src/util/state_wrapper.h b/src/util/state_wrapper.h index 13d919138..2a473262b 100644 --- a/src/util/state_wrapper.h +++ b/src/util/state_wrapper.h @@ -183,7 +183,7 @@ public: template void DoEx(T* data, u32 version_introduced, T default_value) { - if (m_mode == Mode::Read && m_version < version_introduced) + if (m_mode == Mode::Read && m_version < version_introduced) [[unlikely]] { *data = std::move(default_value); return;