From aa7fb5291fb831f855ece9a9fbf7d3f7ab8d0a3b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 26 Mar 2023 02:16:04 +1100 Subject: Pacify clang, and more noexcept. --- src/emu/devcpu.cpp | 8 ++++---- src/emu/devcpu.h | 14 ++++++++------ src/lib/util/strformat.cpp | 10 ---------- src/lib/util/strformat.h | 10 ---------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/emu/devcpu.cpp b/src/emu/devcpu.cpp index e5f85812601..efd12d682a9 100644 --- a/src/emu/devcpu.cpp +++ b/src/emu/devcpu.cpp @@ -59,7 +59,7 @@ bool cpu_device::cpu_is_interruptible() const return false; } -bool cpu_device::access_before_time(u64 access_time, u64 current_time) +bool cpu_device::access_before_time(u64 access_time, u64 current_time) noexcept { s32 delta = access_time - current_time; if(*m_icountptr <= delta) { @@ -74,7 +74,7 @@ bool cpu_device::access_before_time(u64 access_time, u64 current_time) return false; } -bool cpu_device::access_before_delay(u32 cycles, const void *tag) +bool cpu_device::access_before_delay(u32 cycles, const void *tag) noexcept { if(tag == m_access_before_delay_tag) { m_access_before_delay_tag = nullptr; @@ -93,12 +93,12 @@ bool cpu_device::access_before_delay(u32 cycles, const void *tag) return false; } -void cpu_device::access_after_delay(u32 cycles) +void cpu_device::access_after_delay(u32 cycles) noexcept { *m_icountptr -= cycles; } -void cpu_device::defer_access() +void cpu_device::defer_access() noexcept { m_access_to_be_redone = true; *m_icountptr = 0; diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index 1dcf58c65f6..70f7b1667a5 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -16,6 +16,8 @@ #include "didisasm.h" #include "diexec.h" +#include + //************************************************************************** // TYPE DEFINITIONS @@ -39,16 +41,16 @@ public: virtual bool cpu_is_interruptible() const; // To be used only for interruptible cpus - bool access_to_be_redone() { bool r = m_access_to_be_redone; m_access_to_be_redone = false; return r; } - bool access_to_be_redone_noclear() { return m_access_to_be_redone; } + bool access_to_be_redone() noexcept { return std::exchange(m_access_to_be_redone, false); } + bool access_to_be_redone_noclear() noexcept { return m_access_to_be_redone; } // Returns true if the access must be aborted - bool access_before_time(u64 access_time, u64 current_time); - bool access_before_delay(u32 cycles, const void *tag); + bool access_before_time(u64 access_time, u64 current_time) noexcept; + bool access_before_delay(u32 cycles, const void *tag) noexcept; // The access has already happened, nothing to abort - void access_after_delay(u32 cycles); - void defer_access(); + void access_after_delay(u32 cycles) noexcept; + void defer_access() noexcept; protected: // construction/destruction diff --git a/src/lib/util/strformat.cpp b/src/lib/util/strformat.cpp index 47bfdde6715..f62ba55dc2d 100644 --- a/src/lib/util/strformat.cpp +++ b/src/lib/util/strformat.cpp @@ -135,14 +135,4 @@ template std::wostream::off_type stream_format(std::wostream &, format_argument_ } // namespace detail -template std::string string_format(format_argument_pack const &); -template std::string string_format(format_argument_pack &&); -template std::string string_format(std::locale const &, format_argument_pack const &); -template std::string string_format(std::locale const &, format_argument_pack &&); - -template std::wstring string_format(format_argument_pack const &); -template std::wstring string_format(format_argument_pack &&); -template std::wstring string_format(std::locale const &, format_argument_pack const &); -template std::wstring string_format(std::locale const &, format_argument_pack &&); - } // namespace util diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h index e68cacec529..f09965bc002 100644 --- a/src/lib/util/strformat.h +++ b/src/lib/util/strformat.h @@ -1908,16 +1908,6 @@ extern template std::wostream::off_type stream_format(std::wostream &, format_ar } // namespace detail -extern template std::string string_format(format_argument_pack const &); -extern template std::string string_format(format_argument_pack &&); -extern template std::string string_format(std::locale const &, format_argument_pack const &); -extern template std::string string_format(std::locale const &, format_argument_pack &&); - -extern template std::wstring string_format(format_argument_pack const &); -extern template std::wstring string_format(format_argument_pack &&); -extern template std::wstring string_format(std::locale const &, format_argument_pack const &); -extern template std::wstring string_format(std::locale const &, format_argument_pack &&); - } // namespace util #endif // MAME_UTIL_STRFORMAT_H -- cgit v1.2.3