]> granicus.if.org Git - taglib/commitdiff
Small fixes
authormathbunnyru <mathbunnyru@gmail.com>
Wed, 23 Nov 2016 23:02:38 +0000 (02:02 +0300)
committermathbunnyru <mathbunnyru@gmail.com>
Wed, 23 Nov 2016 23:05:19 +0000 (02:05 +0300)
taglib/ape/apetag.cpp
taglib/asf/asfattribute.h
taglib/mp4/mp4tag.cpp
taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
taglib/mpeg/id3v2/id3v2tag.cpp
taglib/xm/xmfile.cpp

index c31237eb0d9031eebdb557373fd330b4f5a01d24..92ad536fdb4100aba758cfb2648c1896cf4ea080 100644 (file)
@@ -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);
index 64979216fc567b3a6d412a946bceefc8665ee3be..1738eb4596d965ec823d8f060988d8bf8e9761c0 100644 (file)
@@ -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.
index 0c2e5cbccc8ef71df4bcdd5b2223a7cad458a787..a7a473a2fd9eae4c271b7001021705be662091c5 100644 (file)
@@ -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();
           }
index f797125017f4098c80fb1b6a0290499423fb6136..b554d2cd45127a8db43079f40bbec1cf8d17f568 100644 (file)
@@ -36,7 +36,9 @@ class TableOfContentsFrame::TableOfContentsFramePrivate
 {
 public:
   TableOfContentsFramePrivate() :
-    tagHeader(0)
+    tagHeader(0),
+    isTopLevel(false),
+    isOrdered(false)
   {
     embeddedFrameList.setAutoDelete(true);
   }
index 4c00ab6fb5941d6aa8d97ef0f143cc9d270092c6..810b2aef0411d8638e0de8ed18742e58b1fd4f61 100644 (file)
@@ -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;
   }
index 9192e9bf2a039891fbc55f38897708ded8a41f2e..216dfd8cdd377b4c254c010ab102b3580054d862 100644 (file)
@@ -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));