diff options
author | 2021-02-14 11:05:57 -0500 | |
---|---|---|
committer | 2021-02-14 11:05:57 -0500 | |
commit | bc0146c2038c46f789a246d5616afd7c425157f3 (patch) | |
tree | b4d39194034b4c6e56ccd4035d25636034be43ca /src/devices/cpu/powerpc/ppccom.cpp | |
parent | 91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff) |
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h
* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration
* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset
* emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/devices/cpu/powerpc/ppccom.cpp')
-rw-r--r-- | src/devices/cpu/powerpc/ppccom.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index 566be7c820a..1ff153ca1b6 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -1919,7 +1919,7 @@ void ppc_device::ppccom_execute_mfdcr() /* default handling */ if (m_dcr_read_func.isnull()) { osd_printf_debug("DCR %03X read\n", m_core->param0); - if (m_core->param0 < ARRAY_LENGTH(m_dcr)) + if (m_core->param0 < std::size(m_dcr)) m_core->param1 = m_dcr[m_core->param0]; else m_core->param1 = 0; @@ -2011,7 +2011,7 @@ void ppc_device::ppccom_execute_mtdcr() /* default handling */ if (m_dcr_write_func.isnull()) { osd_printf_debug("DCR %03X write = %08X\n", m_core->param0, m_core->param1); - if (m_core->param0 < ARRAY_LENGTH(m_dcr)) + if (m_core->param0 < std::size(m_dcr)) m_dcr[m_core->param0] = m_core->param1; } else { m_dcr_write_func(m_core->param0,m_core->param1); @@ -2662,7 +2662,7 @@ void ppc_device::ppc4xx_spu_rx_data(uint8_t data) uint32_t new_rxin; /* fail if we are going to overflow */ - new_rxin = (m_spu.rxin + 1) % ARRAY_LENGTH(m_spu.rxbuffer); + new_rxin = (m_spu.rxin + 1) % std::size(m_spu.rxbuffer); if (new_rxin == m_spu.rxout) fatalerror("ppc4xx_spu_rx_data: buffer overrun!\n"); @@ -2741,7 +2741,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_spu_callback ) /* consume the byte and advance the out pointer */ rxbyte = m_spu.rxbuffer[m_spu.rxout]; - m_spu.rxout = (m_spu.rxout + 1) % ARRAY_LENGTH(m_spu.rxbuffer); + m_spu.rxout = (m_spu.rxout + 1) % std::size(m_spu.rxbuffer); /* if we're not full, copy data to the buffer and update the line status */ if (!(m_spu.regs[SPU4XX_LINE_STATUS] & 0x80)) @@ -2784,7 +2784,7 @@ uint8_t ppc4xx_device::ppc4xx_spu_r(offs_t offset) break; default: - if (offset < ARRAY_LENGTH(m_spu.regs)) + if (offset < std::size(m_spu.regs)) result = m_spu.regs[offset]; break; } @@ -2848,7 +2848,7 @@ void ppc4xx_device::ppc4xx_spu_w(offs_t offset, uint8_t data) break; default: - if (offset < ARRAY_LENGTH(m_spu.regs)) + if (offset < std::size(m_spu.regs)) m_spu.regs[offset] = data; break; } |