diff options
author | 2021-02-14 11:05:57 -0500 | |
---|---|---|
committer | 2021-02-14 11:05:57 -0500 | |
commit | bc0146c2038c46f789a246d5616afd7c425157f3 (patch) | |
tree | b4d39194034b4c6e56ccd4035d25636034be43ca /src/mame/drivers/clickstart.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/mame/drivers/clickstart.cpp')
-rw-r--r-- | src/mame/drivers/clickstart.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/drivers/clickstart.cpp b/src/mame/drivers/clickstart.cpp index e46cc3d3d7d..81576749176 100644 --- a/src/mame/drivers/clickstart.cpp +++ b/src/mame/drivers/clickstart.cpp @@ -186,7 +186,7 @@ void clickstart_state::machine_reset() m_mouse_dx = 0; m_mouse_dy = 0; - memset(m_uart_tx_fifo, 0, ARRAY_LENGTH(m_uart_tx_fifo)); + std::fill(std::begin(m_uart_tx_fifo), std::end(m_uart_tx_fifo), 0); m_uart_tx_fifo_start = 0; m_uart_tx_fifo_end = 0; m_uart_tx_fifo_count = 0; @@ -219,19 +219,19 @@ void clickstart_state::handle_uart_tx() return; m_maincpu->uart_rx(m_uart_tx_fifo[m_uart_tx_fifo_start]); - m_uart_tx_fifo_start = (m_uart_tx_fifo_start + 1) % ARRAY_LENGTH(m_uart_tx_fifo); + m_uart_tx_fifo_start = (m_uart_tx_fifo_start + 1) % std::size(m_uart_tx_fifo); m_uart_tx_fifo_count--; } void clickstart_state::uart_tx_fifo_push(uint8_t value) { - if (m_uart_tx_fifo_count >= ARRAY_LENGTH(m_uart_tx_fifo)) + if (m_uart_tx_fifo_count >= std::size(m_uart_tx_fifo)) { logerror("Warning: Trying to push too much data onto the mouse Tx FIFO, data will be lost.\n"); } m_uart_tx_fifo[m_uart_tx_fifo_end] = value; - m_uart_tx_fifo_end = (m_uart_tx_fifo_end + 1) % ARRAY_LENGTH(m_uart_tx_fifo); + m_uart_tx_fifo_end = (m_uart_tx_fifo_end + 1) % std::size(m_uart_tx_fifo); m_uart_tx_fifo_count++; } |