Skip to content

Commit

Permalink
Fixed bug where unspecified shortmodes were considered conflicting
Browse files Browse the repository at this point in the history
  • Loading branch information
sauraen committed Mar 6, 2024
1 parent e0eda90 commit f4b5f07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
30 changes: 21 additions & 9 deletions Source/SeqFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3445,10 +3445,13 @@ void SeqFile::checkAddFutureSection(const MusLine *line, Array<FutureSection> &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;
Expand All @@ -3467,15 +3470,19 @@ void SeqFile::checkAddFutureSection(const MusLine *line, Array<FutureSection> &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;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -5692,11 +5701,14 @@ int SeqFile::parseComSection(int s, const Array<uint8_t> &data, Array<uint8_t> &
}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);
}
}
Expand Down

0 comments on commit f4b5f07

Please sign in to comment.