diff --git a/ogg/oggcontainer.cpp b/ogg/oggcontainer.cpp index 72fcec5..7864623 100644 --- a/ogg/oggcontainer.cpp +++ b/ogg/oggcontainer.cpp @@ -106,7 +106,7 @@ OggVorbisComment *OggContainer::createTag(const TagTarget &target) case GeneralMediaFormat::Opus: // check whether start page has a valid value if (track->startPage() < m_iterator.pages().size()) { - announceComment(track->startPage(), static_cast(-1), false, track->format().general); + announceComment(track->startPage(), numeric_limits::max(), false, track->format().general); m_tags.back()->setTarget(target); return m_tags.back().get(); } else { @@ -460,7 +460,7 @@ void OggContainer::internalMakeFile(Diagnostics &diag, AbortableProgressFeedback // check whether there is a new comment to be inserted into the current page if (m_iterator.currentPageIndex() == currentParams->lastPageIndex - && currentParams->firstSegmentIndex == static_cast(-1)) { + && currentParams->firstSegmentIndex == numeric_limits::max()) { if (!currentParams->removed) { makeVorbisCommentSegment(buffer, copyHelper, newSegmentSizes, currentComment, currentParams, diag); } diff --git a/tag.h b/tag.h index d19db74..6a8ed3c 100644 --- a/tag.h +++ b/tag.h @@ -38,7 +38,7 @@ enum class TagType : unsigned int { * \sa Tag::type() */ enum class KnownField : unsigned int { - Invalid = static_cast(-1), /**< invalid field name, do not map this value when subclassing Tag */ + Invalid = std::numeric_limits::max(), /**< invalid field name, do not map this value when subclassing Tag */ Title = 0, /**< title */ Album, /**< album/collection */ Artist, /**< artist/band */ diff --git a/tests/overallmkv.cpp b/tests/overallmkv.cpp index 0c0c132..e05f238 100644 --- a/tests/overallmkv.cpp +++ b/tests/overallmkv.cpp @@ -713,7 +713,7 @@ void OverallTests::testMkvMakingWithDifferentSettings() } m_fileInfo.setPreferredPadding(m_mode & PaddingConstraints ? 4096 : 0); m_fileInfo.setMinPadding(m_mode & PaddingConstraints ? 1024 : 0); - m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : static_cast(-1)); + m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits::max()); m_fileInfo.setForceTagPosition(m_mode & ForceTagPos); m_fileInfo.setForceIndexPosition(m_mode & ForceIndexPos); diff --git a/tests/overallmp3.cpp b/tests/overallmp3.cpp index 106ceea..149da57 100644 --- a/tests/overallmp3.cpp +++ b/tests/overallmp3.cpp @@ -240,7 +240,7 @@ void OverallTests::testMp3Making() m_fileInfo.setIndexPosition(ElementPosition::Keep); m_fileInfo.setPreferredPadding(m_mode & PaddingConstraints ? 4096 : 0); m_fileInfo.setMinPadding(m_mode & PaddingConstraints ? 1024 : 0); - m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : static_cast(-1)); + m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits::max()); m_fileInfo.setForceTagPosition(false); m_fileInfo.setForceIndexPosition(false); diff --git a/tests/overallmp4.cpp b/tests/overallmp4.cpp index 73735de..0275daf 100644 --- a/tests/overallmp4.cpp +++ b/tests/overallmp4.cpp @@ -476,7 +476,7 @@ void OverallTests::testMp4Making() m_fileInfo.setIndexPosition(m_fileInfo.tagPosition()); m_fileInfo.setPreferredPadding(m_mode & PaddingConstraints ? 4096 : 0); m_fileInfo.setMinPadding(m_mode & PaddingConstraints ? 1024 : 0); - m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : static_cast(-1)); + m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits::max()); m_fileInfo.setForceTagPosition(m_mode & ForceTagPos); m_fileInfo.setForceIndexPosition(m_mode & ForceTagPos);