summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/corefile.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
commitbc0146c2038c46f789a246d5616afd7c425157f3 (patch)
treeb4d39194034b4c6e56ccd4035d25636034be43ca /src/lib/util/corefile.cpp
parent91310bcdeb7ab0ff661738b212017bf836f4e8ad (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/lib/util/corefile.cpp')
-rw-r--r--src/lib/util/corefile.cpp8
1 files changed, 4 insertions, 4 deletions
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;