From f4b5f07fac74aec61140151f288f7a63d4d3a398 Mon Sep 17 00:00:00 2001 From: Sauraen Date: Tue, 5 Mar 2024 21:48:47 -0800 Subject: [PATCH] Fixed bug where unspecified shortmodes were considered conflicting --- CMakeLists.txt | 2 +- Source/SeqFile.cpp | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c275b43..78938c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE) set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "" FORCE) -project(SEQ64 VERSION 2.3.0) +project(SEQ64 VERSION 2.3.2) if(NOT EXISTS "${CMAKE_SOURCE_DIR}/juce/CMakeLists.txt") message(FATAL_ERROR "You forgot to get the Git submodules, please run git submodule update --init") diff --git a/Source/SeqFile.cpp b/Source/SeqFile.cpp index 3ec12ec..c6a788e 100644 --- a/Source/SeqFile.cpp +++ b/Source/SeqFile.cpp @@ -3445,10 +3445,13 @@ void SeqFile::checkAddFutureSection(const MusLine *line, Array &f } if(targetsection.isValid()){ ShortMode tgtshortmode = (ShortMode)(int)targetsection.getProperty(idShortMode, SM_unspecified); - if(tgtshortmode == SM_unspecified){ + if(shortmode == SM_unspecified){ + (void)0; // do nothing + }else if(tgtshortmode == SM_unspecified){ targetsection.setProperty(idShortMode, shortmode, nullptr); }else if(tgtshortmode != shortmode){ - line->Info("Section " + tgt + " short mode is conflicting"); + line->Info("Real section " + tgt + " short mode is conflicting, previously " + + GetShortModeLetter(tgtshortmode) + ", now " + GetShortModeLetter(shortmode)); targetsection.setProperty(idShortMode, SM_conflict, nullptr); } return; @@ -3467,15 +3470,19 @@ void SeqFile::checkAddFutureSection(const MusLine *line, Array &f + ", now referenced as " + String(stype) + "!"); return; } - if(fs[i].shortmode == SM_unspecified){ + if(shortmode == SM_unspecified){ + (void)0; // do nothing + }else if(fs[i].shortmode == SM_unspecified){ fs.getReference(i).shortmode = shortmode; }else if(fs[i].shortmode != shortmode){ - line->Info("Section " + tgt + " short mode is conflicting"); + line->Info("Future section " + tgt + " short mode is conflicting, previously " + + GetShortModeLetter(fs[i].shortmode) + ", now " + GetShortModeLetter(shortmode)); fs.getReference(i).shortmode = SM_conflict; } } } - //dbgmsg("Added future section " + tgt + " stype " + String(stype)); + // dbgmsg("Added future section " + tgt + " stype " + String(stype) + " shortmode " + // + GetShortModeLetter(shortmode)); FutureSection f; f.label = tgt; f.stype = stype; @@ -5298,9 +5305,11 @@ bool SeqFile::findDynTableSettings(int dtsec, const StringArray &refs){ clearRecurVisited(); return false; } - if(finalresult.shortmode == SM_unspecified){ + if(res.shortmode == SM_unspecified){ + (void)0; // do nothing + }else if(finalresult.shortmode == SM_unspecified){ finalresult.shortmode = res.shortmode; - }else if(res.shortmode != SM_unspecified && res.shortmode != finalresult.shortmode){ + }else if(res.shortmode != finalresult.shortmode){ finalresult.shortmode = SM_conflict; } } @@ -5692,11 +5701,14 @@ int SeqFile::parseComSection(int s, const Array &data, Array & }else if(stype != 0 && (action == "Jump" || action == "Branch" || action == "Call" || action == "Ptr Channel Header" || action == "Ptr Note Layer")){ ShortMode tgtshortmode = (ShortMode)(int)targetsection.getProperty(idShortMode, SM_unspecified); - if(tgtshortmode == SM_unspecified){ + if(shortmode == SM_unspecified){ + (void)0; // do nothing + }else if(tgtshortmode == SM_unspecified){ targetsection.setProperty(idShortMode, shortmode, nullptr); }else if(tgtshortmode != shortmode){ dbgmsg("At section " + String(s) + " addr " + hex(a) + ": section " - + command.getProperty(idTargetSection).toString() + " short mode is conflicting"); + + command.getProperty(idTargetSection).toString() + " short mode is conflicting, previously " + + GetShortModeLetter(tgtshortmode) + ", now " + GetShortModeLetter(shortmode)); targetsection.setProperty(idShortMode, SM_conflict, nullptr); } }