Use std::numeric_limits
This commit is contained in:
parent
20b4cc833f
commit
d856fb4c75
|
@ -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<size_t>(-1), false, track->format().general);
|
||||
announceComment(track->startPage(), numeric_limits<size_t>::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<size_t>(-1)) {
|
||||
&& currentParams->firstSegmentIndex == numeric_limits<size_t>::max()) {
|
||||
if (!currentParams->removed) {
|
||||
makeVorbisCommentSegment(buffer, copyHelper, newSegmentSizes, currentComment, currentParams, diag);
|
||||
}
|
||||
|
|
2
tag.h
2
tag.h
|
@ -38,7 +38,7 @@ enum class TagType : unsigned int {
|
|||
* \sa Tag::type()
|
||||
*/
|
||||
enum class KnownField : unsigned int {
|
||||
Invalid = static_cast<unsigned int>(-1), /**< invalid field name, do not map this value when subclassing Tag */
|
||||
Invalid = std::numeric_limits<unsigned int>::max(), /**< invalid field name, do not map this value when subclassing Tag */
|
||||
Title = 0, /**< title */
|
||||
Album, /**< album/collection */
|
||||
Artist, /**< artist/band */
|
||||
|
|
|
@ -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<size_t>(-1));
|
||||
m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits<size_t>::max());
|
||||
m_fileInfo.setForceTagPosition(m_mode & ForceTagPos);
|
||||
m_fileInfo.setForceIndexPosition(m_mode & ForceIndexPos);
|
||||
|
||||
|
|
|
@ -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<size_t>(-1));
|
||||
m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits<size_t>::max());
|
||||
m_fileInfo.setForceTagPosition(false);
|
||||
m_fileInfo.setForceIndexPosition(false);
|
||||
|
||||
|
|
|
@ -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<size_t>(-1));
|
||||
m_fileInfo.setMaxPadding(m_mode & PaddingConstraints ? (4096 + 1024) : numeric_limits<size_t>::max());
|
||||
m_fileInfo.setForceTagPosition(m_mode & ForceTagPos);
|
||||
m_fileInfo.setForceIndexPosition(m_mode & ForceTagPos);
|
||||
|
||||
|
|
Loading…
Reference in New Issue