From 1617d0ab27fffeccc2eb8597954dc1677584df63 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Wed, 24 May 2017 16:44:20 -0400 Subject: [PATCH] Retired min/max in attotime.h, in favor of std::[min|max]() --- src/emu/attotime.h | 19 ------------------- src/emu/schedule.cpp | 8 ++++---- 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