From: Tsuda Kageyu Date: Tue, 25 Aug 2015 08:51:33 +0000 (+0900) Subject: Fix an instance reference to a static data member. X-Git-Tag: v1.10~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9666b64f28c912bae8a42b6b1f40dd15a7ef0bc6;p=taglib Fix an instance reference to a static data member. --- diff --git a/taglib/mpeg/id3v2/id3v2header.cpp b/taglib/mpeg/id3v2/id3v2header.cpp index 10381053..6e567193 100644 --- a/taglib/mpeg/id3v2/id3v2header.cpp +++ b/taglib/mpeg/id3v2/id3v2header.cpp @@ -39,15 +39,14 @@ using namespace ID3v2; class Header::HeaderPrivate { public: - HeaderPrivate() : majorVersion(4), - revisionNumber(0), - unsynchronisation(false), - extendedHeader(false), - experimentalIndicator(false), - footerPresent(false), - tagSize(0) {} - - ~HeaderPrivate() {} + HeaderPrivate() : + majorVersion(4), + revisionNumber(0), + unsynchronisation(false), + extendedHeader(false), + experimentalIndicator(false), + footerPresent(false), + tagSize(0) {} uint majorVersion; uint revisionNumber; @@ -58,8 +57,6 @@ public: bool footerPresent; uint tagSize; - - static const uint size = 10; }; //////////////////////////////////////////////////////////////////////////////// @@ -68,7 +65,7 @@ public: TagLib::uint Header::size() { - return HeaderPrivate::size; + return 10; } ByteVector Header::fileIdentifier() @@ -80,14 +77,14 @@ ByteVector Header::fileIdentifier() // public members //////////////////////////////////////////////////////////////////////////////// -Header::Header() +Header::Header() : + d(new HeaderPrivate()) { - d = new HeaderPrivate; } -Header::Header(const ByteVector &data) +Header::Header(const ByteVector &data) : + d(new HeaderPrivate()) { - d = new HeaderPrivate; parse(data); } @@ -139,9 +136,9 @@ TagLib::uint Header::tagSize() const TagLib::uint Header::completeTagSize() const { if(d->footerPresent) - return d->tagSize + d->size + Footer::size(); + return d->tagSize + size() + Footer::size(); else - return d->tagSize + d->size; + return d->tagSize + size(); } void Header::setTagSize(uint s) @@ -199,7 +196,6 @@ void Header::parse(const ByteVector &data) if(data.size() < size()) return; - // do some sanity checking -- even in ID3v2.3.0 and less the tag size is a // synch-safe integer, so all bytes must be less than 128. If this is not // true then this is an invalid tag.