From: mathbunnyru Date: Wed, 23 Nov 2016 23:02:38 +0000 (+0300) Subject: Small fixes X-Git-Tag: v1.12-beta-1~112^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e1d9fad31b65bd798381b41be7268dea919a920;p=taglib Small fixes --- diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index c31237eb..92ad536f 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -191,7 +191,7 @@ void APE::Tag::setGenre(const String &s) void APE::Tag::setYear(unsigned int i) { - if(i <= 0) + if(i == 0) removeItem("YEAR"); else addValue("YEAR", String::number(i), true); @@ -199,7 +199,7 @@ void APE::Tag::setYear(unsigned int i) void APE::Tag::setTrack(unsigned int i) { - if(i <= 0) + if(i == 0) removeItem("TRACK"); else addValue("TRACK", String::number(i), true); diff --git a/taglib/asf/asfattribute.h b/taglib/asf/asfattribute.h index 64979216..1738eb45 100644 --- a/taglib/asf/asfattribute.h +++ b/taglib/asf/asfattribute.h @@ -113,7 +113,7 @@ namespace TagLib /*! * Copies the contents of \a other into this item. */ - ASF::Attribute &operator=(const Attribute &other); + Attribute &operator=(const Attribute &other); /*! * Exchanges the content of the Attribute by the content of \a other. diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 0c2e5cbc..a7a473a2 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -948,10 +948,10 @@ PropertyMap MP4::Tag::setProperties(const PropertyMap &props) if(reverseKeyMap.contains(it->first)) { String name = reverseKeyMap[it->first]; if((it->first == "TRACKNUMBER" || it->first == "DISCNUMBER") && !it->second.isEmpty()) { - int first = 0, second = 0; StringList parts = StringList::split(it->second.front(), "/"); if(!parts.isEmpty()) { - first = parts[0].toInt(); + int first = parts[0].toInt(); + int second = 0; if(parts.size() > 1) { second = parts[1].toInt(); } diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp index f7971250..b554d2cd 100644 --- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp +++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp @@ -36,7 +36,9 @@ class TableOfContentsFrame::TableOfContentsFramePrivate { public: TableOfContentsFramePrivate() : - tagHeader(0) + tagHeader(0), + isTopLevel(false), + isOrdered(false) { embeddedFrameList.setAutoDelete(true); } diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index 4c00ab6f..810b2aef 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -60,6 +60,7 @@ class ID3v2::Tag::TagPrivate { public: TagPrivate() : + factory(0), file(0), tagOffset(0), extendedHeader(0), @@ -286,7 +287,7 @@ void ID3v2::Tag::setGenre(const String &s) void ID3v2::Tag::setYear(unsigned int i) { - if(i <= 0) { + if(i == 0) { removeFrames("TDRC"); return; } @@ -295,7 +296,7 @@ void ID3v2::Tag::setYear(unsigned int i) void ID3v2::Tag::setTrack(unsigned int i) { - if(i <= 0) { + if(i == 0) { removeFrames("TRCK"); return; } diff --git a/taglib/xm/xmfile.cpp b/taglib/xm/xmfile.cpp index 9192e9bf..216dfd8c 100644 --- a/taglib/xm/xmfile.cpp +++ b/taglib/xm/xmfile.cpp @@ -586,9 +586,9 @@ void XM::File::read(bool) unsigned int count = 4 + instrument.read(*this, instrumentHeaderSize - 4U); READ_ASSERT(count == std::min(instrumentHeaderSize, (unsigned long)instrument.size() + 4)); - unsigned long sampleHeaderSize = 0; long offset = 0; if(sampleCount > 0) { + unsigned long sampleHeaderSize = 0; sumSampleCount += sampleCount; // wouldn't know which header size to assume otherwise: READ_ASSERT(instrumentHeaderSize >= count + 4 && readU32L(sampleHeaderSize));