From 98b9bd32b94b350b1fbca1bc558ddafb2b604f5b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 15 Apr 2022 16:10:57 -0500 Subject: [PATCH] static_assert() on cmdName --- src/engine/playback.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 0f3789635..2b22abd24 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -40,7 +40,7 @@ const char* notes[12]={ }; // update this when adding new commands. -const char* cmdName[DIV_CMD_MAX]={ +const char* cmdName[]={ "NOTE_ON", "NOTE_OFF", "NOTE_OFF_ENV", @@ -144,6 +144,7 @@ const char* cmdName[DIV_CMD_MAX]={ "N163_WAVE_LOAD", "N163_WAVE_LOADPOS", "N163_WAVE_LOADLEN", + "N163_WAVE_LOADMODE", "N163_CHANNEL_LIMIT", "N163_GLOBAL_WAVE_LOAD", "N163_GLOBAL_WAVE_LOADPOS", @@ -153,6 +154,8 @@ const char* cmdName[DIV_CMD_MAX]={ "ALWAYS_SET_VOLUME" }; +static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!"); + const char* formatNote(unsigned char note, unsigned char octave) { static char ret[4]; if (note==100) {