]> granicus.if.org Git - taglib/commitdiff
Fix an instance reference to a static data member.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Sun, 22 Nov 2015 10:43:17 +0000 (19:43 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Sun, 22 Nov 2015 10:43:17 +0000 (19:43 +0900)
taglib/ape/apefooter.cpp
taglib/mpeg/id3v2/id3v2footer.cpp

index 539832bafa98052f139418cfcd026d9c0ae93288..c9880cddb8d922d3a18aebaea535750529d5626f 100644 (file)
@@ -38,14 +38,13 @@ using namespace APE;
 class APE::Footer::FooterPrivate
 {
 public:
-  FooterPrivate() : version(0),
-                    footerPresent(true),
-                    headerPresent(false),
-                    isHeader(false),
-                    itemCount(0),
-                    tagSize(0) {}
-
-  ~FooterPrivate() {}
+  FooterPrivate() :
+    version(0),
+    footerPresent(true),
+    headerPresent(false),
+    isHeader(false),
+    itemCount(0),
+    tagSize(0) {}
 
   uint version;
 
@@ -56,8 +55,6 @@ public:
 
   uint itemCount;
   uint tagSize;
-
-  static const uint size = 32;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -66,26 +63,26 @@ public:
 
 TagLib::uint APE::Footer::size()
 {
-  return FooterPrivate::size;
+  return 32;
 }
 
 ByteVector APE::Footer::fileIdentifier()
 {
-  return ByteVector::fromCString("APETAGEX");
+  return ByteVector("APETAGEX");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // public members
 ////////////////////////////////////////////////////////////////////////////////
 
-APE::Footer::Footer()
+APE::Footer::Footer() :
+  d(new FooterPrivate())
 {
-  d = new FooterPrivate;
 }
 
-APE::Footer::Footer(const ByteVector &data)
+APE::Footer::Footer(const ByteVector &data) :
+  d(new FooterPrivate())
 {
-  d = new FooterPrivate;
   parse(data);
 }
 
@@ -137,7 +134,7 @@ TagLib::uint APE::Footer::tagSize() const
 TagLib::uint APE::Footer::completeTagSize() const
 {
   if(d->headerPresent)
-    return d->tagSize + d->size;
+    return d->tagSize + size();
   else
     return d->tagSize;
 }
@@ -154,13 +151,14 @@ void APE::Footer::setData(const ByteVector &data)
 
 ByteVector APE::Footer::renderFooter() const
 {
-    return render(false);
+  return render(false);
 }
 
 ByteVector APE::Footer::renderHeader() const
 {
-    if (!d->headerPresent) return ByteVector();
-
+  if(!d->headerPresent)
+    return ByteVector();
+  else
     return render(true);
 }
 
index defbb17ef817578fb97a88d3917c8735ec6eb45e..abbe054b14499880237052971edfe386d151bdd6 100644 (file)
@@ -31,30 +31,27 @@ using namespace ID3v2;
 
 class Footer::FooterPrivate
 {
-public:
-  static const uint size = 10;
 };
 
-Footer::Footer()
+Footer::Footer() :
+  d(0)
 {
-
 }
 
 Footer::~Footer()
 {
-
 }
 
 TagLib::uint Footer::size()
 {
-  return FooterPrivate::size;
+  return 10;
 }
 
 ByteVector Footer::render(const Header *header) const
 {
-    ByteVector headerData = header->render();
-    headerData[0] = '3';
-    headerData[1] = 'D';
-    headerData[2] = 'I';
-    return headerData;
+  ByteVector headerData = header->render();
+  headerData[0] = '3';
+  headerData[1] = 'D';
+  headerData[2] = 'I';
+  return headerData;
 }