From bc0146c2038c46f789a246d5616afd7c425157f3 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 14 Feb 2021 11:05:57 -0500 Subject: 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 --- src/lib/util/corefile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/util/corefile.cpp') diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index 1149035045a..8cb8deea8f2 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -462,7 +462,7 @@ int core_text_file::getc() { // place the new character in the ring buffer m_back_char_head = 0; - m_back_char_tail = utf8_from_uchar(m_back_chars, ARRAY_LENGTH(m_back_chars), uchar); + m_back_char_tail = utf8_from_uchar(m_back_chars, std::size(m_back_chars), uchar); //assert(file->back_char_tail != -1); } } @@ -473,7 +473,7 @@ int core_text_file::getc() else { result = m_back_chars[m_back_char_head++]; - m_back_char_head %= ARRAY_LENGTH(m_back_chars); + m_back_char_head %= std::size(m_back_chars); } return result; @@ -488,7 +488,7 @@ int core_text_file::getc() int core_text_file::ungetc(int c) { m_back_chars[m_back_char_tail++] = char(c); - m_back_char_tail %= ARRAY_LENGTH(m_back_chars); + m_back_char_tail %= std::size(m_back_chars); return c; } @@ -577,7 +577,7 @@ int core_text_file::puts(std::string_view s) *pconvbuf++ = ch; // if we overflow, break into chunks - if (pconvbuf >= convbuf + ARRAY_LENGTH(convbuf) - 10) + if (pconvbuf >= convbuf + std::size(convbuf) - 10) { count += write(convbuf, pconvbuf - convbuf); pconvbuf = convbuf; -- cgit v1.2.3-70-g09d2