From 2bc53186bc1978cc32fa407b83cf06c4959a45cb Mon Sep 17 00:00:00 2001 From: jmsgrogan Date: Mon, 16 Jan 2023 19:36:04 +0000 Subject: [PATCH] Fix up some Release build failures on MSVC. --- src/audio/midi/reader/MidiMetaEventAdapter.cpp | 4 ++-- src/web/markdown/MarkdownParser.cpp | 8 ++++---- src/web/markdown/MarkdownParser.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/audio/midi/reader/MidiMetaEventAdapter.cpp b/src/audio/midi/reader/MidiMetaEventAdapter.cpp index f474d6a..077a951 100644 --- a/src/audio/midi/reader/MidiMetaEventAdapter.cpp +++ b/src/audio/midi/reader/MidiMetaEventAdapter.cpp @@ -68,7 +68,7 @@ int MidiMetaEventAdapter::ReadUnknownEvent(std::ifstream* file) int length = *BinaryStream::getNextByteAsInt(file); char c; - for(unsigned idx=0; idxget(c); } @@ -144,7 +144,7 @@ int MidiMetaEventAdapter::ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEv if (length > 4) { char c; - for(unsigned idx=0; idxget(c); byteCount++; diff --git a/src/web/markdown/MarkdownParser.cpp b/src/web/markdown/MarkdownParser.cpp index bd08505..ff6ea16 100644 --- a/src/web/markdown/MarkdownParser.cpp +++ b/src/web/markdown/MarkdownParser.cpp @@ -240,11 +240,11 @@ bool MarkdownParser::startsWithMultiLineQuote(const std::string& line) const int MarkdownParser::startsWithCustomMultilineBlock(const std::string& line) const { - for(unsigned idx=0; idxgetNumMultilineContexts(); idx++) + for(std::size_t idx=0; idxgetNumMultilineContexts(); idx++) { if (StringUtils::startsWith(line, mWorkingDocument->getMultilineContext(idx)->getDelimiter(), true)) { - return idx; + return static_cast(idx); } } return -1; @@ -279,7 +279,7 @@ void MarkdownParser::onFoundMultiLineQuote(const std::string& line) } } -void MarkdownParser::onFoundCustomMultiLineBlock(const std::string& line, unsigned blockSlot) +void MarkdownParser::onFoundCustomMultiLineBlock(const std::string& line, std::size_t blockSlot) { if (mWorkingElement && mWorkingElement->getType() == MarkdownElement::Type::CUSTOM_MULTILINE && blockSlot == mCustomDelimiterIndex) { @@ -309,7 +309,7 @@ void MarkdownParser::onFoundHeading(const std::string& line) { onSectionFinished(); - auto level = StringUtils::countFirstConsecutiveHits(line, HEADING_DELIMITER); + auto level = static_cast(StringUtils::countFirstConsecutiveHits(line, HEADING_DELIMITER)); auto heading = std::make_unique(level); std::string prefix; diff --git a/src/web/markdown/MarkdownParser.h b/src/web/markdown/MarkdownParser.h index 6eeb014..8248c9a 100644 --- a/src/web/markdown/MarkdownParser.h +++ b/src/web/markdown/MarkdownParser.h @@ -33,7 +33,7 @@ private: bool isInMultilineBlock() const; void onFoundMultiLineQuote(const std::string& line); - void onFoundCustomMultiLineBlock(const std::string& line, unsigned blockSlot); + void onFoundCustomMultiLineBlock(const std::string& line, std::size_t blockSlot); void onFoundHeading(const std::string& line); void onFoundBulletItem(const std::string& line); @@ -48,7 +48,7 @@ private: bool startsWithHeading(const std::string& line) const; bool startsWithBulletItem(const std::string& line) const; - unsigned mCustomDelimiterIndex{0}; + std::size_t mCustomDelimiterIndex{0}; MarkdownElement* mWorkingElement{nullptr}; MarkdownBulletList* mWorkingBulletList{nullptr};