summaryrefslogtreecommitdiffstats
path: root/src/emu/attotime.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
commitddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch)
treea70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/emu/attotime.cpp
parent333bff8de64dfaeb98134000412796b4fdef970b (diff)
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/emu/attotime.cpp')
-rw-r--r--src/emu/attotime.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/emu/attotime.cpp b/src/emu/attotime.cpp
index 7f7b2005b94..6df7487dfc7 100644
--- a/src/emu/attotime.cpp
+++ b/src/emu/attotime.cpp
@@ -29,7 +29,7 @@ const attotime attotime::never(ATTOTIME_MAX_SECONDS, 0);
// constant
//-------------------------------------------------
-attotime &attotime::operator*=(UINT32 factor)
+attotime &attotime::operator*=(uint32_t factor)
{
// if one of the items is attotime::never, return attotime::never
if (m_seconds >= ATTOTIME_MAX_SECONDS)
@@ -40,17 +40,17 @@ attotime &attotime::operator*=(UINT32 factor)
return *this = zero;
// split attoseconds into upper and lower halves which fit into 32 bits
- UINT32 attolo;
- UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
+ uint32_t attolo;
+ uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
// scale the lower half, then split into high/low parts
- UINT64 temp = mulu_32x32(attolo, factor);
- UINT32 reslo;
+ uint64_t temp = mulu_32x32(attolo, factor);
+ uint32_t reslo;
temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reslo);
// scale the upper half, then split into high/low parts
temp += mulu_32x32(attohi, factor);
- UINT32 reshi;
+ uint32_t reshi;
temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reshi);
// scale the seconds
@@ -69,7 +69,7 @@ attotime &attotime::operator*=(UINT32 factor)
// operator/= - divide an attotime by a constant
//-------------------------------------------------
-attotime &attotime::operator/=(UINT32 factor)
+attotime &attotime::operator/=(uint32_t factor)
{
// if one of the items is attotime::never, return attotime::never
if (m_seconds >= ATTOTIME_MAX_SECONDS)
@@ -80,20 +80,20 @@ attotime &attotime::operator/=(UINT32 factor)
return *this;
// split attoseconds into upper and lower halves which fit into 32 bits
- UINT32 attolo;
- UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
+ uint32_t attolo;
+ uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
// divide the seconds and get the remainder
- UINT32 remainder;
+ uint32_t remainder;
m_seconds = divu_64x32_rem(m_seconds, factor, &remainder);
// combine the upper half of attoseconds with the remainder and divide that
- UINT64 temp = (INT64)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
- UINT32 reshi = divu_64x32_rem(temp, factor, &remainder);
+ uint64_t temp = (int64_t)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
+ uint32_t reshi = divu_64x32_rem(temp, factor, &remainder);
// combine the lower half of attoseconds with the remainder and divide that
temp = attolo + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
- UINT32 reslo = divu_64x32_rem(temp, factor, &remainder);
+ uint32_t reslo = divu_64x32_rem(temp, factor, &remainder);
// round based on the remainder
m_attoseconds = (attoseconds_t)reslo + mulu_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
@@ -129,7 +129,7 @@ const char *attotime::as_string(int precision) const
// case 2: we want 9 or fewer digits of precision
else if (precision <= 9)
{
- UINT32 upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
+ uint32_t upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
int temp = precision;
while (temp < 9)
{
@@ -142,8 +142,8 @@ const char *attotime::as_string(int precision) const
// case 3: more than 9 digits of precision
else
{
- UINT32 lower;
- UINT32 upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
+ uint32_t lower;
+ uint32_t upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
int temp = precision;
while (temp < 18)
{