Retired min/max in attotime.h, in favor of std::[min|max]()

This commit is contained in:
Nathan Woods 2017-05-24 16:44:20 -04:00 committed by Vas Crabb
parent 104fe318ac
commit 1617d0ab27
2 changed files with 4 additions and 23 deletions

View File

@ -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
{

View File

@ -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