From b45c7188c7d37062e9567aef94edf68813aa7a00 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Tue, 30 May 2023 12:36:12 -0700 Subject: [PATCH] chore: Fix some compiler warnings. (#6578) --- src/common/polyfill_thread.h | 18 +++++++++--------- src/core/arm/skyeye_common/armstate.cpp | 2 +- src/core/frontend/emu_window.cpp | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/common/polyfill_thread.h b/src/common/polyfill_thread.h index a4f4abab8..852fbca2c 100644 --- a/src/common/polyfill_thread.h +++ b/src/common/polyfill_thread.h @@ -96,7 +96,7 @@ public: // Insert the callback. stop_state_callback ret = ++m_next_callback; - m_callbacks.emplace(ret, move(f)); + m_callbacks.emplace(ret, std::move(f)); return ret; } @@ -154,7 +154,7 @@ private: friend class stop_source; template friend class stop_callback; - stop_token(shared_ptr stop_state) : m_stop_state(move(stop_state)) {} + stop_token(shared_ptr stop_state) : m_stop_state(std::move(stop_state)) {} private: shared_ptr m_stop_state; @@ -190,7 +190,7 @@ public: private: friend class jthread; explicit stop_source(shared_ptr stop_state) - : m_stop_state(move(stop_state)) {} + : m_stop_state(std::move(stop_state)) {} private: shared_ptr m_stop_state; @@ -210,16 +210,16 @@ public: C&& cb) noexcept(is_nothrow_constructible_v) : m_stop_state(st.m_stop_state) { if (m_stop_state) { - m_callback = m_stop_state->insert_callback(move(cb)); + m_callback = m_stop_state->insert_callback(std::move(cb)); } } template requires constructible_from explicit stop_callback(stop_token&& st, C&& cb) noexcept(is_nothrow_constructible_v) - : m_stop_state(move(st.m_stop_state)) { + : m_stop_state(std::move(st.m_stop_state)) { if (m_stop_state) { - m_callback = m_stop_state->insert_callback(move(cb)); + m_callback = m_stop_state->insert_callback(std::move(cb)); } } ~stop_callback() { @@ -252,7 +252,7 @@ public: typename = enable_if_t, jthread>>> explicit jthread(F&& f, Args&&... args) : m_stop_state(make_shared()), - m_thread(make_thread(move(f), move(args)...)) {} + m_thread(make_thread(std::move(f), std::move(args)...)) {} ~jthread() { if (joinable()) { @@ -309,9 +309,9 @@ private: template thread make_thread(F&& f, Args&&... args) { if constexpr (is_invocable_v, stop_token, decay_t...>) { - return thread(move(f), get_stop_token(), move(args)...); + return thread(std::move(f), get_stop_token(), std::move(args)...); } else { - return thread(move(f), move(args)...); + return thread(std::move(f), std::move(args)...); } } diff --git a/src/core/arm/skyeye_common/armstate.cpp b/src/core/arm/skyeye_common/armstate.cpp index 5e773b0e3..078b4db24 100644 --- a/src/core/arm/skyeye_common/armstate.cpp +++ b/src/core/arm/skyeye_common/armstate.cpp @@ -110,7 +110,7 @@ void ARMul_State::Reset() { Reg[13] = 0x10000000; Reg[15] = 0; - Cpsr = INTBITS | SVC32MODE; + Cpsr = static_cast(INTBITS) | SVC32MODE; Mode = SVC32MODE; Bank = SVCBANK; diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index f70a5fc60..37038d2d2 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -110,7 +110,8 @@ std::tuple EmuWindow::ClipToTouchScreen(unsigned new_x, unsi } void EmuWindow::CreateTouchState() { - if (touch_state = global_touch_state.lock()) { + touch_state = global_touch_state.lock(); + if (touch_state) { return; } touch_state = std::make_shared();