From 28738debc12e291dfd6fdc56b88cb4b22009186f Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Tue, 20 Jul 2004 22:40:57 +0000 Subject: [PATCH] A few more nitpicks. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@331315 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpc/apetag.cpp | 14 +++++++------- mpc/apetag.h | 2 +- mpc/mpcfile.cpp | 2 +- mpc/mpcproperties.cpp | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mpc/apetag.cpp b/mpc/apetag.cpp index e71b86c3..83362a2b 100644 --- a/mpc/apetag.cpp +++ b/mpc/apetag.cpp @@ -247,7 +247,7 @@ void APE::Tag::setYear(uint i) void APE::Tag::setTrack(uint i) { - if(i <=0 ) + if(i <= 0) removeComment("Track"); else d->items["Track"] = String::number(i); @@ -255,7 +255,7 @@ void APE::Tag::setTrack(uint i) void APE::Tag::removeComment(const String &key) { Map::Iterator it = d->items.find(key); - if (it != d->items.end()) + if(it != d->items.end()) d->items.erase(it); } @@ -267,7 +267,7 @@ void APE::Tag::addComment(const String &key, const String &value) d->items[key] = value; } -TagLib::uint APE::Tag::tagSize(ByteVector footer) +TagLib::uint APE::Tag::tagSize(const ByteVector &footer) { // The reported length (excl. header) @@ -293,11 +293,11 @@ void APE::Tag::read() // parse footer and some initial sanity checking if(footer.size() == 32 && footer.mid(0, 8) == "APETAGEX") { - uint length = footer.mid(12,4).toUInt(false); - uint count = footer.mid(16,4).toUInt(false); + uint length = footer.mid(12, 4).toUInt(false); + uint count = footer.mid(16, 4).toUInt(false); d->tagLength = length; - d->file->seek(d->tagOffset + 32 -length); - ByteVector data = d->file->readBlock(length-32); + d->file->seek(d->tagOffset + 32 - length); + ByteVector data = d->file->readBlock(length - 32); parse(data, count); } else diff --git a/mpc/apetag.h b/mpc/apetag.h index 1540da7f..bf87d533 100644 --- a/mpc/apetag.h +++ b/mpc/apetag.h @@ -67,7 +67,7 @@ namespace TagLib { /*! * Returns the size of the tag calculated based on the footer. */ - static uint tagSize(ByteVector footer); + static uint tagSize(const ByteVector &footer); // Reimplementations. diff --git a/mpc/mpcfile.cpp b/mpc/mpcfile.cpp index ef635af4..4a9d8add 100644 --- a/mpc/mpcfile.cpp +++ b/mpc/mpcfile.cpp @@ -133,7 +133,7 @@ bool MPC::File::save() // private members //////////////////////////////////////////////////////////////////////////////// -void MPC::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) +void MPC::File::read(bool readProperties, Properties::ReadStyle /* propertiesStyle */) { // Look for an APE tag diff --git a/mpc/mpcproperties.cpp b/mpc/mpcproperties.cpp index 328b5c40..ef966faa 100644 --- a/mpc/mpcproperties.cpp +++ b/mpc/mpcproperties.cpp @@ -31,7 +31,7 @@ using namespace TagLib; class MPC::Properties::PropertiesPrivate { public: - PropertiesPrivate(ByteVector d, long st, ReadStyle s) : + PropertiesPrivate(const ByteVector &d, long st, ReadStyle s) : data(d), streamLength(st), style(s), @@ -106,7 +106,7 @@ static const unsigned short sftable [4] = { 44100, 48000, 37800, 32000 }; void MPC::Properties::read() { - if(d->data.mid(0,3) != "MP+") + if(d->data.mid(0, 3) != "MP+") return; d->version = d->data[3] & 15; @@ -137,5 +137,4 @@ void MPC::Properties::read() if(!d->bitrate) d->bitrate = ((d->streamLength * 8L) / d->length) / 1000; - }