From c9b718e89a4b0142e2b12cf29ffd07d231fd5d99 Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:52:13 +0100 Subject: [PATCH] Fix Z80Debug.cpp compile with C++20 String literals should not be used to initialize char* but C++17 and earlier were letting it slide --- Src/Debugger/CPU/Z80Debug.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Src/Debugger/CPU/Z80Debug.cpp b/Src/Debugger/CPU/Z80Debug.cpp index 1d0f4b5..17cb723 100755 --- a/Src/Debugger/CPU/Z80Debug.cpp +++ b/Src/Debugger/CPU/Z80Debug.cpp @@ -33,7 +33,7 @@ namespace Debugger { // Instruction templates - static char *templates[5][256] = { + static const char *templates[5][256] = { { // Table 0: single byte instructions "NOP","LD BC,@a","LD (BC),A","INC BC","INC B","DEC B","LD B,@d","RLCA", @@ -393,10 +393,10 @@ namespace Debugger switch (opcode) { case 0xCB: - templ = templates[1][m_bus->Read8(dAddr++)]; + templ = (char*)templates[1][m_bus->Read8(dAddr++)]; break; case 0xED: - templ = templates[2][m_bus->Read8(dAddr++)]; + templ = (char*)templates[2][m_bus->Read8(dAddr++)]; break; case 0xDD: xyChr = 'X'; @@ -405,10 +405,10 @@ namespace Debugger { offs = m_bus->Read8(dAddr++); notJump = true; - templ = templates[4][m_bus->Read8(dAddr++)]; + templ = (char*)templates[4][m_bus->Read8(dAddr++)]; } else - templ = templates[3][nextCode]; + templ = (char*)templates[3][nextCode]; break; case 0xFD: xyChr = 'Y'; @@ -417,13 +417,13 @@ namespace Debugger { offs = m_bus->Read8(dAddr++); notJump = true; - templ = templates[4][m_bus->Read8(dAddr++)]; + templ = (char*)templates[4][m_bus->Read8(dAddr++)]; } else - templ = templates[3][nextCode]; + templ = (char*)templates[3][nextCode]; break; default: - templ = templates[0][opcode]; + templ = (char*)templates[0][opcode]; break; }