summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-03-26 02:16:04 +1100
committer Vas Crabb <vas@vastheman.com>2023-03-26 02:16:04 +1100
commitaa7fb5291fb831f855ece9a9fbf7d3f7ab8d0a3b (patch)
treec294f4283db11fd0d2b4c0a2742bbe5195d9ee7b
parent4cf33cfe0a427d24d754c134eb94b9d1a67da637 (diff)
Pacify clang, and more noexcept.
-rw-r--r--src/emu/devcpu.cpp8
-rw-r--r--src/emu/devcpu.h14
-rw-r--r--src/lib/util/strformat.cpp10
-rw-r--r--src/lib/util/strformat.h10
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 <utility>
+
//**************************************************************************
// 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<char> const &);
-template std::string string_format(format_argument_pack<char> &&);
-template std::string string_format(std::locale const &, format_argument_pack<char> const &);
-template std::string string_format(std::locale const &, format_argument_pack<char> &&);
-
-template std::wstring string_format(format_argument_pack<wchar_t> const &);
-template std::wstring string_format(format_argument_pack<wchar_t> &&);
-template std::wstring string_format(std::locale const &, format_argument_pack<wchar_t> const &);
-template std::wstring string_format(std::locale const &, format_argument_pack<wchar_t> &&);
-
} // 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<char> const &);
-extern template std::string string_format(format_argument_pack<char> &&);
-extern template std::string string_format(std::locale const &, format_argument_pack<char> const &);
-extern template std::string string_format(std::locale const &, format_argument_pack<char> &&);
-
-extern template std::wstring string_format(format_argument_pack<wchar_t> const &);
-extern template std::wstring string_format(format_argument_pack<wchar_t> &&);
-extern template std::wstring string_format(std::locale const &, format_argument_pack<wchar_t> const &);
-extern template std::wstring string_format(std::locale const &, format_argument_pack<wchar_t> &&);
-
} // namespace util
#endif // MAME_UTIL_STRFORMAT_H