summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2017-05-24 16:44:20 -0400
committer Vas Crabb <cuavas@users.noreply.github.com>2017-05-25 21:45:46 +1000
commit1617d0ab27fffeccc2eb8597954dc1677584df63 (patch)
tree889f5e61c95dd4070d81c41592a6df78619a646d
parent104fe318ac44e084b8ec468bb3c9b5d142915d67 (diff)
Retired min/max in attotime.h, in favor of std::[min|max]()
-rw-r--r--src/emu/attotime.h19
-rw-r--r--src/emu/schedule.cpp8
2 files changed, 4 insertions, 23 deletions
diff --git a/src/emu/attotime.h b/src/emu/attotime.h
index 02c19465037..6183497ae72 100644
--- a/src/emu/attotime.h
+++ b/src/emu/attotime.h
@@ -301,25 +301,6 @@ inline constexpr bool operator>=(const attotime &left, const attotime &right)
}
-//-------------------------------------------------
-// min - return the minimum of two attotimes
-//-------------------------------------------------
-
-inline constexpr attotime min(const attotime &left, const attotime &right)
-{
- return (left.m_seconds > right.m_seconds) ? right : (left.m_seconds < right.m_seconds) ? left : (left.m_attoseconds > right.m_attoseconds) ? right : left;
-}
-
-
-//-------------------------------------------------
-// max - return the maximum of two attotimes
-//-------------------------------------------------
-
-inline constexpr attotime max(const attotime &left, const attotime &right)
-{
- return (left.m_seconds > right.m_seconds) ? left : (left.m_seconds < right.m_seconds) ? right : (left.m_attoseconds > right.m_attoseconds) ? left : right;
-}
-
/** Convert to an attoseconds value, clamping to +/- 1 second */
inline constexpr attoseconds_t attotime::as_attoseconds() const
{
diff --git a/src/emu/schedule.cpp b/src/emu/schedule.cpp
index 6de1646989e..5fac93c713e 100644
--- a/src/emu/schedule.cpp
+++ b/src/emu/schedule.cpp
@@ -506,7 +506,7 @@ void device_scheduler::timeslice()
// if the new local CPU time is less than our target, move the target up, but not before the base
if (exec->m_localtime < target)
{
- target = max(exec->m_localtime, m_basetime);
+ target = std::max(exec->m_localtime, m_basetime);
LOG((" (new target)\n"));
}
}
@@ -758,11 +758,11 @@ void device_scheduler::rebuild_execute_list()
if (!device->interface(exec))
fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.c_str());
- min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
+ min_quantum = std::min(attotime(0, exec->minimum_quantum()), min_quantum);
}
// make sure it's no higher than 60Hz
- min_quantum = min(min_quantum, attotime::from_hz(60));
+ min_quantum = std::min(min_quantum, attotime::from_hz(60));
// inform the timer system of our decision
add_scheduling_quantum(min_quantum, attotime::never);
@@ -951,7 +951,7 @@ void device_scheduler::add_scheduling_quantum(const attotime &quantum, const att
// if we found an exact match, just take the maximum expiry time
if (insert_after != nullptr && insert_after->m_requested == quantum_attos)
- insert_after->m_expire = max(insert_after->m_expire, expire);
+ insert_after->m_expire = std::max(insert_after->m_expire, expire);
// otherwise, allocate a new quantum and insert it after the one we picked
else