From fe11ec387709fb7f6c030058d69e7aee0b3cfbfa Mon Sep 17 00:00:00 2001 From: James Alan Nguyen Date: Tue, 17 May 2022 11:42:10 +1000 Subject: [PATCH] pick nits --- src/engine/fileOpsIns.cpp | 42 ++++++++++++++++++++++++++------------- src/engine/safeReader.cpp | 8 ++++---- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/engine/fileOpsIns.cpp b/src/engine/fileOpsIns.cpp index 4f08fea62..bf83a2dcf 100644 --- a/src/engine/fileOpsIns.cpp +++ b/src/engine/fileOpsIns.cpp @@ -1925,37 +1925,51 @@ std::vector DivEngine::instrumentFromFile(const char* path) { } switch (format) { - case DIV_INSFORMAT_DMP: loadDMP(reader,ret,stripPath); + case DIV_INSFORMAT_DMP: + loadDMP(reader,ret,stripPath); break; - case DIV_INSFORMAT_TFI: loadTFI(reader,ret,stripPath); + case DIV_INSFORMAT_TFI: + loadTFI(reader,ret,stripPath); break; - case DIV_INSFORMAT_VGI: loadVGI(reader,ret,stripPath); + case DIV_INSFORMAT_VGI: + loadVGI(reader,ret,stripPath); break; case DIV_INSFORMAT_FTI: // TODO break; case DIV_INSFORMAT_BTI: // TODO break; - case DIV_INSFORMAT_S3I: loadS3I(reader,ret,stripPath); + case DIV_INSFORMAT_S3I: + loadS3I(reader,ret,stripPath); break; - case DIV_INSFORMAT_SBI: loadSBI(reader,ret,stripPath); + case DIV_INSFORMAT_SBI: + loadSBI(reader,ret,stripPath); break; - case DIV_INSFORMAT_OPLI: loadOPLI(reader,ret,stripPath); + case DIV_INSFORMAT_OPLI: + loadOPLI(reader,ret,stripPath); break; - case DIV_INSFORMAT_OPNI: loadOPNI(reader,ret,stripPath); + case DIV_INSFORMAT_OPNI: + loadOPNI(reader,ret,stripPath); break; - case DIV_INSFORMAT_Y12: loadY12(reader,ret,stripPath); + case DIV_INSFORMAT_Y12: + loadY12(reader,ret,stripPath); break; - case DIV_INSFORMAT_BNK: loadBNK(reader,ret,stripPath); + case DIV_INSFORMAT_BNK: + loadBNK(reader,ret,stripPath); break; - case DIV_INSFORMAT_FF: loadFF(reader,ret,stripPath); + case DIV_INSFORMAT_FF: + loadFF(reader,ret,stripPath); break; - case DIV_INSFORMAT_GYB: loadGYB(reader,ret,stripPath); + case DIV_INSFORMAT_GYB: + loadGYB(reader,ret,stripPath); break; - case DIV_INSFORMAT_OPM: loadOPM(reader,ret,stripPath); + case DIV_INSFORMAT_OPM: + loadOPM(reader,ret,stripPath); break; - case DIV_INSFORMAT_WOPL: loadWOPL(reader,ret,stripPath); + case DIV_INSFORMAT_WOPL: + loadWOPL(reader,ret,stripPath); break; - case DIV_INSFORMAT_WOPN: loadWOPN(reader,ret,stripPath); + case DIV_INSFORMAT_WOPN: + loadWOPN(reader,ret,stripPath); break; } diff --git a/src/engine/safeReader.cpp b/src/engine/safeReader.cpp index 145be333c..173ffd235 100644 --- a/src/engine/safeReader.cpp +++ b/src/engine/safeReader.cpp @@ -171,7 +171,7 @@ String SafeReader::readStringLine() { if (isEOF()) throw EndOfFileException(this, len); while (!isEOF() && (c=readC())!=0) { - if (c=='\r'||c=='\n') { + if (c=='\r' || c=='\n') { break; } ret.push_back(c); @@ -185,11 +185,11 @@ String SafeReader::readStringToken(unsigned char delim, bool stripContiguous) { if (isEOF()) throw EndOfFileException(this, len); while (!isEOF() && (c=readC())!=0) { - if (c == '\r' || c == '\n') { + if (c=='\r' || c=='\n') { break; } - if (c == delim) { - if (ret.length() == 0 && stripContiguous) { + if (c==delim) { + if (ret.length()==0 && stripContiguous) { continue; } break;