diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-12-03 01:50:44 +0900 |
---|---|---|
committer | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2015-12-03 02:15:41 +0900 |
commit | a0b86836568e294a6f6e83697ee6f9b1b8efb5cf (patch) | |
tree | dcb5d462e379d7bdeb15cce0df115137ac7476f8 | |
parent | 085a0ef2987496937292134adff6869b65a5be71 (diff) |
Use a standard type rather than TagLib::uint.
This won't break the ABI compatibility.
131 files changed, 775 insertions, 771 deletions
diff --git a/taglib/ape/apefile.cpp b/taglib/ape/apefile.cpp index 24171145..18d8cecc 100644 --- a/taglib/ape/apefile.cpp +++ b/taglib/ape/apefile.cpp @@ -73,13 +73,13 @@ public: } long APELocation; - uint APESize; + unsigned int APESize; long ID3v1Location; ID3v2::Header *ID3v2Header; long ID3v2Location; - uint ID3v2Size; + unsigned int ID3v2Size; TagUnion tag; diff --git a/taglib/ape/apefooter.cpp b/taglib/ape/apefooter.cpp index c9880cdd..c5c99a5a 100644 --- a/taglib/ape/apefooter.cpp +++ b/taglib/ape/apefooter.cpp @@ -46,22 +46,22 @@ public: itemCount(0), tagSize(0) {} - uint version; + unsigned int version; bool footerPresent; bool headerPresent; bool isHeader; - uint itemCount; - uint tagSize; + unsigned int itemCount; + unsigned int tagSize; }; //////////////////////////////////////////////////////////////////////////////// // static members //////////////////////////////////////////////////////////////////////////////// -TagLib::uint APE::Footer::size() +unsigned int APE::Footer::size() { return 32; } @@ -91,7 +91,7 @@ APE::Footer::~Footer() delete d; } -TagLib::uint APE::Footer::version() const +unsigned int APE::Footer::version() const { return d->version; } @@ -116,22 +116,22 @@ void APE::Footer::setHeaderPresent(bool b) const d->headerPresent = b; } -TagLib::uint APE::Footer::itemCount() const +unsigned int APE::Footer::itemCount() const { return d->itemCount; } -void APE::Footer::setItemCount(uint s) +void APE::Footer::setItemCount(unsigned int s) { d->itemCount = s; } -TagLib::uint APE::Footer::tagSize() const +unsigned int APE::Footer::tagSize() const { return d->tagSize; } -TagLib::uint APE::Footer::completeTagSize() const +unsigned int APE::Footer::completeTagSize() const { if(d->headerPresent) return d->tagSize + size(); @@ -139,7 +139,7 @@ TagLib::uint APE::Footer::completeTagSize() const return d->tagSize; } -void APE::Footer::setTagSize(uint s) +void APE::Footer::setTagSize(unsigned int s) { d->tagSize = s; } diff --git a/taglib/ape/apefooter.h b/taglib/ape/apefooter.h index 683af12f..47741d0d 100644 --- a/taglib/ape/apefooter.h +++ b/taglib/ape/apefooter.h @@ -64,7 +64,7 @@ namespace TagLib { /*! * Returns the version number. (Note: This is the 1000 or 2000.) */ - uint version() const; + unsigned int version() const; /*! * Returns true if a header is present in the tag. @@ -89,13 +89,13 @@ namespace TagLib { /*! * Returns the number of items in the tag. */ - uint itemCount() const; + unsigned int itemCount() const; /*! * Set the item count to \a s. * \see itemCount() */ - void setItemCount(uint s); + void setItemCount(unsigned int s); /*! * Returns the tag size in bytes. This is the size of the frame content and footer. @@ -103,7 +103,7 @@ namespace TagLib { * * \see completeTagSize() */ - uint tagSize() const; + unsigned int tagSize() const; /*! * Returns the tag size, including if present, the header @@ -111,18 +111,18 @@ namespace TagLib { * * \see tagSize() */ - uint completeTagSize() const; + unsigned int completeTagSize() const; /*! * Set the tag size to \a s. * \see tagSize() */ - void setTagSize(uint s); + void setTagSize(unsigned int s); /*! * Returns the size of the footer. Presently this is always 32 bytes. */ - static uint size(); + static unsigned int size(); /*! * Returns the string used to identify an APE tag inside of a file. diff --git a/taglib/ape/apeitem.cpp b/taglib/ape/apeitem.cpp index 80bed072..ebfb13df 100644 --- a/taglib/ape/apeitem.cpp +++ b/taglib/ape/apeitem.cpp @@ -247,8 +247,8 @@ void APE::Item::parse(const ByteVector &data) return; } - const uint valueLength = data.toUInt(0, false); - const uint flags = data.toUInt(4, false); + const unsigned int valueLength = data.toUInt(0, false); + const unsigned int flags = data.toUInt(4, false); d->key = String(data.mid(8), String::UTF8); @@ -266,7 +266,7 @@ void APE::Item::parse(const ByteVector &data) ByteVector APE::Item::render() const { ByteVector data; - TagLib::uint flags = ((d->readOnly) ? 1 : 0) | (d->type << 1); + unsigned int flags = ((d->readOnly) ? 1 : 0) | (d->type << 1); ByteVector value; if(isEmpty()) diff --git a/taglib/ape/apeproperties.cpp b/taglib/ape/apeproperties.cpp index 4a339456..26efd15f 100644 --- a/taglib/ape/apeproperties.cpp +++ b/taglib/ape/apeproperties.cpp @@ -56,7 +56,7 @@ public: int channels; int version; int bitsPerSample; - uint sampleFrames; + unsigned int sampleFrames; }; //////////////////////////////////////////////////////////////////////////////// @@ -122,7 +122,7 @@ int APE::Properties::bitsPerSample() const return d->bitsPerSample; } -TagLib::uint APE::Properties::sampleFrames() const +unsigned int APE::Properties::sampleFrames() const { return d->sampleFrames; } @@ -184,7 +184,7 @@ void APE::Properties::analyzeCurrent(File *file) return; } - const uint descriptorBytes = descriptor.toUInt(0, false); + const unsigned int descriptorBytes = descriptor.toUInt(0, false); if((descriptorBytes - 52) > 0) file->seek(descriptorBytes - 52, File::Current); @@ -201,12 +201,12 @@ void APE::Properties::analyzeCurrent(File *file) d->sampleRate = header.toUInt(20, false); d->bitsPerSample = header.toShort(16, false); - const uint totalFrames = header.toUInt(12, false); + const unsigned int totalFrames = header.toUInt(12, false); if(totalFrames == 0) return; - const uint blocksPerFrame = header.toUInt(4, false); - const uint finalFrameBlocks = header.toUInt(8, false); + const unsigned int blocksPerFrame = header.toUInt(4, false); + const unsigned int finalFrameBlocks = header.toUInt(8, false); d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks; } @@ -218,14 +218,14 @@ void APE::Properties::analyzeOld(File *file) return; } - const uint totalFrames = header.toUInt(18, false); + const unsigned int totalFrames = header.toUInt(18, false); // Fail on 0 length APE files (catches non-finalized APE files) if(totalFrames == 0) return; const short compressionLevel = header.toShort(0, false); - uint blocksPerFrame; + unsigned int blocksPerFrame; if(d->version >= 3950) blocksPerFrame = 73728 * 4; else if(d->version >= 3900 || (d->version >= 3800 && compressionLevel == 4000)) @@ -237,7 +237,7 @@ void APE::Properties::analyzeOld(File *file) d->channels = header.toShort(4, false); d->sampleRate = header.toUInt(6, false); - const uint finalFrameBlocks = header.toUInt(22, false); + const unsigned int finalFrameBlocks = header.toUInt(22, false); d->sampleFrames = (totalFrames - 1) * blocksPerFrame + finalFrameBlocks; // Get the bit depth from the RIFF-fmt chunk. diff --git a/taglib/ape/apeproperties.h b/taglib/ape/apeproperties.h index fcf125ff..91625483 100644 --- a/taglib/ape/apeproperties.h +++ b/taglib/ape/apeproperties.h @@ -118,7 +118,7 @@ namespace TagLib { /*! * Returns the total number of audio samples in file. */ - uint sampleFrames() const; + unsigned int sampleFrames() const; /*! * Returns APE version. diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 4e282faa..16e56c1f 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -112,14 +112,14 @@ String APE::Tag::genre() const return d->itemListMap["GENRE"].values().toString(); } -TagLib::uint APE::Tag::year() const +unsigned int APE::Tag::year() const { if(d->itemListMap["YEAR"].isEmpty()) return 0; return d->itemListMap["YEAR"].toString().toInt(); } -TagLib::uint APE::Tag::track() const +unsigned int APE::Tag::track() const { if(d->itemListMap["TRACK"].isEmpty()) return 0; @@ -151,7 +151,7 @@ void APE::Tag::setGenre(const String &s) addValue("GENRE", s, true); } -void APE::Tag::setYear(uint i) +void APE::Tag::setYear(unsigned int i) { if(i <= 0) removeItem("YEAR"); @@ -159,7 +159,7 @@ void APE::Tag::setYear(uint i) addValue("YEAR", String::number(i), true); } -void APE::Tag::setTrack(uint i) +void APE::Tag::setTrack(unsigned int i) { if(i <= 0) removeItem("TRACK"); @@ -215,7 +215,7 @@ PropertyMap APE::Tag::setProperties(const PropertyMap &origProps) PropertyMap properties(origProps); // make a local copy that can be modified // see comment in properties() - for(uint i = 0; i < keyConversionsSize; ++i) + for(size_t i = 0; i < keyConversionsSize; ++i) if(properties.contains(keyConversions[i][0])) { properties.insert(keyConversions[i][1], properties[keyConversions[i][0]]); properties.erase(keyConversions[i][0]); @@ -333,7 +333,7 @@ void APE::Tag::read(TagLib::File *file, long footerLocation) d->footer.setData(file->readBlock(Footer::size())); if(d->footer.tagSize() <= Footer::size() || - d->footer.tagSize() > uint(file->length())) + d->footer.tagSize() > static_cast<unsigned long>(file->length())) return; file->seek(footerLocation + Footer::size() - d->footer.tagSize()); @@ -344,7 +344,7 @@ void APE::Tag::read(TagLib::File *file, long footerLocation) ByteVector APE::Tag::render() const { ByteVector data; - uint itemCount = 0; + unsigned int itemCount = 0; for(ItemListMap::ConstIterator it = d->itemListMap.begin(); it != d->itemListMap.end(); ++it) { data.append(it->second.render()); @@ -365,9 +365,9 @@ void APE::Tag::parse(const ByteVector &data) if(data.size() < 11) return; - uint pos = 0; + unsigned int pos = 0; - for(uint i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) { + for(unsigned int i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) { APE::Item item; item.parse(data.mid(pos)); diff --git a/taglib/ape/apetag.h b/taglib/ape/apetag.h index 6c9999cf..b76419ee 100644 --- a/taglib/ape/apetag.h +++ b/taglib/ape/apetag.h @@ -92,16 +92,16 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual uint year() const; - virtual uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); /*! * Implements the unified tag dictionary interface -- export function. diff --git a/taglib/asf/asfattribute.cpp b/taglib/asf/asfattribute.cpp index a70330b0..1e6ed705 100644 --- a/taglib/asf/asfattribute.cpp +++ b/taglib/asf/asfattribute.cpp @@ -182,7 +182,7 @@ ASF::Picture ASF::Attribute::toPicture() const String ASF::Attribute::parse(ASF::File &f, int kind) { - uint size, nameLength; + unsigned int size, nameLength; String name; d->pictureValue = Picture::fromInvalid(); // extended content descriptor diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp index dc21dad4..8f395265 100644 --- a/taglib/asf/asffile.cpp +++ b/taglib/asf/asffile.cpp @@ -120,21 +120,21 @@ class ASF::File::FilePrivate::FilePropertiesObject : public ASF::File::FilePriva { public: ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); }; class ASF::File::FilePrivate::StreamPropertiesObject : public ASF::File::FilePrivate::BaseObject { public: ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); }; class ASF::File::FilePrivate::ContentDescriptionObject : public ASF::File::FilePrivate::BaseObject { public: ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); ByteVector render(ASF::File *file); }; @@ -143,7 +143,7 @@ class ASF::File::FilePrivate::ExtendedContentDescriptionObject : public ASF::Fil public: ByteVectorList attributeData; ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); ByteVector render(ASF::File *file); }; @@ -152,7 +152,7 @@ class ASF::File::FilePrivate::MetadataObject : public ASF::File::FilePrivate::Ba public: ByteVectorList attributeData; ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); ByteVector render(ASF::File *file); }; @@ -161,7 +161,7 @@ class ASF::File::FilePrivate::MetadataLibraryObject : public ASF::File::FilePriv public: ByteVectorList attributeData; ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); ByteVector render(ASF::File *file); }; @@ -171,7 +171,7 @@ public: List<ASF::File::FilePrivate::BaseObject *> objects; HeaderExtensionObject(); ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); ByteVector render(ASF::File *file); }; @@ -179,7 +179,7 @@ class ASF::File::FilePrivate::CodecListObject : public ASF::File::FilePrivate::B { public: ByteVector guid() const; - void parse(ASF::File *file, uint size); + void parse(ASF::File *file, unsigned int size); private: enum CodecType @@ -218,7 +218,7 @@ ByteVector ASF::File::FilePrivate::FilePropertiesObject::guid() const return filePropertiesGuid; } -void ASF::File::FilePrivate::FilePropertiesObject::parse(ASF::File *file, uint size) +void ASF::File::FilePrivate::FilePropertiesObject::parse(ASF::File *file, unsigned int size) { BaseObject::parse(file, size); if(data.size() < 64) { @@ -236,7 +236,7 @@ ByteVector ASF::File::FilePrivate::StreamPropertiesObject::guid() const return streamPropertiesGuid; } -void ASF::File::FilePrivate::StreamPropertiesObject::parse(ASF::File *file, uint size) +void ASF::File::FilePrivate::StreamPropertiesObject::parse(ASF::File *file, unsigned int size) { BaseObject::parse(file, size); if(data.size() < 70) { @@ -256,7 +256,7 @@ ByteVector ASF::File::FilePrivate::ContentDescriptionObject::guid() const return contentDescriptionGuid; } -void ASF::File::FilePrivate::ContentDescriptionObject::parse(ASF::File *file, uint /*size*/) +void ASF::File::FilePrivate::ContentDescriptionObject::parse(ASF::File *file, unsigned int /*size*/) { file->d->contentDescriptionObject = this; const int titleLength = readWORD(file); @@ -297,7 +297,7 @@ ByteVector ASF::File::FilePrivate::ExtendedContentDescriptionObject::guid() cons return extendedContentDescriptionGuid; } -void ASF::File::FilePrivate::ExtendedContentDescriptionObject::parse(ASF::File *file, uint /*size*/) +void ASF::File::FilePrivate::ExtendedContentDescriptionObject::parse(ASF::File *file, unsigned int /*size*/) { file->d->extendedContentDescriptionObject = this; int count = readWORD(file); @@ -321,7 +321,7 @@ ByteVector ASF::File::FilePrivate::MetadataObject::guid() const return metadataGuid; } -void ASF::File::FilePrivate::MetadataObject::parse(ASF::File *file, uint /*size*/) +void ASF::File::FilePrivate::MetadataObject::parse(ASF::File *file, unsigned int /*size*/) { file->d->metadataObject = this; int count = readWORD(file); @@ -345,7 +345,7 @@ ByteVector ASF::File::FilePrivate::MetadataLibraryObject::guid() const return metadataLibraryGuid; } -void ASF::File::FilePrivate::MetadataLibraryObject::parse(ASF::File *file, uint /*size*/) +void ASF::File::FilePrivate::MetadataLibraryObject::parse(ASF::File *file, unsigned int /*size*/) { file->d->metadataLibraryObject = this; int count = readWORD(file); @@ -374,7 +374,7 @@ ByteVector ASF::File::FilePrivate::HeaderExtensionObject::guid() const return headerExtensionGuid; } -void ASF::File::FilePrivate::HeaderExtensionObject::parse(ASF::File *file, uint /*size*/) +void ASF::File::FilePrivate::HeaderExtensionObject::parse(ASF::File *file, unsigned int /*size*/) { file->d->headerExtensionObject = this; file->seek(18, File::Current); @@ -423,7 +423,7 @@ ByteVector ASF::File::FilePrivate::CodecListObject::guid() const return codecListGuid; } -void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size) +void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, unsigned int size) { BaseObject::parse(file, size); if(data.size() <= 20) { @@ -431,7 +431,7 @@ void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size) return; } - uint pos = 16; + unsigned int pos = 16; const int count = data.toUInt(pos, false); pos += 4; @@ -447,13 +447,13 @@ void ASF::File::FilePrivate::CodecListObject::parse(ASF::File *file, uint size) int nameLength = data.toUShort(pos, false); pos += 2; - const uint namePos = pos; + const unsigned int namePos = pos; pos += nameLength * 2; const int descLength = data.toUShort(pos, false); pos += 2; - const uint descPos = pos; + const unsigned int descPos = pos; pos += descLength * 2; const int infoLength = data.toUShort(pos, false); diff --git a/taglib/asf/asfpicture.cpp b/taglib/asf/asfpicture.cpp index 5a3e4411..7039fb15 100644 --- a/taglib/asf/asfpicture.cpp +++ b/taglib/asf/asfpicture.cpp @@ -151,7 +151,7 @@ void ASF::Picture::parse(const ByteVector& bytes) return; int pos = 0; d->type = (Type)bytes[0]; ++pos; - const uint dataLen = bytes.toUInt(pos, false); pos+=4; + const unsigned int dataLen = bytes.toUInt(pos, false); pos+=4; const ByteVector nullStringTerminator(2, 0); diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index ea9141a3..ed2dba52 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -145,12 +145,12 @@ void ASF::Tag::setGenre(const String &value) setAttribute("WM/Genre", value); } -void ASF::Tag::setYear(uint value) +void ASF::Tag::setYear(unsigned int value) { setAttribute("WM/Year", String::number(value)); } -void ASF::Tag::setTrack(uint value) +void ASF::Tag::setTrack(unsigned int value) { setAttribute("WM/TrackNumber", String::number(value)); } diff --git a/taglib/asf/asftag.h b/taglib/asf/asftag.h index 8f322b18..049b9f66 100644 --- a/taglib/asf/asftag.h +++ b/taglib/asf/asftag.h @@ -90,13 +90,13 @@ namespace TagLib { /*! * Returns the year; if there is no year set, this will return 0. */ - virtual uint year() const; + virtual unsigned int year() const; /*! * Returns the track number; if there is no track number set, this will * return 0. */ - virtual uint track() const; + virtual unsigned int track() const; /*! * Sets the title to \a s. @@ -137,12 +137,12 @@ namespace TagLib { /*! * Sets the year to \a i. If \a s is 0 then this value will be cleared. */ - virtual void setYear(uint i); + virtual void setYear(unsigned int i); /*! * Sets the track to \a i. If \a s is 0 then this value will be cleared. */ - virtual void setTrack(uint i); + virtual void setTrack(unsigned int i); /*! * Returns true if the tag does not contain any data. This should be diff --git a/taglib/asf/asfutils.h b/taglib/asf/asfutils.h index 9a949413..e3595a70 100644 --- a/taglib/asf/asfutils.h +++ b/taglib/asf/asfutils.h @@ -46,7 +46,7 @@ namespace TagLib return v.toUShort(false); } - inline uint readDWORD(File *file, bool *ok = 0) + inline unsigned int readDWORD(File *file, bool *ok = 0) { const ByteVector v = file->readBlock(4); if(v.size() != 4) { diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index 252907d0..7f871c88 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -70,8 +70,8 @@ public: ~FilePrivate() { - uint size = blocks.size(); - for(uint i = 0; i < size; i++) { + unsigned int size = blocks.size(); + for(unsigned int i = 0; i < size; i++) { delete blocks[i]; } delete properties; @@ -79,7 +79,7 @@ public: const ID3v2::FrameFactory *ID3v2FrameFactory; long ID3v2Location; - uint ID3v2OriginalSize; + unsigned int ID3v2OriginalSize; long ID3v1Location; @@ -182,7 +182,7 @@ bool FLAC::File::save() bool foundVorbisCommentBlock = false; List<MetadataBlock *> newBlocks; - for(uint i = 0; i < d->blocks.size(); i++) { + for(unsigned int i = 0; i < d->blocks.size(); i++) { MetadataBlock *block = d->blocks[i]; if(block->code() == MetadataBlock::VorbisComment) { // Set the new Vorbis Comment block @@ -205,7 +205,7 @@ bool FLAC::File::save() // Render data for the metadata blocks ByteVector data; - for(uint i = 0; i < newBlocks.size(); i++) { + for(unsigned int i = 0; i < newBlocks.size(); i++) { FLAC::MetadataBlock *block = newBlocks[i]; ByteVector blockData = block->render(); ByteVector blockHeader = ByteVector::fromUInt(blockData.size()); @@ -300,7 +300,7 @@ long FLAC::File::streamLength() List<FLAC::Picture *> FLAC::File::pictureList() { List<Picture *> pictures; - for(uint i = 0; i < d->blocks.size(); i++) { + for(unsigned int i = 0; i < d->blocks.size(); i++) { Picture *picture = dynamic_cast<Picture *>(d->blocks[i]); if(picture) { pictures.append(picture); @@ -328,7 +328,7 @@ void FLAC::File::removePicture(Picture *picture, bool del) void FLAC::File::removePictures() { List<MetadataBlock *> newBlocks; - for(uint i = 0; i < d->blocks.size(); i++) { + for(unsigned int i = 0; i < d->blocks.size(); i++) { Picture *picture = dynamic_cast<Picture *>(d->blocks[i]); if(picture) { delete picture; @@ -457,7 +457,7 @@ void FLAC::File::scan() char blockType = header[0] & 0x7f; bool isLastBlock = (header[0] & 0x80) != 0; - uint length = header.toUInt(1U, 3U); + unsigned int length = header.toUInt(1U, 3U); // First block should be the stream_info metadata diff --git a/taglib/flac/flacpicture.cpp b/taglib/flac/flacpicture.cpp index a2a9000b..72c97247 100644 --- a/taglib/flac/flacpicture.cpp +++ b/taglib/flac/flacpicture.cpp @@ -78,10 +78,10 @@ bool FLAC::Picture::parse(const ByteVector &data) return false; } - uint pos = 0; + unsigned int pos = 0; d->type = FLAC::Picture::Type(data.toUInt(pos)); pos += 4; - uint mimeTypeLength = data.toUInt(pos); + unsigned int mimeTypeLength = data.toUInt(pos); pos += 4; if(pos + mimeTypeLength + 24 > data.size()) { debug("Invalid picture block."); @@ -89,7 +89,7 @@ bool FLAC::Picture::parse(const ByteVector &data) } d->mimeType = String(data.mid(pos, mimeTypeLength), String::UTF8); pos += mimeTypeLength; - uint descriptionLength = data.toUInt(pos); + unsigned int descriptionLength = data.toUInt(pos); pos += 4; if(pos + descriptionLength + 20 > data.size()) { debug("Invalid picture block."); @@ -105,7 +105,7 @@ bool FLAC::Picture::parse(const ByteVector &data) pos += 4; d->numColors = data.toUInt(pos); pos += 4; - uint dataLength = data.toUInt(pos); + unsigned int dataLength = data.toUInt(pos); pos += 4; if(pos + dataLength > data.size()) { debug("Invalid picture block."); diff --git a/taglib/flac/flacproperties.cpp b/taglib/flac/flacproperties.cpp index 9f0f9256..b947f039 100644 --- a/taglib/flac/flacproperties.cpp +++ b/taglib/flac/flacproperties.cpp @@ -135,7 +135,7 @@ void FLAC::Properties::read(const ByteVector &data, long streamLength) return; } - uint pos = 0; + unsigned int pos = 0; // Minimum block size (in samples) pos += 2; @@ -149,7 +149,7 @@ void FLAC::Properties::read(const ByteVector &data, long streamLength) // Maximum frame size (in bytes) pos += 3; - const uint flags = data.toUInt(pos, true); + const unsigned int flags = data.toUInt(pos, true); pos += 4; d->sampleRate = flags >> 12; diff --git a/taglib/it/itfile.cpp b/taglib/it/itfile.cpp index 7e140510..647491e9 100644 --- a/taglib/it/itfile.cpp +++ b/taglib/it/itfile.cpp @@ -130,7 +130,7 @@ bool IT::File::save() seek(sampleOffset + 20); - if((TagLib::uint)(i + instrumentCount) < lines.size()) + if((unsigned int)(i + instrumentCount) < lines.size()) writeString(lines[i + instrumentCount], 25); else writeString(String(), 25); @@ -139,7 +139,7 @@ bool IT::File::save() // write rest as message: StringList messageLines; - for(uint i = instrumentCount + sampleCount; i < lines.size(); ++ i) + for(unsigned int i = instrumentCount + sampleCount; i < lines.size(); ++ i) messageLines.append(lines[i]); ByteVector message = messageLines.toString("\r").data(String::Latin1); diff --git a/taglib/mod/modfile.cpp b/taglib/mod/modfile.cpp index 2741e1bf..d207516e 100644 --- a/taglib/mod/modfile.cpp +++ b/taglib/mod/modfile.cpp @@ -92,13 +92,13 @@ bool Mod::File::save() seek(0); writeString(d->tag.title(), 20); StringList lines = d->tag.comment().split("\n"); - uint n = std::min(lines.size(), d->properties.instrumentCount()); - for(uint i = 0; i < n; ++ i) { + unsigned int n = std::min(lines.size(), d->properties.instrumentCount()); + for(unsigned int i = 0; i < n; ++ i) { writeString(lines[i], 22); seek(8, Current); } - for(uint i = n; i < d->properties.instrumentCount(); ++ i) { + for(unsigned int i = n; i < d->properties.instrumentCount(); ++ i) { writeString(String(), 22); seek(8, Current); } @@ -114,8 +114,8 @@ void Mod::File::read(bool) ByteVector modId = readBlock(4); READ_ASSERT(modId.size() == 4); - int channels = 4; - uint instruments = 31; + int channels = 4; + unsigned int instruments = 31; if(modId == "M.K." || modId == "M!K!" || modId == "M&K!" || modId == "N.T.") { d->tag.setTrackerName("ProTracker"); channels = 4; @@ -159,7 +159,7 @@ void Mod::File::read(bool) READ_STRING(d->tag.setTitle, 20); StringList comment; - for(uint i = 0; i < instruments; ++ i) { + for(unsigned int i = 0; i < instruments; ++ i) { READ_STRING_AS(instrumentName, 22); // value in words, * 2 (<< 1) for bytes: READ_U16B_AS(sampleLength); diff --git a/taglib/mod/modproperties.cpp b/taglib/mod/modproperties.cpp index 86fa3845..f5591298 100644 --- a/taglib/mod/modproperties.cpp +++ b/taglib/mod/modproperties.cpp @@ -34,8 +34,8 @@ public: { } - int channels; - uint instrumentCount; + int channels; + unsigned int instrumentCount; unsigned char lengthInPatterns; }; @@ -80,7 +80,7 @@ int Mod::Properties::channels() const return d->channels; } -TagLib::uint Mod::Properties::instrumentCount() const +unsigned int Mod::Properties::instrumentCount() const { return d->instrumentCount; } @@ -95,7 +95,7 @@ void Mod::Properties::setChannels(int channels) d->channels = channels; } -void Mod::Properties::setInstrumentCount(uint instrumentCount) +void Mod::Properties::setInstrumentCount(unsigned int instrumentCount) { d->instrumentCount = instrumentCount; } diff --git a/taglib/mod/modproperties.h b/taglib/mod/modproperties.h index cf0f9e7b..6b424089 100644 --- a/taglib/mod/modproperties.h +++ b/taglib/mod/modproperties.h @@ -42,12 +42,12 @@ namespace TagLib { int sampleRate() const; int channels() const; - uint instrumentCount() const; + unsigned int instrumentCount() const; unsigned char lengthInPatterns() const; void setChannels(int channels); - void setInstrumentCount(uint sampleCount); + void setInstrumentCount(unsigned int sampleCount); void setLengthInPatterns(unsigned char lengthInPatterns); private: diff --git a/taglib/mod/modtag.cpp b/taglib/mod/modtag.cpp index af98fb92..2e3cbb6d 100644 --- a/taglib/mod/modtag.cpp +++ b/taglib/mod/modtag.cpp @@ -73,12 +73,12 @@ String Mod::Tag::genre() const return String(); } -TagLib::uint Mod::Tag::year() const +unsigned int Mod::Tag::year() const { return 0; } -TagLib::uint Mod::Tag::track() const +unsigned int Mod::Tag::track() const { return 0; } @@ -110,11 +110,11 @@ void Mod::Tag::setGenre(const String &) { } -void Mod::Tag::setYear(uint) +void Mod::Tag::setYear(unsigned int) { } -void Mod::Tag::setTrack(uint) +void Mod::Tag::setTrack(unsigned int) { } diff --git a/taglib/mod/modtag.h b/taglib/mod/modtag.h index 5b660359..1810fe11 100644 --- a/taglib/mod/modtag.h +++ b/taglib/mod/modtag.h @@ -77,12 +77,12 @@ namespace TagLib { /*! * Not supported by module files. Therefore always returns 0. */ - uint year() const; + unsigned int year() const; /*! * Not supported by module files. Therefore always returns 0. */ - uint track() const; + unsigned int track() const; /*! * Returns the name of the tracker used to create/edit the module file. @@ -140,12 +140,12 @@ namespace TagLib { /*! * Not supported by module files and therefore ignored. */ - void setYear(uint year); + void setYear(unsigned int year); /*! * Not supported by module files and therefore ignored. */ - void setTrack(uint track); + void setTrack(unsigned int track); /*! * Sets the tracker name to \a trackerName. If \a trackerName is diff --git a/taglib/mp4/mp4item.cpp b/taglib/mp4/mp4item.cpp index f7edbb55..787ed457 100644 --- a/taglib/mp4/mp4item.cpp +++ b/taglib/mp4/mp4item.cpp @@ -45,7 +45,7 @@ public: int m_int; IntPair m_intPair; unsigned char m_byte; - uint m_uint; + unsigned int m_uint; long long m_longlong; }; StringList m_stringList; @@ -104,7 +104,7 @@ MP4::Item::Item(unsigned char value) : d->m_byte = value; } -MP4::Item::Item(uint value) : +MP4::Item::Item(unsigned int value) : d(new ItemPrivate()) { d->m_uint = value; @@ -169,7 +169,7 @@ MP4::Item::toByte() const return d->m_byte; } -TagLib::uint +unsigned int MP4::Item::toUInt() const { return d->m_uint; diff --git a/taglib/mp4/mp4item.h b/taglib/mp4/mp4item.h index 63fc93bd..3821135b 100644 --- a/taglib/mp4/mp4item.h +++ b/taglib/mp4/mp4item.h @@ -58,7 +58,7 @@ namespace TagLib { Item(int value); Item(unsigned char value); - Item(uint value); + Item(unsigned int value); Item(long long value); Item(bool value); Item(int first, int second); @@ -71,7 +71,7 @@ namespace TagLib { int toInt() const; unsigned char toByte() const; - uint toUInt() const; + unsigned int toUInt() const; long long toLongLong() const; bool toBool() const; IntPair toIntPair() const; diff --git a/taglib/mp4/mp4properties.cpp b/taglib/mp4/mp4properties.cpp index ba821547..4bb4d67b 100644 --- a/taglib/mp4/mp4properties.cpp +++ b/taglib/mp4/mp4properties.cpp @@ -167,7 +167,7 @@ MP4::Properties::read(File *file, Atoms *atoms) file->seek(mdhd->offset); data = file->readBlock(mdhd->length); - const uint version = data[8]; + const unsigned int version = data[8]; long long unit; long long length; if(version == 1) { @@ -202,7 +202,7 @@ MP4::Properties::read(File *file, Atoms *atoms) d->bitsPerSample = data.toShort(42U); d->sampleRate = data.toUInt(46U); if(data.containsAt("esds", 56) && data[64] == 0x03) { - uint pos = 65; + unsigned int pos = 65; if(data.containsAt("\x80\x80\x80", pos)) { pos += 3; } diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 6ad75a87..4b8a7039 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -554,7 +554,7 @@ MP4::Tag::updateOffsets(long delta, long offset) ByteVector data = d->file->readBlock(atom->length - 12); unsigned int count = data.toUInt(); d->file->seek(atom->offset + 16); - uint pos = 4; + unsigned int pos = 4; while(count--) { long o = static_cast<long>(data.toUInt(pos)); if(o > offset) { @@ -575,7 +575,7 @@ MP4::Tag::updateOffsets(long delta, long offset) ByteVector data = d->file->readBlock(atom->length - 12); unsigned int count = data.toUInt(); d->file->seek(atom->offset + 16); - uint pos = 4; + unsigned int pos = 4; while(count--) { long long o = data.toLongLong(pos); if(o > offset) { @@ -768,13 +768,13 @@ MP4::Tag::setGenre(const String &value) } void -MP4::Tag::setYear(uint value) +MP4::Tag::setYear(unsigned int value) { d->items["\251day"] = StringList(String::number(value)); } void -MP4::Tag::setTrack(uint value) +MP4::Tag::setTrack(unsigned int value) { d->items["trkn"] = MP4::Item(value, 0); } diff --git a/taglib/mp4/mp4tag.h b/taglib/mp4/mp4tag.h index c299c59b..7a73b3fe 100644 --- a/taglib/mp4/mp4tag.h +++ b/taglib/mp4/mp4tag.h @@ -58,16 +58,16 @@ namespace TagLib { String album() const; String comment() const; String genre() const; - uint year() const; - uint track() const; + unsigned int year() const; + unsigned int track() const; void setTitle(const String &value); void setArtist(const String &value); void setAlbum(const String &value); void setComment(const String &value); void setGenre(const String &value); - void setYear(uint value); - void setTrack(uint value); + void setYear(unsigned int value); + void setTrack(unsigned int value); virtual bool isEmpty() const; diff --git a/taglib/mpc/mpcfile.cpp b/taglib/mpc/mpcfile.cpp index 015bc0e0..6d6e668a 100644 --- a/taglib/mpc/mpcfile.cpp +++ b/taglib/mpc/mpcfile.cpp @@ -65,13 +65,13 @@ public: } long APELocation; - uint APESize; + unsigned int APESize; long ID3v1Location; ID3v2::Header *ID3v2Header; long ID3v2Location; - uint ID3v2Size; + unsigned int ID3v2Size; TagUnion tag; diff --git a/taglib/mpc/mpcproperties.cpp b/taglib/mpc/mpcproperties.cpp index 2e42886e..b9fbbf13 100644 --- a/taglib/mpc/mpcproperties.cpp +++ b/taglib/mpc/mpcproperties.cpp @@ -49,18 +49,18 @@ public: albumGain(0), albumPeak(0) {} - int version; - int length; - int bitrate; - int sampleRate; - int channels; - uint totalFrames; - uint sampleFrames; - uint trackGain; - uint trackPeak; - uint albumGain; - uint albumPeak; - String flags; + int version; + int length; + int bitrate; + int sampleRate; + int channels; + unsigned int totalFrames; + unsigned int sampleFrames; + unsigned int trackGain; + unsigned int trackPeak; + unsigned int albumGain; + unsigned int albumPeak; + String flags; }; //////////////////////////////////////////////////////////////////////////////// @@ -129,12 +129,12 @@ int MPC::Properties::mpcVersion() const return d->version; } -TagLib::uint MPC::Properties::totalFrames() const +unsigned int MPC::Properties::totalFrames() const { return d->totalFrames; } -TagLib::uint MPC::Properties::sampleFrames() const +unsigned int MPC::Properties::sampleFrames() const { return d->sampleFrames; } @@ -165,7 +165,7 @@ int MPC::Properties::albumPeak() const namespace { - unsigned long readSize(File *file, TagLib::uint &sizeLength, bool &eof) + unsigned long readSize(File *file, unsigned int &sizeLength, bool &eof) { sizeLength = 0; eof = false; @@ -187,7 +187,7 @@ namespace return size; } - unsigned long readSize(const ByteVector &data, TagLib::uint &pos) + unsigned long readSize(const ByteVector &data, unsigned int &pos) { unsigned char tmp; unsigned long size = 0; @@ -211,7 +211,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) while(!readSH && !readRG) { const ByteVector packetType = file->readBlock(2); - uint packetSizeLength; + unsigned int packetSizeLength; bool eof; const unsigned long packetSize = readSize(file, packetSizeLength, eof); if(eof) { @@ -238,7 +238,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) readSH = true; - TagLib::uint pos = 4; + unsigned int pos = 4; d->version = data[pos]; pos += 1; d->sampleFrames = readSize(data, pos); @@ -259,7 +259,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) d->sampleRate = sftable[(flags >> 13) & 0x07]; d->channels = ((flags >> 4) & 0x0F) + 1; - const uint frameCount = d->sampleFrames - begSilence; + const unsigned int frameCount = d->sampleFrames - begSilence; if(frameCount > 0 && d->sampleRate > 0) { const double length = frameCount * 1000.0 / d->sampleRate; d->length = static_cast<int>(length + 0.5); @@ -305,11 +305,11 @@ void MPC::Properties::readSV7(const ByteVector &data, long streamLength) d->totalFrames = data.toUInt(4, false); - const uint flags = data.toUInt(8, false); + const unsigned int flags = data.toUInt(8, false); d->sampleRate = sftable[(flags >> 16) & 0x03]; d->channels = 2; - const uint gapless = data.toUInt(5, false); + const unsigned int gapless = data.toUInt(5, false); d->trackGain = data.toShort(14, false); d->trackPeak = data.toShort(12, false); @@ -337,14 +337,14 @@ void MPC::Properties::readSV7(const ByteVector &data, long streamLength) bool trueGapless = (gapless >> 31) & 0x0001; if(trueGapless) { - uint lastFrameSamples = (gapless >> 20) & 0x07FF; + unsigned int lastFrameSamples = (gapless >> 20) & 0x07FF; d->sampleFrames = d->totalFrames * 1152 - lastFrameSamples; } else d->sampleFrames = d->totalFrames * 1152 - 576; } else { - const uint headerData = data.toUInt(0, false); + const unsigned int headerData = data.toUInt(0, false); d->bitrate = (headerData >> 23) & 0x01ff; d->version = (headerData >> 11) & 0x03ff; diff --git a/taglib/mpc/mpcproperties.h b/taglib/mpc/mpcproperties.h index d6b06691..d5fdfbb9 100644 --- a/taglib/mpc/mpcproperties.h +++ b/taglib/mpc/mpcproperties.h @@ -35,7 +35,7 @@ namespace TagLib { class File; - static const uint HeaderSize = 8*7; + static const unsigned int HeaderSize = 8 * 7; //! An implementation of audio property reading for MPC @@ -113,8 +113,8 @@ namespace TagLib { */ int mpcVersion() const; - uint totalFrames() const; - uint sampleFrames() const; + unsigned int totalFrames() const; + unsigned int sampleFrames() const; /*! * Returns the track gain as an integer value, diff --git a/taglib/mpeg/id3v1/id3v1tag.cpp b/taglib/mpeg/id3v1/id3v1tag.cpp index 1ca297e2..9b724159 100644 --- a/taglib/mpeg/id3v1/id3v1tag.cpp +++ b/taglib/mpeg/id3v1/id3v1tag.cpp @@ -144,12 +144,12 @@ String ID3v1::Tag::genre() const return ID3v1::genre(d->genre); } -TagLib::uint ID3v1::Tag::year() const +unsigned int ID3v1::Tag::year() const { return d->year.toInt(); } -TagLib::uint ID3v1::Tag::track() const +unsigned int ID3v1::Tag::track() const { return d->track; } @@ -179,22 +179,22 @@ void ID3v1::Tag::setGenre(const String &s) d->genre = ID3v1::genreIndex(s); } -void ID3v1::Tag::setYear(TagLib::uint i) +void ID3v1::Tag::setYear(unsigned int i) { d->year = i > 0 ? String::number(i) : String(); } -void ID3v1::Tag::setTrack(TagLib::uint i) +void ID3v1::Tag::setTrack(unsigned int i) { d->track = i < 256 ? i : 0; } -TagLib::uint ID3v1::Tag::genreNumber() const +unsigned int ID3v1::Tag::genreNumber() const { return d->genre; } -void ID3v1::Tag::setGenreNumber(TagLib::uint i) +void ID3v1::Tag::setGenreNumber(unsigned int i) { d->genre = i < 256 ? i : 255; } diff --git a/taglib/mpeg/id3v1/id3v1tag.h b/taglib/mpeg/id3v1/id3v1tag.h index 02642ca5..9cff408f 100644 --- a/taglib/mpeg/id3v1/id3v1tag.h +++ b/taglib/mpeg/id3v1/id3v1tag.h @@ -140,23 +140,23 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual TagLib::uint year() const; - virtual TagLib::uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(TagLib::uint i); - virtual void setTrack(TagLib::uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); /*! * Returns the genre in number. * * \note Normally 255 indicates that this tag contains no genre. */ - TagLib::uint genreNumber() const; + unsigned int genreNumber() const; /*! * Sets the genre in number to \a i. @@ -164,7 +164,7 @@ namespace TagLib { * \note Valid value is from 0 up to 255. Normally 255 indicates that * this tag contains no genre. */ - void setGenreNumber(TagLib::uint i); + void setGenreNumber(unsigned int i); /*! * Sets the string handler that decides how the ID3v1 data will be diff --git a/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp b/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp index 86f8e355..849ee9ff 100644 --- a/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp +++ b/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp @@ -137,7 +137,7 @@ void AttachedPictureFrame::parseFields(const ByteVector &data) d->mimeType = readStringField(data, String::Latin1, &pos); /* Now we need at least two more bytes available */ - if (uint(pos) + 1 >= data.size()) { + if(static_cast<unsigned int>(pos) + 1 >= data.size()) { debug("Truncated picture frame."); return; } diff --git a/taglib/mpeg/id3v2/frames/chapterframe.cpp b/taglib/mpeg/id3v2/frames/chapterframe.cpp index e11e2928..44cdf5e7 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.cpp +++ b/taglib/mpeg/id3v2/frames/chapterframe.cpp @@ -44,10 +44,10 @@ public: const ID3v2::Header *tagHeader; ByteVector elementID; - TagLib::uint startTime; - TagLib::uint endTime; - TagLib::uint startOffset; - TagLib::uint endOffset; + unsigned int startTime; + unsigned int endTime; + unsigned int startOffset; + unsigned int endOffset; FrameListMap embeddedFrameListMap; FrameList embeddedFrameList; }; @@ -65,8 +65,8 @@ ChapterFrame::ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &dat } ChapterFrame::ChapterFrame(const ByteVector &elementID, - TagLib::uint startTime, TagLib::uint endTime, - TagLib::uint startOffset, TagLib::uint endOffset, + unsigned int startTime, unsigned int endTime, + unsigned int startOffset, unsigned int endOffset, const FrameList &embeddedFrames) : ID3v2::Frame("CHAP") { @@ -97,22 +97,22 @@ ByteVector ChapterFrame::elementID() const return d->elementID; } -TagLib::uint ChapterFrame::startTime() const +unsigned int ChapterFrame::startTime() const { return d->startTime; } -TagLib::uint ChapterFrame::endTime() const +unsigned int ChapterFrame::endTime() const { return d->endTime; } -TagLib::uint ChapterFrame::startOffset() const +unsigned int ChapterFrame::startOffset() const { return d->startOffset; } -TagLib::uint ChapterFrame::endOffset() const +unsigned int ChapterFrame::endOffset() const { return d->endOffset; } @@ -125,22 +125,22 @@ void ChapterFrame::setElementID(const ByteVector &eID) d->elementID = d->elementID.mid(0, d->elementID.size() - 1); } -void ChapterFrame::setStartTime(const TagLib::uint &sT) +void ChapterFrame::setStartTime(const unsigned int &sT) { d->startTime = sT; } -void ChapterFrame::setEndTime(const TagLib::uint &eT) +void ChapterFrame::setEndTime(const unsigned int &eT) { d->endTime = eT; } -void ChapterFrame::setStartOffset(const TagLib::uint &sO) +void ChapterFrame::setStartOffset(const unsigned int &sO) { d->startOffset = sO; } -void ChapterFrame::setEndOffset(const TagLib::uint &eO) +void ChapterFrame::setEndOffset(const unsigned int &eO) { d->endOffset = eO; } @@ -238,7 +238,7 @@ ChapterFrame *ChapterFrame::findByElementID(const ID3v2::Tag *tag, const ByteVec void ChapterFrame::parseFields(const ByteVector &data) { - TagLib::uint size = data.size(); + unsigned int size = data.size(); if(size < 18) { debug("A CHAP frame must contain at least 18 bytes (1 byte element ID " "terminated by null and 4x4 bytes for start and end time and offset)."); @@ -246,7 +246,7 @@ void ChapterFrame::parseFields(const ByteVector &data) } int pos = 0; - TagLib::uint embPos = 0; + unsigned int embPos = 0; d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1); d->startTime = data.toUInt(pos, true); pos += 4; diff --git a/taglib/mpeg/id3v2/frames/chapterframe.h b/taglib/mpeg/id3v2/frames/chapterframe.h index 36853062..64ee19d3 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.h +++ b/taglib/mpeg/id3v2/frames/chapterframe.h @@ -62,8 +62,8 @@ namespace TagLib { * All times are in milliseconds. */ ChapterFrame(const ByteVector &elementID, - uint startTime, uint endTime, - uint startOffset, uint endOffset, + unsigned int startTime, unsigned int endTime, + unsigned int startOffset, unsigned int endOffset, const FrameList &embeddedFrames = FrameList()); /*! @@ -84,14 +84,14 @@ namespace TagLib { * * \see setStartTime() */ - uint startTime() const; + unsigned int startTime() const; /*! * Returns time of chapter's end (in milliseconds). * * \see setEndTime() */ - uint endTime() const; + unsigned int endTime() const; /*! * Returns zero based byte offset (count of bytes from the beginning @@ -100,7 +100,7 @@ namespace TagLib { * \note If returned value is 0xFFFFFFFF, start time should be used instead. * \see setStartOffset() */ - uint startOffset() const; + unsigned int startOffset() const; /*! * Returns zero based byte offset (count of bytes from the beginning @@ -109,7 +109,7 @@ namespace TagLib { * \note If returned value is 0xFFFFFFFF, end time should be used instead. * \see setEndOffset() */ - uint endOffset() const; + unsigned int endOffset() const; /*! * Sets the element ID of the frame to \a eID. If \a eID isn't @@ -124,14 +124,14 @@ namespace TagLib { * * \see startTime() */ - void setStartTime(const uint &sT); + void setStartTime(const unsigned int &sT); /*! * Sets time of chapter's end (in milliseconds) to \a eT. * * \see endTime() */ - void setEndTime(const uint &eT); + void setEndTime(const unsigned int &eT); /*! * Sets zero based byte offset (count of bytes from the beginning @@ -139,7 +139,7 @@ namespace TagLib { * * \see startOffset() */ - void setStartOffset(const uint &sO); + void setStartOffset(const unsigned int &sO); /*! * Sets zero based byte offset (count of bytes from the beginning @@ -147,7 +147,7 @@ namespace TagLib { * * \see endOffset() */ - void setEndOffset(const uint &eO); + void setEndOffset(const unsigned int &eO); /*! * Returns a reference to the frame list map. This is an FrameListMap of diff --git a/taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp b/taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp index 6a3f7d26..7af797f0 100644 --- a/taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp +++ b/taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp @@ -110,7 +110,7 @@ void EventTimingCodesFrame::parseFields(const ByteVector &data) d->synchedEvents.clear(); while(pos + 4 < end) { EventType type = static_cast<EventType>(static_cast<unsigned char>(data[pos++])); - uint time = data.toUInt(pos, true); + unsigned int time = data.toUInt(pos, true); pos += 4; d->synchedEvents.append(SynchedEvent(time, type)); } diff --git a/taglib/mpeg/id3v2/frames/eventtimingcodesframe.h b/taglib/mpeg/id3v2/frames/eventtimingcodesframe.h index 0719f51f..3dcedb9e 100644 --- a/taglib/mpeg/id3v2/frames/eventtimingcodesframe.h +++ b/taglib/mpeg/id3v2/frames/eventtimingcodesframe.h @@ -108,8 +108,8 @@ namespace TagLib { * Single entry of time stamp and event. */ struct SynchedEvent { - SynchedEvent(uint ms, EventType t) : time(ms), type(t) {} - uint time; + SynchedEvent(unsigned int ms, EventType t) : time(ms), type(t) {} + unsigned int time; EventType type; }; diff --git a/taglib/mpeg/id3v2/frames/popularimeterframe.cpp b/taglib/mpeg/id3v2/frames/popularimeterframe.cpp index 3d4429f7..dac8589f 100644 --- a/taglib/mpeg/id3v2/frames/popularimeterframe.cpp +++ b/taglib/mpeg/id3v2/frames/popularimeterframe.cpp @@ -36,7 +36,7 @@ public: PopularimeterFramePrivate() : rating(0), counter(0) {} String email; int rating; - TagLib::uint counter; + unsigned int counter; }; //////////////////////////////////////////////////////////////////////////////// @@ -84,12 +84,12 @@ void PopularimeterFrame::setRating(int s) d->rating = s; } -TagLib::uint PopularimeterFrame::counter() const +unsigned int PopularimeterFrame::counter() const { return d->counter; } -void PopularimeterFrame::setCounter(TagLib::uint s) +void PopularimeterFrame::setCounter(unsigned int s) { d->counter = s; } @@ -109,7 +109,7 @@ void PopularimeterFrame::parseFields(const ByteVector &data) if(pos < size) { d->rating = (unsigned char)(data[pos++]); if(pos < size) { - d->counter = data.toUInt(static_cast<uint>(pos)); + d->counter = data.toUInt(static_cast<unsigned int>(pos)); } } } diff --git a/taglib/mpeg/id3v2/frames/popularimeterframe.h b/taglib/mpeg/id3v2/frames/popularimeterframe.h index 79b88cbf..405ca69e 100644 --- a/taglib/mpeg/id3v2/frames/popularimeterframe.h +++ b/taglib/mpeg/id3v2/frames/popularimeterframe.h @@ -100,14 +100,14 @@ namespace TagLib { * * \see setCounter() */ - uint counter() const; + unsigned int counter() const; /*! * Set the counter. * * \see counter() */ - void setCounter(uint counter); + void setCounter(unsigned int counter); protected: // Reimplementations. diff --git a/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp b/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp index e3efbc38..44033cbc 100644 --- a/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp +++ b/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp @@ -191,7 +191,7 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data) ChannelData &channel = d->channels[type]; - channel.volumeAdjustment = data.toShort(static_cast<uint>(pos)); + channel.volumeAdjustment = data.toShort(static_cast<unsigned int>(pos)); pos += 2; channel.peakVolume.bitsRepresentingPeak = data[pos]; diff --git a/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp b/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp index 1d42e1c8..4fb2e15a 100644 --- a/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp +++ b/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp @@ -117,8 +117,7 @@ void SynchronizedLyricsFrame::setLanguage(const ByteVector &languageEncoding) d->language = languageEncoding.mid(0, 3); } -void SynchronizedLyricsFrame::setTimestampFormat( - SynchronizedLyricsFrame::TimestampFormat f) +void SynchronizedLyricsFrame::setTimestampFormat(SynchronizedLyricsFrame::TimestampFormat f) { d->timestampFormat = f; } @@ -193,7 +192,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data) if(text.isEmpty() || pos + 4 > end) return; - uint time = data.toUInt(pos, true); + unsigned int time = data.toUInt(pos, true); pos += 4; d->synchedText.append(SynchedText(time, text)); diff --git a/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.h b/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.h index 704ac4b5..f520c593 100644 --- a/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.h +++ b/taglib/mpeg/id3v2/frames/synchronizedlyricsframe.h @@ -85,8 +85,8 @@ namespace TagLib { * Single entry of time stamp and lyrics text. */ struct SynchedText { - SynchedText(uint ms, String str) : time(ms), text(str) {} - uint time; + SynchedText(unsigned int ms, String str) : time(ms), text(str) {} + unsigned int time; String text; }; diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp index 1e8a1af8..50720359 100644 --- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp +++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp @@ -121,7 +121,7 @@ bool TableOfContentsFrame::isOrdered() const return d->isOrdered; } -TagLib::uint TableOfContentsFrame::entryCount() const +unsigned int TableOfContentsFrame::entryCount() const { return d->childElements.size(); } @@ -261,7 +261,7 @@ TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag) void TableOfContentsFrame::parseFields(const ByteVector &data) { - TagLib::uint size = data.size(); + unsigned int size = data.size(); if(size < 6) { debug("A CTOC frame must contain at least 6 bytes (1 byte element ID terminated by " "null, 1 byte flags, 1 byte entry count and 1 byte child element ID terminated " @@ -270,12 +270,12 @@ void TableOfContentsFrame::parseFields(const ByteVector &data) } int pos = 0; - TagLib::uint embPos = 0; + unsigned int embPos = 0; d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1); d->isTopLevel = (data.at(pos) & 2) > 0; d->isOrdered = (data.at(pos++) & 1) > 0; - TagLib::uint entryCount = data.at(pos++); - for(TagLib::uint i = 0; i < entryCount; i++) { + unsigned int entryCount = data.at(pos++); + for(unsigned int i = 0; i < entryCount; i++) { ByteVector childElementID = readStringField(data, String::Latin1, &pos).data(String::Latin1); d->childElements.append(childElementID); } diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.h b/taglib/mpeg/id3v2/frames/tableofcontentsframe.h index 66facf80..31196b2e 100644 --- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.h +++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.h @@ -95,7 +95,7 @@ namespace TagLib { * * \see childElements() */ - uint entryCount() const; + unsigned int entryCount() const; /*! * Returns list of child elements of the frame. diff --git a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp index 8cd0d940..d9d3b29b 100644 --- a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp +++ b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp @@ -119,22 +119,26 @@ void TextIdentificationFrame::setTextEncoding(String::Type encoding) d->textEncoding = encoding; } -// array of allowed TIPL prefixes and their corresponding key value -static const TagLib::uint involvedPeopleSize = 5; -static const char* involvedPeople[][2] = { - {"ARRANGER", "ARRANGER"}, - {"ENGINEER", "ENGINEER"}, - {"PRODUCER", "PRODUCER"}, - {"DJ-MIX", "DJMIXER"}, - {"MIX", "MIXER"}, -}; +namespace +{ + // array of allowed TIPL prefixes and their corresponding key value + const char* involvedPeople[][2] = { + {"ARRANGER", "ARRANGER"}, + {"ENGINEER", "ENGINEER"}, + {"PRODUCER", "PRODUCER"}, + {"DJ-MIX", "DJMIXER"}, + {"MIX", "MIXER"}, + }; + const size_t involvedPeopleSize = sizeof(involvedPeople) / sizeof(involvedPeople[0]); +} const KeyConversionMap &TextIdentificationFrame::involvedPeopleMap() // static { static KeyConversionMap m; - if(m.isEmpty()) - for(uint i = 0; i < involvedPeopleSize; ++i) + if(m.isEmpty()) { + for(size_t i = 0; i < involvedPeopleSize; ++i) m.insert(involvedPeople[i][1], involvedPeople[i][0]); + } return m; } @@ -265,7 +269,7 @@ PropertyMap TextIdentificationFrame::makeTIPLProperties() const StringList l = fieldList(); for(StringList::ConstIterator it = l.begin(); it != l.end(); ++it) { bool found = false; - for(uint i = 0; i < involvedPeopleSize; ++i) + for(size_t i = 0; i < involvedPeopleSize; ++i) if(*it == involvedPeople[i][0]) { map.insert(involvedPeople[i][1], (++it)->split(",")); found = true; diff --git a/taglib/mpeg/id3v2/id3v2extendedheader.cpp b/taglib/mpeg/id3v2/id3v2extendedheader.cpp index ddcfd452..667e3e94 100644 --- a/taglib/mpeg/id3v2/id3v2extendedheader.cpp +++ b/taglib/mpeg/id3v2/id3v2extendedheader.cpp @@ -34,7 +34,7 @@ class ExtendedHeader::ExtendedHeaderPrivate public: ExtendedHeaderPrivate() : size(0) {} - uint size; + unsigned int size; }; //////////////////////////////////////////////////////////////////////////////// @@ -51,7 +51,7 @@ ExtendedHeader::~ExtendedHeader() delete d; } -TagLib::uint ExtendedHeader::size() const +unsigned int ExtendedHeader::size() const { return d->size; } diff --git a/taglib/mpeg/id3v2/id3v2extendedheader.h b/taglib/mpeg/id3v2/id3v2extendedheader.h index d60200e7..6d9386e6 100644 --- a/taglib/mpeg/id3v2/id3v2extendedheader.h +++ b/taglib/mpeg/id3v2/id3v2extendedheader.h @@ -62,7 +62,7 @@ namespace TagLib { * Returns the size of the extended header. This is variable for the * extended header. */ - uint size() const; + unsigned int size() const; /*! * Sets the data that will be used as the extended header. Since the diff --git a/taglib/mpeg/id3v2/id3v2footer.cpp b/taglib/mpeg/id3v2/id3v2footer.cpp index abbe054b..3622724a 100644 --- a/taglib/mpeg/id3v2/id3v2footer.cpp +++ b/taglib/mpeg/id3v2/id3v2footer.cpp @@ -42,7 +42,7 @@ Footer::~Footer() { } -TagLib::uint Footer::size() +unsigned int Footer::size() { return 10; } diff --git a/taglib/mpeg/id3v2/id3v2footer.h b/taglib/mpeg/id3v2/id3v2footer.h index 1374a149..5eb38007 100644 --- a/taglib/mpeg/id3v2/id3v2footer.h +++ b/taglib/mpeg/id3v2/id3v2footer.h @@ -62,7 +62,7 @@ namespace TagLib { /*! * Returns the size of the footer. Presently this is always 10 bytes. */ - static uint size(); + static unsigned int size(); /*! * Renders the footer based on the data in \a header. diff --git a/taglib/mpeg/id3v2/id3v2frame.cpp b/taglib/mpeg/id3v2/id3v2frame.cpp index f811ed69..8960ffe2 100644 --- a/taglib/mpeg/id3v2/id3v2frame.cpp +++ b/taglib/mpeg/id3v2/id3v2frame.cpp @@ -85,12 +85,12 @@ namespace // static methods //////////////////////////////////////////////////////////////////////////////// -TagLib::uint Frame::headerSize() +unsigned int Frame::headerSize() { return Header::size(); } -TagLib::uint Frame::headerSize(uint version) +unsigned int Frame::headerSize(unsigned int version) { return Header::size(version); } @@ -173,7 +173,7 @@ ByteVector Frame::frameID() const return ByteVector(); } -TagLib::uint Frame::size() const +unsigned int Frame::size() const { if(d->header) return d->header->frameSize(); @@ -241,10 +241,10 @@ void Frame::parse(const ByteVector &data) ByteVector Frame::fieldData(const ByteVector &frameData) const { - uint headerSize = Header::size(d->header->version()); + unsigned int headerSize = Header::size(d->header->version()); - uint frameDataOffset = headerSize; - uint frameDataLength = size(); + unsigned int frameDataOffset = headerSize; + unsigned int frameDataLength = size(); if(d->header->compression() || d->header->dataLengthIndicator()) { frameDataLength = SynchData::toUInt(frameData.mid(headerSize, 4)); @@ -268,7 +268,7 @@ ByteVector Frame::fieldData(const ByteVector &frameData) const stream.avail_in = (uLongf) frameData.size() - frameDataOffset; stream.next_in = (Bytef *) frameData.data() + frameDataOffset; - static const uint chunkSize = 1024; + static const unsigned int chunkSize = 1024; ByteVector data; ByteVector chunk(chunkSize); @@ -335,7 +335,7 @@ String::Type Frame::checkEncoding(const StringList &fields, String::Type encodin return checkEncoding(fields, encoding, 4); } -String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, uint version) // static +String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding, unsigned int version) // static { if((encoding == String::UTF8 || encoding == String::UTF16BE) && version != 4) return String::UTF16; @@ -572,8 +572,8 @@ public: {} ByteVector frameID; - uint frameSize; - uint version; + unsigned int frameSize; + unsigned int version; // flags @@ -591,12 +591,12 @@ public: // static members (Frame::Header) //////////////////////////////////////////////////////////////////////////////// -TagLib::uint Frame::Header::size() +unsigned int Frame::Header::size() { return size(4); } -TagLib::uint Frame::Header::size(uint version) +unsigned int Frame::Header::size(unsigned int version) { switch(version) { case 0: @@ -620,7 +620,7 @@ Frame::Header::Header(const ByteVector &data, bool synchSafeInts) setData(data, synchSafeInts); } -Frame::Header::Header(const ByteVector &data, uint version) +Frame::Header::Header(const ByteVector &data, unsigned int version) { d = new HeaderPrivate; setData(data, version); @@ -633,10 +633,10 @@ Frame::Header::~Header() void Frame::Header::setData(const ByteVector &data, bool synchSafeInts) { - setData(data, uint(synchSafeInts ? 4 : 3)); + setData(data, static_cast<unsigned int>(synchSafeInts ? 4 : 3)); } -void Frame::Header::setData(const ByteVector &data, uint version) +void Frame::Header::setData(const ByteVector &data, unsigned int version) { d->version = version; @@ -777,22 +777,22 @@ void Frame::Header::setFrameID(const ByteVector &id) d->frameID = id.mid(0, 4); } -TagLib::uint Frame::Header::frameSize() const +unsigned int Frame::Header::frameSize() const { return d->frameSize; } -void Frame::Header::setFrameSize(uint size) +void Frame::Header::setFrameSize(unsigned int size) { d->frameSize = size; } -TagLib::uint Frame::Header::version() const +unsigned int Frame::Header::version() const { return d->version; } -void Frame::Header::setVersion(TagLib::uint version) +void Frame::Header::setVersion(unsigned int version) { d->version = version; } diff --git a/taglib/mpeg/id3v2/id3v2frame.h b/taglib/mpeg/id3v2/id3v2frame.h index ae1e2473..a179cd42 100644 --- a/taglib/mpeg/id3v2/id3v2frame.h +++ b/taglib/mpeg/id3v2/id3v2frame.h @@ -79,7 +79,7 @@ namespace TagLib { /*! * Returns the size of the frame. */ - uint size() const; + unsigned int size() const; /*! * Returns the size of the frame header @@ -89,14 +89,14 @@ namespace TagLib { * non-binary compatible release this will be made into a non-static * member that checks the internal ID3v2 version. */ - static uint headerSize(); // BIC: remove and make non-static + static unsigned int headerSize(); // BIC: remove and make non-static /*! * Returns the size of the frame header for the given ID3v2 version. * * \deprecated Please see the explanation above. */ - static uint headerSize(uint version); // BIC: remove and make non-static + static unsigned int headerSize(unsigned int version); // BIC: remove and make non-static /*! * Sets the data that will be used as the frame. Since the length is not @@ -242,7 +242,7 @@ namespace TagLib { */ // BIC: remove and make non-static static String::Type checkEncoding(const StringList &fields, - String::Type encoding, uint version); + String::Type encoding, unsigned int version); /*! * Checks a the list of string values to see if they can be used with the @@ -343,7 +343,7 @@ namespace TagLib { * * \a version should be the ID3v2 version of the tag. */ - explicit Header(const ByteVector &data, uint version = 4); + explicit Header(const ByteVector &data, unsigned int version = 4); /*! * Destroys this Header instance. @@ -362,7 +362,7 @@ namespace TagLib { * Sets the data for the Header. \a version should indicate the ID3v2 * version number of the tag that this frame is contained in. */ - void setData(const ByteVector &data, uint version = 4); + void setData(const ByteVector &data, unsigned int version = 4); /*! * Returns the Frame ID (Structure, <a href="id3v2-structure.html#4">4</a>) @@ -384,24 +384,24 @@ namespace TagLib { * Returns the size of the frame data portion, as set when setData() was * called or set explicitly via setFrameSize(). */ - uint frameSize() const; + unsigned int frameSize() const; /*! * Sets the size of the frame data portion. */ - void setFrameSize(uint size); + void setFrameSize(unsigned int size); /*! * Returns the ID3v2 version of the header, as passed in from the * construction of the header or set via setVersion(). */ - uint version() const; + unsigned int version() const; /*! * Sets the ID3v2 version of the header, changing has impact on the * correct parsing/rendering of frame data. */ - void setVersion(uint version); + void setVersion(unsigned int version); /*! * Returns the size of the frame header in bytes. @@ -411,7 +411,7 @@ namespace TagLib { * removed in the next binary incompatible release (2.0) and will be * replaced with a non-static method that checks the frame version. */ - static uint size(); + static unsigned int size(); /*! * Returns the size of the frame header in bytes for the ID3v2 version @@ -419,7 +419,7 @@ namespace TagLib { * * \deprecated Please see the explanation in the version above. */ - static uint size(uint version); + static unsigned int size(unsigned int version); /*! * Returns true if the flag for tag alter preservation is set. diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp index a462e21b..cfa6be23 100644 --- a/taglib/mpeg/id3v2/id3v2framefactory.cpp +++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp @@ -117,10 +117,10 @@ FrameFactory *FrameFactory::instance() Frame *FrameFactory::createFrame(const ByteVector &data, bool synchSafeInts) const { - return createFrame(data, uint(synchSafeInts ? 4 : 3)); + return createFrame(data, static_cast<unsigned int>(synchSafeInts ? 4 : 3)); } -Frame *FrameFactory::createFrame(const ByteVector &data, uint version) const +Frame *FrameFactory::createFrame(const ByteVector &data, unsigned int version) const { Header tagHeader; tagHeader.setMajorVersion(version); @@ -130,7 +130,7 @@ Frame *FrameFactory::createFrame(const ByteVector &data, uint version) const Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) const { ByteVector data = origData; - uint version = tagHeader->majorVersion(); + unsigned int version = tagHeader->majorVersion(); Frame::Header *header = new Frame::Header(data, version); ByteVector frameID = header->frameID(); @@ -138,7 +138,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) // characters. Also make sure that there is data in the frame. if(frameID.size() != (version < 3 ? 3 : 4) || - header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) || + header->frameSize() <= static_cast<unsigned int>(header->dataLengthIndicator() ? 4 : 0) || header->frameSize() > data.size()) { delete header; diff --git a/taglib/mpeg/id3v2/id3v2framefactory.h b/taglib/mpeg/id3v2/id3v2framefactory.h index c7da8694..fe81c71f 100644 --- a/taglib/mpeg/id3v2/id3v2framefactory.h +++ b/taglib/mpeg/id3v2/id3v2framefactory.h @@ -85,7 +85,7 @@ namespace TagLib { * \deprecated Please use the method below that accepts a ID3v2::Header * instance in new code. */ - Frame *createFrame(const ByteVector &data, uint version = 4) const; + Frame *createFrame(const ByteVector &data, unsigned int version = 4) const; /*! * Create a frame based on \a data. \a tagHeader should be a valid diff --git a/taglib/mpeg/id3v2/id3v2header.cpp b/taglib/mpeg/id3v2/id3v2header.cpp index 69d700ee..da4aba0a 100644 --- a/taglib/mpeg/id3v2/id3v2header.cpp +++ b/taglib/mpeg/id3v2/id3v2header.cpp @@ -48,22 +48,22 @@ public: footerPresent(false), tagSize(0) {} - uint majorVersion; - uint revisionNumber; + unsigned int majorVersion; + unsigned int revisionNumber; bool unsynchronisation; bool extendedHeader; bool experimentalIndicator; bool footerPresent; - uint tagSize; + unsigned int tagSize; }; //////////////////////////////////////////////////////////////////////////////// // static members //////////////////////////////////////////////////////////////////////////////// -TagLib::uint Header::size() +unsigned int Header::size() { return 10; } @@ -93,17 +93,17 @@ Header::~Header() delete d; } -TagLib::uint Header::majorVersion() const +unsigned int Header::majorVersion() const { return d->majorVersion; } -void Header::setMajorVersion(TagLib::uint version) +void Header::setMajorVersion(unsigned int version) { d->majorVersion = version; } -TagLib::uint Header::revisionNumber() const +unsigned int Header::revisionNumber() const { return d->revisionNumber; } @@ -128,12 +128,12 @@ bool Header::footerPresent() const return d->footerPresent; } -TagLib::uint Header::tagSize() const +unsigned int Header::tagSize() const { return d->tagSize; } -TagLib::uint Header::completeTagSize() const +unsigned int Header::completeTagSize() const { if(d->footerPresent) return d->tagSize + size() + Footer::size(); @@ -141,7 +141,7 @@ TagLib::uint Header::completeTagSize() const return d->tagSize + size(); } -void Header::setTagSize(uint s) +void Header::setTagSize(unsigned int s) { d->tagSize = s; } diff --git a/taglib/mpeg/id3v2/id3v2header.h b/taglib/mpeg/id3v2/id3v2header.h index 52294ddd..12fb6d02 100644 --- a/taglib/mpeg/id3v2/id3v2header.h +++ b/taglib/mpeg/id3v2/id3v2header.h @@ -67,7 +67,7 @@ namespace TagLib { * Returns the major version number. (Note: This is the 4, not the 2 in * ID3v2.4.0. The 2 is implied.) */ - uint majorVersion() const; + unsigned int majorVersion() const; /*! * Set the the major version number to \a version. (Note: This is @@ -78,13 +78,13 @@ namespace TagLib { * version which is written and in general should not be called by API * users. */ - void setMajorVersion(uint version); + void setMajorVersion(unsigned int version); /*! * Returns the revision number. (Note: This is the 0, not the 4 in * ID3v2.4.0. The 2 is implied.) */ - uint revisionNumber() const; + unsigned int revisionNumber() const; /*! * Returns true if unsynchronisation has been applied to all frames. @@ -116,7 +116,7 @@ namespace TagLib { * * \see completeTagSize() */ - uint tagSize() const; + unsigned int tagSize() const; /*! * Returns the tag size, including the header and, if present, the footer @@ -124,18 +124,18 @@ namespace TagLib { * * \see tagSize() */ - uint completeTagSize() const; + unsigned int completeTagSize() const; /*! * Set the tag size to \a s. * \see tagSize() */ - void setTagSize(uint s); + void setTagSize(unsigned int s); /*! * Returns the size of the header. Presently this is always 10 bytes. */ - static uint size(); + static unsigned int size(); /*! * Returns the string used to identify and ID3v2 tag inside of a file. diff --git a/taglib/mpeg/id3v2/id3v2synchdata.cpp b/taglib/mpeg/id3v2/id3v2synchdata.cpp index 03767371..b16c1987 100644 --- a/taglib/mpeg/id3v2/id3v2synchdata.cpp +++ b/taglib/mpeg/id3v2/id3v2synchdata.cpp @@ -30,9 +30,9 @@ using namespace TagLib; using namespace ID3v2; -TagLib::uint SynchData::toUInt(const ByteVector &data) +unsigned int SynchData::toUInt(const ByteVector &data) { - uint sum = 0; + unsigned int sum = 0; bool notSynchSafe = false; int last = data.size() > 4 ? 3 : data.size() - 1; @@ -62,7 +62,7 @@ TagLib::uint SynchData::toUInt(const ByteVector &data) return sum; } -ByteVector SynchData::fromUInt(uint value) +ByteVector SynchData::fromUInt(unsigned int value) { ByteVector v(4, 0); diff --git a/taglib/mpeg/id3v2/id3v2synchdata.h b/taglib/mpeg/id3v2/id3v2synchdata.h index 4a1f596a..13e07161 100644 --- a/taglib/mpeg/id3v2/id3v2synchdata.h +++ b/taglib/mpeg/id3v2/id3v2synchdata.h @@ -51,12 +51,12 @@ namespace TagLib { * <a href="id3v2-structure.html#6.2">6.2</a>). The default \a length of * 4 is used if another value is not specified. */ - TAGLIB_EXPORT uint toUInt(const ByteVector &data); + TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data); /*! * Returns a 4 byte (32 bit) synchsafe integer based on \a value. */ - TAGLIB_EXPORT ByteVector fromUInt(uint value); + TAGLIB_EXPORT ByteVector fromUInt(unsigned int value); /*! * Convert the data from unsynchronized data to its original format. diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index 224a607f..b826ecaa 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -212,14 +212,14 @@ String ID3v2::Tag::genre() const return genres.toString(); } -TagLib::uint ID3v2::Tag::year() const +unsigned int ID3v2::Tag::year() const { if(!d->frameListMap["TDRC"].isEmpty()) return d->frameListMap["TDRC"].front()->toString().substr(0, 4).toInt(); return 0; } -TagLib::uint ID3v2::Tag::track() const +unsigned int ID3v2::Tag::track() const { if(!d->frameListMap["TRCK"].isEmpty()) return d->frameListMap["TRCK"].front()->toString().toInt(); @@ -283,7 +283,7 @@ void ID3v2::Tag::setGenre(const String &s) #endif } -void ID3v2::Tag::setYear(uint i) +void ID3v2::Tag::setYear(unsigned int i) { if(i <= 0) { removeFrames("TDRC"); @@ -292,7 +292,7 @@ void ID3v2::Tag::setYear(uint i) setTextFrame("TDRC", String::number(i)); } -void ID3v2::Tag::setTrack(uint i) +void ID3v2::Tag::setTrack(unsigned int i) { if(i <= 0) { removeFrames("TRCK"); @@ -539,14 +539,14 @@ void ID3v2::Tag::downgradeFrames(FrameList *frames, FrameList *newFrames) const StringList people; if(frameTMCL) { StringList v24People = frameTMCL->fieldList(); - for(uint i = 0; i + 1 < v24People.size(); i += 2) { + for(unsigned int i = 0; i + 1 < v24People.size(); i += 2) { people.append(v24People[i]); people.append(v24People[i+1]); } } if(frameTIPL) { StringList v24People = frameTIPL->fieldList(); - for(uint i = 0; i + 1 < v24People.size(); i += 2) { + for(unsigned int i = 0; i + 1 < v24People.size(); i += 2) { people.append(v24People[i]); people.append(v24People[i+1]); } @@ -628,7 +628,7 @@ ByteVector ID3v2::Tag::render(int version) const paddingSize = MinPaddingSize; } - tagData.resize(static_cast<uint>(tagData.size() + paddingSize), '\0'); + tagData.resize(static_cast<unsigned int>(tagData.size() + paddingSize), '\0'); // Set the version and data size. d->header.setMajorVersion(version); @@ -686,7 +686,7 @@ void ID3v2::Tag::read(TagLib::File *file, long offset) // This is a workaround for some faulty files that have duplicate ID3v2 tags. // Unfortunately, TagLib itself may write such duplicate tags until v1.10. - uint extraSize = 0; + unsigned int extraSize = 0; while(true) { @@ -712,8 +712,8 @@ void ID3v2::Tag::parse(const ByteVector &origData) if(d->header.unsynchronisation() && d->header.majorVersion() <= 3) data = SynchData::decode(data); - uint frameDataPosition = 0; - uint frameDataLength = data.size(); + unsigned int frameDataPosition = 0; + unsigned int frameDataLength = data.size(); // check for extended header diff --git a/taglib/mpeg/id3v2/id3v2tag.h b/taglib/mpeg/id3v2/id3v2tag.h index af0efdc3..dcd55a0c 100644 --- a/taglib/mpeg/id3v2/id3v2tag.h +++ b/taglib/mpeg/id3v2/id3v2tag.h @@ -169,16 +169,16 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual uint year() const; - virtual uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); virtual bool isEmpty() const; diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp index 716c2cfa..9db73953 100644 --- a/taglib/mpeg/mpegfile.cpp +++ b/taglib/mpeg/mpegfile.cpp @@ -87,11 +87,11 @@ public: const ID3v2::FrameFactory *ID3v2FrameFactory; long ID3v2Location; - uint ID3v2OriginalSize; + unsigned int ID3v2OriginalSize; long APELocation; long APEFooterLocation; - uint APEOriginalSize; + unsigned int APEOriginalSize; long ID3v1Location; @@ -393,7 +393,7 @@ long MPEG::File::nextFrameOffset(long position) if(foundLastSyncPattern && secondSynchByte(buffer[0])) return position - 1; - for(uint i = 0; i < buffer.size() - 1; i++) { + for(unsigned int i = 0; i < buffer.size() - 1; i++) { if(firstSyncByte(buffer[i]) && secondSynchByte(buffer[i + 1])) return position + i; } diff --git a/taglib/mpeg/xingheader.cpp b/taglib/mpeg/xingheader.cpp index 6e554599..6c2b25dc 100644 --- a/taglib/mpeg/xingheader.cpp +++ b/taglib/mpeg/xingheader.cpp @@ -40,8 +40,8 @@ public: size(0), type(MPEG::XingHeader::Invalid) {} - uint frames; - uint size; + unsigned int frames; + unsigned int size; MPEG::XingHeader::HeaderType type; }; @@ -66,12 +66,12 @@ bool MPEG::XingHeader::isValid() const return (d->type != Invalid && d->frames > 0 && d->size > 0); } -TagLib::uint MPEG::XingHeader::totalFrames() const +unsigned int MPEG::XingHeader::totalFrames() const { return d->frames; } -TagLib::uint MPEG::XingHeader::totalSize() const +unsigned int MPEG::XingHeader::totalSize() const { return d->size; } diff --git a/taglib/mpeg/xingheader.h b/taglib/mpeg/xingheader.h index cd417157..f512e234 100644 --- a/taglib/mpeg/xingheader.h +++ b/taglib/mpeg/xingheader.h @@ -93,12 +93,12 @@ namespace TagLib { /*! * Returns the total number of frames. */ - uint totalFrames() const; + unsigned int totalFrames() const; /*! * Returns the total size of stream in bytes. */ - uint totalSize() const; + unsigned int totalSize() const; /*! * Returns the type of the VBR header. diff --git a/taglib/ogg/flac/oggflacfile.cpp b/taglib/ogg/flac/oggflacfile.cpp index 1258e705..3a36ebe8 100644 --- a/taglib/ogg/flac/oggflacfile.cpp +++ b/taglib/ogg/flac/oggflacfile.cpp @@ -247,7 +247,7 @@ void Ogg::FLAC::File::scan() char blockType = header[0] & 0x7f; bool lastBlock = (header[0] & 0x80) != 0; - uint length = header.toUInt(1, 3, true); + unsigned int length = header.toUInt(1, 3, true); overhead += length; // Sanity: First block should be the stream_info metadata diff --git a/taglib/ogg/oggfile.cpp b/taglib/ogg/oggfile.cpp index 82781412..4b105b9a 100644 --- a/taglib/ogg/oggfile.cpp +++ b/taglib/ogg/oggfile.cpp @@ -53,7 +53,7 @@ public: delete lastPageHeader; } - uint streamSerialNumber; + unsigned int streamSerialNumber; List<Page *> pages; PageHeader *firstPageHeader; PageHeader *lastPageHeader; @@ -78,7 +78,7 @@ Ogg::File::~File() delete d; } -ByteVector Ogg::File::packet(uint i) +ByteVector Ogg::File::packet(unsigned int i) { // Check to see if we're called setPacket() for this packet since the last // save: @@ -100,7 +100,7 @@ ByteVector Ogg::File::packet(uint i) // If the last read stopped at the packet that we're interested in, don't // reread its packet list. (This should make sequential packet reads fast.) - uint pageIndex = d->packetToPageMap[i].front(); + unsigned int pageIndex = d->packetToPageMap[i].front(); if(d->currentPacketPage != d->pages[pageIndex]) { d->currentPacketPage = d->pages[pageIndex]; d->currentPackets = d->currentPacketPage->packets(); @@ -136,7 +136,7 @@ ByteVector Ogg::File::packet(uint i) return packet; } -void Ogg::File::setPacket(uint i, const ByteVector &p) +void Ogg::File::setPacket(unsigned int i, const ByteVector &p) { while(d->packetToPageMap.size() <= i) { if(!nextPage()) { @@ -265,8 +265,8 @@ bool Ogg::File::nextPage() // Loop through the packets in the page that we just read appending the // current page number to the packet to page map for each packet. - for(uint i = 0; i < d->currentPage->packetCount(); i++) { - uint currentPacket = d->currentPage->firstPacketIndex() + i; + for(unsigned int i = 0; i < d->currentPage->packetCount(); i++) { + unsigned int currentPacket = d->currentPage->firstPacketIndex() + i; if(d->packetToPageMap.size() <= currentPacket) d->packetToPageMap.push_back(List<int>()); d->packetToPageMap[currentPacket].append(d->pages.size() - 1); @@ -308,12 +308,12 @@ void Ogg::File::writePageGroup(const List<int> &thePageGroup) int originalSize = 0; for(List<int>::ConstIterator it = pageGroup.begin(); it != pageGroup.end(); ++it) { - uint firstPacket = d->pages[*it]->firstPacketIndex(); - uint lastPacket = firstPacket + d->pages[*it]->packetCount() - 1; + unsigned int firstPacket = d->pages[*it]->firstPacketIndex(); + unsigned int lastPacket = firstPacket + d->pages[*it]->packetCount() - 1; List<int>::ConstIterator last = --pageGroup.end(); - for(uint i = firstPacket; i <= lastPacket; i++) { + for(unsigned int i = firstPacket; i <= lastPacket; i++) { if(it == last && i == lastPacket && !d->dirtyPages.contains(i)) packets.append(d->pages[*it]->packets().back()); diff --git a/taglib/ogg/oggfile.h b/taglib/ogg/oggfile.h index 8fed4ba0..c24e0153 100644 --- a/taglib/ogg/oggfile.h +++ b/taglib/ogg/oggfile.h @@ -59,12 +59,12 @@ namespace TagLib { * \warning The requires reading at least the packet header for every page * up to the requested page. */ - ByteVector packet(uint i); + ByteVector packet(unsigned int i); /*! * Sets the packet with index \a i to the value \a p. */ - void setPacket(uint i, const ByteVector &p); + void setPacket(unsigned int i, const ByteVector &p); /*! * Returns a pointer to the PageHeader for the first page in the stream or diff --git a/taglib/ogg/oggpage.cpp b/taglib/ogg/oggpage.cpp index e5f767ec..0268c739 100644 --- a/taglib/ogg/oggpage.cpp +++ b/taglib/ogg/oggpage.cpp @@ -131,7 +131,7 @@ Ogg::Page::ContainsPacketFlags Ogg::Page::containsPacket(int index) const return flags; } -TagLib::uint Ogg::Page::packetCount() const +unsigned int Ogg::Page::packetCount() const { return d->header.packetSizes().size(); } @@ -197,7 +197,7 @@ ByteVector Ogg::Page::render() const List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets, PaginationStrategy strategy, - uint streamSerialNumber, + unsigned int streamSerialNumber, int firstPage, bool firstPacketContinued, bool lastPacketCompleted, @@ -310,7 +310,7 @@ Ogg::Page* Ogg::Page::getCopyWithNewPageSequenceNumber(int sequenceNumber) //////////////////////////////////////////////////////////////////////////////// Ogg::Page::Page(const ByteVectorList &packets, - uint streamSerialNumber, + unsigned int streamSerialNumber, int pageNumber, bool firstPacketContinued, bool lastPacketCompleted, diff --git a/taglib/ogg/oggpage.h b/taglib/ogg/oggpage.h index 9ec79407..d4bb34d2 100644 --- a/taglib/ogg/oggpage.h +++ b/taglib/ogg/oggpage.h @@ -121,7 +121,7 @@ namespace TagLib { /*! * Returns the number of packets (whole or partial) in this page. */ - uint packetCount() const; + unsigned int packetCount() const; /*! * Returns a list of the packets in this page. @@ -181,7 +181,7 @@ namespace TagLib { */ static List<Page *> paginate(const ByteVectorList &packets, PaginationStrategy strategy, - uint streamSerialNumber, + unsigned int streamSerialNumber, int firstPage, bool firstPacketContinued = false, bool lastPacketCompleted = true, @@ -193,7 +193,7 @@ namespace TagLib { * for each page will be set to \a pageNumber. */ Page(const ByteVectorList &packets, - uint streamSerialNumber, + unsigned int streamSerialNumber, int pageNumber, bool firstPacketContinued = false, bool lastPacketCompleted = true, diff --git a/taglib/ogg/oggpageheader.cpp b/taglib/ogg/oggpageheader.cpp index 54c6c259..43ed2a00 100644 --- a/taglib/ogg/oggpageheader.cpp +++ b/taglib/ogg/oggpageheader.cpp @@ -63,7 +63,7 @@ public: bool firstPageOfStream; bool lastPageOfStream; long long absoluteGranularPosition; - uint streamSerialNumber; + unsigned int streamSerialNumber; int pageSequenceNumber; int size; int dataSize; @@ -160,12 +160,12 @@ void Ogg::PageHeader::setPageSequenceNumber(int sequenceNumber) d->pageSequenceNumber = sequenceNumber; } -TagLib::uint Ogg::PageHeader::streamSerialNumber() const +unsigned int Ogg::PageHeader::streamSerialNumber() const { return d->streamSerialNumber; } -void Ogg::PageHeader::setStreamSerialNumber(uint n) +void Ogg::PageHeader::setStreamSerialNumber(unsigned int n) { d->streamSerialNumber = n; } diff --git a/taglib/ogg/oggpageheader.h b/taglib/ogg/oggpageheader.h index 742710a4..8ff1232b 100644 --- a/taglib/ogg/oggpageheader.h +++ b/taglib/ogg/oggpageheader.h @@ -169,7 +169,7 @@ namespace TagLib { * * \see setStreamSerialNumber() */ - uint streamSerialNumber() const; + unsigned int streamSerialNumber() const; /*! * Every Ogg logical stream is given a random serial number which is common @@ -179,7 +179,7 @@ namespace TagLib { * * \see streamSerialNumber() */ - void setStreamSerialNumber(uint n); + void setStreamSerialNumber(unsigned int n); /*! * Returns the index of the page within the Ogg stream. This helps make it diff --git a/taglib/ogg/opus/opusproperties.cpp b/taglib/ogg/opus/opusproperties.cpp index 43858da6..537ba166 100644 --- a/taglib/ogg/opus/opusproperties.cpp +++ b/taglib/ogg/opus/opusproperties.cpp @@ -127,7 +127,7 @@ void Opus::Properties::read(File *file) const ByteVector data = file->packet(0); // *Magic Signature* - uint pos = 8; + unsigned int pos = 8; // *Version* (8 bits, unsigned) d->opusVersion = static_cast<unsigned char>(data.at(pos)); diff --git a/taglib/ogg/speex/speexproperties.cpp b/taglib/ogg/speex/speexproperties.cpp index e486e449..fbcc5a4b 100644 --- a/taglib/ogg/speex/speexproperties.cpp +++ b/taglib/ogg/speex/speexproperties.cpp @@ -131,7 +131,7 @@ void Speex::Properties::read(File *file) return; } - uint pos = 28; + unsigned int pos = 28; // speex_version_id; /**< Version for Speex (for checking compatibility) */ d->speexVersion = data.toUInt(pos, false); diff --git a/taglib/ogg/vorbis/vorbisproperties.cpp b/taglib/ogg/vorbis/vorbisproperties.cpp index cef0b395..981400f0 100644 --- a/taglib/ogg/vorbis/vorbisproperties.cpp +++ b/taglib/ogg/vorbis/vorbisproperties.cpp @@ -144,7 +144,7 @@ void Vorbis::Properties::read(File *file) return; } - uint pos = 0; + unsigned int pos = 0; if(data.mid(pos, 7) != vorbisSetupHeaderID) { debug("Vorbis::Properties::read() -- invalid Vorbis identification header"); diff --git a/taglib/ogg/xiphcomment.cpp b/taglib/ogg/xiphcomment.cpp index 9a81df17..bb62069e 100644 --- a/taglib/ogg/xiphcomment.cpp +++ b/taglib/ogg/xiphcomment.cpp @@ -121,7 +121,7 @@ String Ogg::XiphComment::genre() const return d->fieldListMap["GENRE"].toString(); } -TagLib::uint Ogg::XiphComment::year() const +unsigned int Ogg::XiphComment::year() const { if(!d->fieldListMap["DATE"].isEmpty()) return d->fieldListMap["DATE"].front().toInt(); @@ -130,7 +130,7 @@ TagLib::uint Ogg::XiphComment::year() const return 0; } -TagLib::uint Ogg::XiphComment::track() const +unsigned int Ogg::XiphComment::track() const { if(!d->fieldListMap["TRACKNUMBER"].isEmpty()) return d->fieldListMap["TRACKNUMBER"].front().toInt(); @@ -171,7 +171,7 @@ void Ogg::XiphComment::setGenre(const String &s) addField("GENRE", s); } -void Ogg::XiphComment::setYear(uint i) +void Ogg::XiphComment::setYear(unsigned int i) { removeFields("YEAR"); if(i == 0) @@ -180,7 +180,7 @@ void Ogg::XiphComment::setYear(uint i) addField("DATE", String::number(i)); } -void Ogg::XiphComment::setTrack(uint i) +void Ogg::XiphComment::setTrack(unsigned int i) { removeFields("TRACKNUM"); if(i == 0) @@ -199,9 +199,9 @@ bool Ogg::XiphComment::isEmpty() const return true; } -TagLib::uint Ogg::XiphComment::fieldCount() const +unsigned int Ogg::XiphComment::fieldCount() const { - uint count = 0; + unsigned int count = 0; for(FieldConstIterator it = d->fieldListMap.begin(); it != d->fieldListMap.end(); ++it) count += (*it).second.size(); @@ -411,9 +411,9 @@ void Ogg::XiphComment::parse(const ByteVector &data) // The first thing in the comment data is the vendor ID length, followed by a // UTF8 string with the vendor ID. - uint pos = 0; + unsigned int pos = 0; - const uint vendorLength = data.toUInt(0, false); + const unsigned int vendorLength = data.toUInt(0, false); pos += 4; d->vendorID = String(data.mid(pos, vendorLength), String::UTF8); @@ -421,19 +421,19 @@ void Ogg::XiphComment::parse(const ByteVector &data) // Next the number of fields in the comment vector. - const uint commentFields = data.toUInt(pos, false); + const unsigned int commentFields = data.toUInt(pos, false); pos += 4; if(commentFields > (data.size() - 8) / 4) { return; } - for(uint i = 0; i < commentFields; i++) { + for(unsigned int i = 0; i < commentFields; i++) { // Each comment field is in the format "KEY=value" in a UTF8 string and has // 4 bytes before the text starts that gives the length. - const uint commentLength = data.toUInt(pos, false); + const unsigned int commentLength = data.toUInt(pos, false); pos += 4; ByteVector entry = data.mid(pos, commentLength); diff --git a/taglib/ogg/xiphcomment.h b/taglib/ogg/xiphcomment.h index 7f6d4e89..055477da 100644 --- a/taglib/ogg/xiphcomment.h +++ b/taglib/ogg/xiphcomment.h @@ -85,23 +85,23 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual uint year() const; - virtual uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); virtual bool isEmpty() const; /*! * Returns the number of fields present in the comment. */ - uint fieldCount() const; + unsigned int fieldCount() const; /*! * Returns a reference to the map of field lists. Because Xiph comments diff --git a/taglib/riff/aiff/aifffile.cpp b/taglib/riff/aiff/aifffile.cpp index 28f4b803..1a29938c 100644 --- a/taglib/riff/aiff/aifffile.cpp +++ b/taglib/riff/aiff/aifffile.cpp @@ -140,7 +140,7 @@ bool RIFF::AIFF::File::hasID3v2Tag() const void RIFF::AIFF::File::read(bool readProperties) { - for(uint i = 0; i < chunkCount(); ++i) { + for(unsigned int i = 0; i < chunkCount(); ++i) { const ByteVector name = chunkName(i); if(name == "ID3 " || name == "id3 ") { if(!d->tag) { diff --git a/taglib/riff/aiff/aiffproperties.cpp b/taglib/riff/aiff/aiffproperties.cpp index 020ac6cf..e1d954fe 100644 --- a/taglib/riff/aiff/aiffproperties.cpp +++ b/taglib/riff/aiff/aiffproperties.cpp @@ -50,7 +50,7 @@ public: ByteVector compressionType; String compressionName; - uint sampleFrames; + unsigned int sampleFrames; }; //////////////////////////////////////////////////////////////////////////////// @@ -116,7 +116,7 @@ int RIFF::AIFF::Properties::sampleWidth() const return bitsPerSample(); } -TagLib::uint RIFF::AIFF::Properties::sampleFrames() const +unsigned int RIFF::AIFF::Properties::sampleFrames() const { return d->sampleFrames; } @@ -143,8 +143,8 @@ String RIFF::AIFF::Properties::compressionName() const void RIFF::AIFF::Properties::read(File *file) { ByteVector data; - uint streamLength = 0; - for(uint i = 0; i < file->chunkCount(); i++) { + unsigned int streamLength = 0; + for(unsigned int i = 0; i < file->chunkCount(); i++) { const ByteVector name = file->chunkName(i); if(name == "COMM") { if(data.isEmpty()) diff --git a/taglib/riff/aiff/aiffproperties.h b/taglib/riff/aiff/aiffproperties.h index 1d92ac87..d8bbaca9 100644 --- a/taglib/riff/aiff/aiffproperties.h +++ b/taglib/riff/aiff/aiffproperties.h @@ -124,7 +124,7 @@ namespace TagLib { /*! * Returns the number of sample frames */ - uint sampleFrames() const; + unsigned int sampleFrames() const; /*! * Returns true if the file is in AIFF-C format, false if AIFF format. diff --git a/taglib/riff/rifffile.cpp b/taglib/riff/rifffile.cpp index 2518dd9e..b96d3db5 100644 --- a/taglib/riff/rifffile.cpp +++ b/taglib/riff/rifffile.cpp @@ -37,10 +37,10 @@ using namespace TagLib; struct Chunk { - ByteVector name; - TagLib::uint offset; - TagLib::uint size; - char padding; + ByteVector name; + unsigned int offset; + unsigned int size; + unsigned int padding; }; class RIFF::File::FilePrivate @@ -51,9 +51,9 @@ public: size(0) {} const Endianness endianness; - ByteVector type; - TagLib::uint size; - ByteVector format; + ByteVector type; + unsigned int size; + ByteVector format; std::vector<Chunk> chunks; }; @@ -87,32 +87,32 @@ RIFF::File::File(IOStream *stream, Endianness endianness) : read(); } -TagLib::uint RIFF::File::riffSize() const +unsigned int RIFF::File::riffSize() const { return d->size; } -TagLib::uint RIFF::File::chunkCount() const +unsigned int RIFF::File::chunkCount() const { return d->chunks.size(); } -TagLib::uint RIFF::File::chunkDataSize(uint i) const +unsigned int RIFF::File::chunkDataSize(unsigned int i) const { return d->chunks[i].size; } -TagLib::uint RIFF::File::chunkOffset(uint i) const +unsigned int RIFF::File::chunkOffset(unsigned int i) const { return d->chunks[i].offset; } -TagLib::uint RIFF::File::chunkPadding(uint i) const +unsigned int RIFF::File::chunkPadding(unsigned int i) const { return d->chunks[i].padding; } -ByteVector RIFF::File::chunkName(uint i) const +ByteVector RIFF::File::chunkName(unsigned int i) const { if(i >= chunkCount()) return ByteVector(); @@ -120,7 +120,7 @@ ByteVector RIFF::File::chunkName(uint i) const return d->chunks[i].name; } -ByteVector RIFF::File::chunkData(uint i) +ByteVector RIFF::File::chunkData(unsigned int i) { if(i >= chunkCount()) return ByteVector(); @@ -129,7 +129,7 @@ ByteVector RIFF::File::chunkData(uint i) return readBlock(d->chunks[i].size); } -void RIFF::File::setChunkData(uint i, const ByteVector &data) +void RIFF::File::setChunkData(unsigned int i, const ByteVector &data) { // First we update the global size @@ -167,7 +167,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo } if(!alwaysCreate) { - for(uint i = 0; i < d->chunks.size(); i++) { + for(unsigned int i = 0; i < d->chunks.size(); i++) { if(d->chunks[i].name == name) { setChunkData(i, data); return; @@ -177,7 +177,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo // Couldn't find an existing chunk, so let's create a new one. - uint i = d->chunks.size() - 1; + unsigned int i = d->chunks.size() - 1; unsigned long offset = d->chunks[i].offset + d->chunks[i].size; // First we update the global size @@ -205,7 +205,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo d->chunks.push_back(chunk); } -void RIFF::File::removeChunk(uint i) +void RIFF::File::removeChunk(unsigned int i) { if(i >= d->chunks.size()) return; @@ -213,7 +213,7 @@ void RIFF::File::removeChunk(uint i) std::vector<Chunk>::iterator it = d->chunks.begin(); std::advance(it, i); - const uint removeSize = it->size + it->padding + 8; + const unsigned int removeSize = it->size + it->padding + 8; removeBlock(it->offset - 8, removeSize); it = d->chunks.erase(it); @@ -244,7 +244,7 @@ void RIFF::File::read() // + 8: chunk header at least, fix for additional junk bytes while(tell() + 8 <= length()) { ByteVector chunkName = readBlock(4); - uint chunkSize = readBlock(4).toUInt(bigEndian); + unsigned int chunkSize = readBlock(4).toUInt(bigEndian); if(!isValidChunkName(chunkName)) { debug("RIFF::File::read() -- Chunk '" + chunkName + "' has invalid ID"); @@ -284,7 +284,8 @@ void RIFF::File::read() } void RIFF::File::writeChunk(const ByteVector &name, const ByteVector &data, - unsigned long offset, unsigned long replace, uint leadingPadding) + unsigned long offset, unsigned long replace, + unsigned int leadingPadding) { ByteVector combined; if(leadingPadding) { diff --git a/taglib/riff/rifffile.h b/taglib/riff/rifffile.h index 766ae0c4..52e75134 100644 --- a/taglib/riff/rifffile.h +++ b/taglib/riff/rifffile.h @@ -61,46 +61,46 @@ namespace TagLib { /*! * \return The size of the main RIFF chunk. */ - uint riffSize() const; + unsigned int riffSize() const; /*! * \return The number of chunks in the file. */ - uint chunkCount() const; + unsigned int chunkCount() const; /*! * \return The offset within the file for the selected chunk number. */ - uint chunkOffset(uint i) const; + unsigned int chunkOffset(unsigned int i) const; /*! * \return The size of the chunk data. */ - uint chunkDataSize(uint i) const; + unsigned int chunkDataSize(unsigned int i) const; /*! * \return The size of the padding after the chunk (can be either 0 or 1). */ - uint chunkPadding(uint i) const; + unsigned int chunkPadding(unsigned int i) const; /*! * \return The name of the specified chunk, for instance, "COMM" or "ID3 " */ - ByteVector chunkName(uint i) const; + ByteVector chunkName(unsigned int i) const; /*! * Reads the chunk data from the file and returns it. * * \note This \e will move the read pointer for the file. */ - ByteVector chunkData(uint i); + ByteVector chunkData(unsigned int i); /*! * Sets the data for the specified chunk to \a data. * * \warning This will update the file immediately. */ - void setChunkData(uint i, const ByteVector &data); + void setChunkData(unsigned int i, const ByteVector &data); /*! * Sets the data for the chunk \a name to \a data. If a chunk with the @@ -129,7 +129,7 @@ namespace TagLib { * * \warning This will update the file immediately. */ - void removeChunk(uint i); + void removeChunk(unsigned int i); /*! * Removes the chunk \a name. @@ -146,7 +146,7 @@ namespace TagLib { void read(); void writeChunk(const ByteVector &name, const ByteVector &data, unsigned long offset, unsigned long replace = 0, - uint leadingPadding = 0); + unsigned int leadingPadding = 0); class FilePrivate; FilePrivate *d; diff --git a/taglib/riff/wav/infotag.cpp b/taglib/riff/wav/infotag.cpp index 00d1f1c5..df1cfbee 100644 --- a/taglib/riff/wav/infotag.cpp +++ b/taglib/riff/wav/infotag.cpp @@ -113,12 +113,12 @@ String RIFF::Info::Tag::genre() const return fieldText("IGNR"); } -TagLib::uint RIFF::Info::Tag::year() const +unsigned int RIFF::Info::Tag::year() const { return fieldText("ICRD").substr(0, 4).toInt(); } -TagLib::uint RIFF::Info::Tag::track() const +unsigned int RIFF::Info::Tag::track() const { return fieldText("IPRT").toInt(); } @@ -148,7 +148,7 @@ void RIFF::Info::Tag::setGenre(const String &s) setFieldText("IGNR", s); } -void RIFF::Info::Tag::setYear(uint i) +void RIFF::Info::Tag::setYear(unsigned int i) { if(i != 0) setFieldText("ICRD", String::number(i)); @@ -156,7 +156,7 @@ void RIFF::Info::Tag::setYear(uint i) d->fieldListMap.erase("ICRD"); } -void RIFF::Info::Tag::setTrack(uint i) +void RIFF::Info::Tag::setTrack(unsigned int i) { if(i != 0) setFieldText("IPRT", String::number(i)); @@ -239,9 +239,9 @@ void RIFF::Info::Tag::setStringHandler(const StringHandler *handler) void RIFF::Info::Tag::parse(const ByteVector &data) { - uint p = 4; + unsigned int p = 4; while(p < data.size()) { - const uint size = data.toUInt(p + 4, false); + const unsigned int size = data.toUInt(p + 4, false); if(size > data.size() - p - 8) break; diff --git a/taglib/riff/wav/infotag.h b/taglib/riff/wav/infotag.h index 440e7b93..d1f0297d 100644 --- a/taglib/riff/wav/infotag.h +++ b/taglib/riff/wav/infotag.h @@ -107,16 +107,16 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual uint year() const; - virtual uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); virtual bool isEmpty() const; diff --git a/taglib/riff/wav/wavfile.cpp b/taglib/riff/wav/wavfile.cpp index bdcfa474..79ff9167 100644 --- a/taglib/riff/wav/wavfile.cpp +++ b/taglib/riff/wav/wavfile.cpp @@ -189,7 +189,7 @@ bool RIFF::WAV::File::hasInfoTag() const void RIFF::WAV::File::read(bool readProperties) { - for(uint i = 0; i < chunkCount(); ++i) { + for(unsigned int i = 0; i < chunkCount(); ++i) { const ByteVector name = chunkName(i); if(name == "ID3 " || name == "id3 ") { if(!d->tag[ID3v2Index]) { diff --git a/taglib/riff/wav/wavproperties.cpp b/taglib/riff/wav/wavproperties.cpp index 39f0dddc..df7cdbae 100644 --- a/taglib/riff/wav/wavproperties.cpp +++ b/taglib/riff/wav/wavproperties.cpp @@ -57,21 +57,21 @@ public: int sampleRate; int channels; int bitsPerSample; - uint sampleFrames; + unsigned int sampleFrames; }; //////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// -RIFF::WAV::Properties::Properties(const ByteVector & /*data*/, ReadStyle style) : +RIFF::WAV::Properties::Properties(const ByteVector &, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { debug("RIFF::WAV::Properties::Properties() -- This constructor is no longer used."); } -RIFF::WAV::Properties::Properties(const ByteVector & /*data*/, uint /*streamLength*/, ReadStyle style) : +RIFF::WAV::Properties::Properties(const ByteVector &, unsigned int, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { @@ -130,7 +130,7 @@ int RIFF::WAV::Properties::sampleWidth() const return bitsPerSample(); } -TagLib::uint RIFF::WAV::Properties::sampleFrames() const +unsigned int RIFF::WAV::Properties::sampleFrames() const { return d->sampleFrames; } @@ -147,10 +147,10 @@ int RIFF::WAV::Properties::format() const void RIFF::WAV::Properties::read(File *file) { ByteVector data; - uint streamLength = 0; - uint totalSamples = 0; + unsigned int streamLength = 0; + unsigned int totalSamples = 0; - for(uint i = 0; i < file->chunkCount(); ++i) { + for(unsigned int i = 0; i < file->chunkCount(); ++i) { const ByteVector name = file->chunkName(i); if(name == "fmt ") { if(data.isEmpty()) @@ -203,7 +203,7 @@ void RIFF::WAV::Properties::read(File *file) d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5); } else { - const uint byteRate = data.toUInt(8, false); + const unsigned int byteRate = data.toUInt(8, false); if(byteRate > 0) { d->length = static_cast<int>(streamLength * 1000.0 / byteRate + 0.5); d->bitrate = static_cast<int>(byteRate * 8.0 / 1000.0 + 0.5); diff --git a/taglib/riff/wav/wavproperties.h b/taglib/riff/wav/wavproperties.h index 1fd6a136..6716876a 100644 --- a/taglib/riff/wav/wavproperties.h +++ b/taglib/riff/wav/wavproperties.h @@ -63,7 +63,7 @@ namespace TagLib { * * \deprecated */ - Properties(const ByteVector &data, uint streamLength, ReadStyle style); + Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style); /*! * Create an instance of WAV::Properties with the data read from the @@ -135,7 +135,7 @@ namespace TagLib { /*! * Returns the number of sample frames. */ - uint sampleFrames() const; + unsigned int sampleFrames() const; /*! * Returns the format ID of the file. diff --git a/taglib/tag.h b/taglib/tag.h index e04567b7..be9628c8 100644 --- a/taglib/tag.h +++ b/taglib/tag.h @@ -111,13 +111,13 @@ namespace TagLib { /*! * Returns the year; if there is no year set, this will return 0. */ - virtual uint year() const = 0; + virtual unsigned int year() const = 0; /*! * Returns the track number; if there is no track number set, this will * return 0. */ - virtual uint track() const = 0; + virtual unsigned int track() const = 0; /*! * Sets the title to \a s. If \a s is String::null then this value will be @@ -155,12 +155,12 @@ namespace TagLib { /*! * Sets the year to \a i. If \a s is 0 then this value will be cleared. */ - virtual void setYear(uint i) = 0; + virtual void setYear(unsigned int i) = 0; /*! * Sets the track to \a i. If \a s is 0 then this value will be cleared. */ - virtual void setTrack(uint i) = 0; + virtual void setTrack(unsigned int i) = 0; /*! * Returns true if the tag does not contain any data. This should be diff --git a/taglib/tagunion.cpp b/taglib/tagunion.cpp index 30a53583..c10d72b2 100644 --- a/taglib/tagunion.cpp +++ b/taglib/tagunion.cpp @@ -190,12 +190,12 @@ String TagUnion::genre() const stringUnion(genre); } -TagLib::uint TagUnion::year() const +unsigned int TagUnion::year() const { numberUnion(year); } -TagLib::uint TagUnion::track() const +unsigned int TagUnion::track() const { numberUnion(track); } @@ -225,12 +225,12 @@ void TagUnion::setGenre(const String &s) setUnion(Genre, s); } -void TagUnion::setYear(uint i) +void TagUnion::setYear(unsigned int i) { setUnion(Year, i); } -void TagUnion::setTrack(uint i) +void TagUnion::setTrack(unsigned int i) { setUnion(Track, i); } diff --git a/taglib/tagunion.h b/taglib/tagunion.h index 0a3b3a20..1eb38a01 100644 --- a/taglib/tagunion.h +++ b/taglib/tagunion.h @@ -64,16 +64,16 @@ namespace TagLib { virtual String album() const; virtual String comment() const; virtual String genre() const; - virtual uint year() const; - virtual uint track() const; + virtual unsigned int year() const; + virtual unsigned int track() const; virtual void setTitle(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); + virtual void setYear(unsigned int i); + virtual void setTrack(unsigned int i); virtual bool isEmpty() const; template <class T> T *access(int index, bool create) diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index e9116e6d..4534f186 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -60,15 +60,15 @@ namespace TagLib { class String; + // These integer types are deprecated. Do not use them. + typedef wchar_t wchar; // Assumed to be sufficient to store a UTF-16 char. typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; + typedef unsigned long ulong; typedef unsigned long long ulonglong; - // long/ulong can be either 32-bit or 64-bit wide. - typedef unsigned long ulong; - /*! * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3) * so I'm providing something here that should be constant. diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 6aff6423..1fba30a2 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -53,7 +53,7 @@ namespace TagLib { static const char hexTable[17] = "0123456789abcdef"; -static const uint crcTable[256] = { +static const unsigned int crcTable[256] = { 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, @@ -102,7 +102,7 @@ static const uint crcTable[256] = { template <class TIterator> int findChar( const TIterator dataBegin, const TIterator dataEnd, - char c, uint offset, int byteAlign) + char c, unsigned int offset, int byteAlign) { const size_t dataSize = dataEnd - dataBegin; if(offset + 1 > dataSize) @@ -125,7 +125,7 @@ template <class TIterator> int findVector( const TIterator dataBegin, const TIterator dataEnd, const TIterator patternBegin, const TIterator patternEnd, - uint offset, int byteAlign) + unsigned int offset, int byteAlign) { const size_t dataSize = dataEnd - dataBegin; const size_t patternSize = patternEnd - patternBegin; @@ -308,19 +308,19 @@ long double toFloat80(const ByteVector &v, size_t offset) class ByteVector::ByteVectorPrivate { public: - ByteVectorPrivate(uint l, char c) : + ByteVectorPrivate(unsigned int l, char c) : counter(new RefCounter()), data(new std::vector<char>(l, c)), offset(0), length(l) {} - ByteVectorPrivate(const char *s, uint l) : + ByteVectorPrivate(const char *s, unsigned int l) : counter(new RefCounter()), data(new std::vector<char>(s, s + l)), offset(0), length(l) {} - ByteVectorPrivate(const ByteVectorPrivate &d, uint o, uint l) : + ByteVectorPrivate(const ByteVectorPrivate &d, unsigned int o, unsigned int l) : counter(d.counter), data(d.data), offset(d.offset + o), @@ -339,8 +339,8 @@ public: RefCounter *counter; std::vector<char> *data; - uint offset; - uint length; + unsigned int offset; + unsigned int length; }; //////////////////////////////////////////////////////////////////////////////// @@ -349,7 +349,7 @@ public: ByteVector ByteVector::null; -ByteVector ByteVector::fromCString(const char *s, uint length) +ByteVector ByteVector::fromCString(const char *s, unsigned int length) { if(length == 0xffffffff) return ByteVector(s, ::strlen(s)); @@ -357,9 +357,9 @@ ByteVector ByteVector::fromCString(const char *s, uint length) return ByteVector(s, length); } -ByteVector ByteVector::fromUInt(uint value, bool mostSignificantByteFirst) +ByteVector ByteVector::fromUInt(unsigned int value, bool mostSignificantByteFirst) { - return fromNumber<uint>(value, mostSignificantByteFirst); + return fromNumber<unsigned int>(value, mostSignificantByteFirst); } ByteVector ByteVector::fromShort(short value, bool mostSignificantByteFirst) @@ -374,12 +374,12 @@ ByteVector ByteVector::fromLongLong(long long value, bool mostSignificantByteFir ByteVector ByteVector::fromFloat32LE(float value) { - return fromFloat<float, uint, Utils::LittleEndian>(value); + return fromFloat<float, unsigned int, Utils::LittleEndian>(value); } ByteVector ByteVector::fromFloat32BE(float value) { - return fromFloat<float, uint, Utils::BigEndian>(value); + return fromFloat<float, unsigned int, Utils::BigEndian>(value); } ByteVector ByteVector::fromFloat64LE(double value) @@ -401,7 +401,7 @@ ByteVector::ByteVector() : { } -ByteVector::ByteVector(uint size, char value) : +ByteVector::ByteVector(unsigned int size, char value) : d(new ByteVectorPrivate(size, value)) { } @@ -411,7 +411,7 @@ ByteVector::ByteVector(const ByteVector &v) : { } -ByteVector::ByteVector(const ByteVector &v, uint offset, uint length) : +ByteVector::ByteVector(const ByteVector &v, unsigned int offset, unsigned int length) : d(new ByteVectorPrivate(*v.d, offset, length)) { } @@ -421,7 +421,7 @@ ByteVector::ByteVector(char c) : { } -ByteVector::ByteVector(const char *data, uint length) : +ByteVector::ByteVector(const char *data, unsigned int length) : d(new ByteVectorPrivate(data, length)) { } @@ -436,7 +436,7 @@ ByteVector::~ByteVector() delete d; } -ByteVector &ByteVector::setData(const char *s, uint length) +ByteVector &ByteVector::setData(const char *s, unsigned int length) { ByteVector(s, length).swap(*this); return *this; @@ -459,7 +459,7 @@ const char *ByteVector::data() const return (size() > 0) ? (&(*d->data)[d->offset]) : 0; } -ByteVector ByteVector::mid(uint index, uint length) const +ByteVector ByteVector::mid(unsigned int index, unsigned int length) const { index = std::min(index, size()); length = std::min(length, size() - index); @@ -467,23 +467,23 @@ ByteVector ByteVector::mid(uint index, uint length) const return ByteVector(*this, index, length); } -char ByteVector::at(uint index) const +char ByteVector::at(unsigned int index) const { return (index < size()) ? (*d->data)[d->offset + index] : 0; } -int ByteVector::find(const ByteVector &pattern, uint offset, int byteAlign) const +int ByteVector::find(const ByteVector &pattern, unsigned int offset, int byteAlign) const { return findVector<ConstIterator>( begin(), end(), pattern.begin(), pattern.end(), offset, byteAlign); } -int ByteVector::find(char c, uint offset, int byteAlign) const +int ByteVector::find(char c, unsigned int offset, int byteAlign) const { return findChar<ConstIterator>(begin(), end(), c, offset, byteAlign); } -int ByteVector::rfind(const ByteVector &pattern, uint offset, int byteAlign) const +int ByteVector::rfind(const ByteVector &pattern, unsigned int offset, int byteAlign) const { if(offset > 0) { offset = size() - offset - pattern.size(); @@ -500,13 +500,13 @@ int ByteVector::rfind(const ByteVector &pattern, uint offset, int byteAlign) con return size() - pos - pattern.size(); } -bool ByteVector::containsAt(const ByteVector &pattern, uint offset, uint patternOffset, uint patternLength) const +bool ByteVector::containsAt(const ByteVector &pattern, unsigned int offset, unsigned int patternOffset, unsigned int patternLength) const { if(pattern.size() < patternLength) patternLength = pattern.size(); // do some sanity checking -- all of these things are needed for the search to be valid - const uint compareLength = patternLength - patternOffset; + const unsigned int compareLength = patternLength - patternOffset; if(offset + compareLength > size() || patternOffset >= pattern.size() || patternLength == 0) return false; @@ -576,7 +576,7 @@ int ByteVector::endsWithPartialMatch(const ByteVector &pattern) const // try to match the last n-1 bytes from the vector (where n is the pattern // size) -- continue trying to match n-2, n-3...1 bytes - for(uint i = 1; i < pattern.size(); i++) { + for(unsigned int i = 1; i < pattern.size(); i++) { if(containsAt(pattern, startIndex + i, 0, pattern.size() - i)) return startIndex + i; } @@ -588,7 +588,7 @@ ByteVector &ByteVector::append(const ByteVector &v) { if(v.d->length != 0) { detach(); - uint originalSize = size(); + unsigned int originalSize = size(); resize(originalSize + v.size()); ::memcpy(data() + originalSize, v.data(), v.size()); } @@ -608,12 +608,12 @@ ByteVector &ByteVector::clear() return *this; } -TagLib::uint ByteVector::size() const +unsigned int ByteVector::size() const { return d->length; } -ByteVector &ByteVector::resize(uint size, char padding) +ByteVector &ByteVector::resize(unsigned int size, char padding) { if(size != d->length) { detach(); @@ -691,27 +691,27 @@ bool ByteVector::isEmpty() const return (d->length == 0); } -TagLib::uint ByteVector::checksum() const +unsigned int ByteVector::checksum() const { - uint sum = 0; + unsigned int sum = 0; for(ByteVector::ConstIterator it = begin(); it != end(); ++it) sum = (sum << 8) ^ crcTable[((sum >> 24) & 0xff) ^ static_cast<unsigned char>(*it)]; return sum; } -TagLib::uint ByteVector::toUInt(bool mostSignificantByteFirst) const +unsigned int ByteVector::toUInt(bool mostSignificantByteFirst) const { - return toNumber<uint>(*this, 0, mostSignificantByteFirst); + return toNumber<unsigned int>(*this, 0, mostSignificantByteFirst); } -TagLib::uint ByteVector::toUInt(uint offset, bool mostSignificantByteFirst) const +unsigned int ByteVector::toUInt(unsigned int offset, bool mostSignificantByteFirst) const { - return toNumber<uint>(*this, offset, mostSignificantByteFirst); + return toNumber<unsigned int>(*this, offset, mostSignificantByteFirst); } -TagLib::uint ByteVector::toUInt(uint offset, uint length, bool mostSignificantByteFirst) const +unsigned int ByteVector::toUInt(unsigned int offset, unsigned int length, bool mostSignificantByteFirst) const { - return toNumber<uint>(*this, offset, length, mostSignificantByteFirst); + return toNumber<unsigned int>(*this, offset, length, mostSignificantByteFirst); } short ByteVector::toShort(bool mostSignificantByteFirst) const @@ -719,7 +719,7 @@ short ByteVector::toShort(bool mostSignificantByteFirst) const return toNumber<unsigned short>(*this, 0, mostSignificantByteFirst); } -short ByteVector::toShort(uint offset, bool mostSignificantByteFirst) const +short ByteVector::toShort(unsigned int offset, bool mostSignificantByteFirst) const { return toNumber<unsigned short>(*this, offset, mostSignificantByteFirst); } @@ -729,7 +729,7 @@ unsigned short ByteVector::toUShort(bool mostSignificantByteFirst) const return toNumber<unsigned short>(*this, 0, mostSignificantByteFirst); } -unsigned short ByteVector::toUShort(uint offset, bool mostSignificantByteFirst) const +unsigned short ByteVector::toUShort(unsigned int offset, bool mostSignificantByteFirst) const { return toNumber<unsigned short>(*this, offset, mostSignificantByteFirst); } @@ -739,19 +739,19 @@ long long ByteVector::toLongLong(bool mostSignificantByteFirst) const return toNumber<unsigned long long>(*this, 0, mostSignificantByteFirst); } -long long ByteVector::toLongLong(uint offset, bool mostSignificantByteFirst) const +long long ByteVector::toLongLong(unsigned int offset, bool mostSignificantByteFirst) const { return toNumber<unsigned long long>(*this, offset, mostSignificantByteFirst); } float ByteVector::toFloat32LE(size_t offset) const { - return toFloat<float, uint, Utils::LittleEndian>(*this, offset); + return toFloat<float, unsigned int, Utils::LittleEndian>(*this, offset); } float ByteVector::toFloat32BE(size_t offset) const { - return toFloat<float, uint, Utils::BigEndian>(*this, offset); + return toFloat<float, unsigned int, Utils::BigEndian>(*this, offset); } double ByteVector::toFloat64LE(size_t offset) const @@ -862,7 +862,7 @@ ByteVector ByteVector::toHex() const ByteVector encoded(size() * 2); char *p = encoded.data(); - for(uint i = 0; i < size(); i++) { + for(unsigned int i = 0; i < size(); i++) { unsigned char c = data()[i]; *p++ = hexTable[(c >> 4) & 0x0F]; *p++ = hexTable[(c ) & 0x0F]; @@ -892,7 +892,7 @@ ByteVector ByteVector::fromBase64(const ByteVector & input) 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 }; - uint len = input.size(); + unsigned int len = input.size(); ByteVector output(len); @@ -957,7 +957,7 @@ ByteVector ByteVector::toBase64() const { static const char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; if (size()) { - uint len = size(); + unsigned int len = size(); ByteVector output(4 * ((len - 1) / 3 + 1)); // note roundup const char * src = data(); @@ -1009,7 +1009,7 @@ void ByteVector::detach() std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v) { - for(TagLib::uint i = 0; i < v.size(); i++) + for(unsigned int i = 0; i < v.size(); i++) s << v[i]; return s; } diff --git a/taglib/toolkit/tbytevector.h b/taglib/toolkit/tbytevector.h index b2847c9f..e897307e 100644 --- a/taglib/toolkit/tbytevector.h +++ b/taglib/toolkit/tbytevector.h @@ -61,7 +61,7 @@ namespace TagLib { * Construct a vector of size \a size with all values set to \a value by * default. */ - ByteVector(uint size, char value = 0); + ByteVector(unsigned int size, char value = 0); /*! * Constructs a byte vector that is a copy of \a v. @@ -71,7 +71,7 @@ namespace TagLib { /*! * Constructs a byte vector that is a copy of \a v. */ - ByteVector(const ByteVector &v, uint offset, uint length); + ByteVector(const ByteVector &v, unsigned int offset, unsigned int length); /*! * Constructs a byte vector that contains \a c. @@ -81,7 +81,7 @@ namespace TagLib { /*! * Constructs a byte vector that copies \a data for up to \a length bytes. */ - ByteVector(const char *data, uint length); + ByteVector(const char *data, unsigned int length); /*! * Constructs a byte vector that copies \a data up to the first null @@ -100,7 +100,7 @@ namespace TagLib { /*! * Sets the data for the byte array using the first \a length bytes of \a data */ - ByteVector &setData(const char *data, uint length); + ByteVector &setData(const char *data, unsigned int length); /*! * Sets the data for the byte array copies \a data up to the first null @@ -127,13 +127,13 @@ namespace TagLib { * for \a length bytes. If \a length is not specified it will return the bytes * from \a index to the end of the vector. */ - ByteVector mid(uint index, uint length = 0xffffffff) const; + ByteVector mid(unsigned int index, unsigned int length = 0xffffffff) const; /*! * This essentially performs the same as operator[](), but instead of causing * a runtime error if the index is out of bounds, it will return a null byte. */ - char at(uint index) const; + char at(unsigned int index) const; /*! * Searches the ByteVector for \a pattern starting at \a offset and returns @@ -141,7 +141,7 @@ namespace TagLib { * specified the pattern will only be matched if it starts on a byte divisible * by \a byteAlign (starting from \a offset). */ - int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + int find(const ByteVector &pattern, unsigned int offset = 0, int byteAlign = 1) const; /*! * Searches the char for \a c starting at \a offset and returns @@ -149,7 +149,7 @@ namespace TagLib { * specified the pattern will only be matched if it starts on a byte divisible * by \a byteAlign (starting from \a offset). */ - int find(char c, uint offset = 0, int byteAlign = 1) const; + int find(char c, unsigned int offset = 0, int byteAlign = 1) const; /*! * Searches the ByteVector for \a pattern starting from either the end of the @@ -157,7 +157,7 @@ namespace TagLib { * not found. If \a byteAlign is specified the pattern will only be matched * if it starts on a byte divisible by \a byteAlign (starting from \a offset). */ - int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + int rfind(const ByteVector &pattern, unsigned int offset = 0, int byteAlign = 1) const; /*! * Checks to see if the vector contains the \a pattern starting at position @@ -166,7 +166,8 @@ namespace TagLib { * specify to only check for the first \a patternLength bytes of \a pattern with * the \a patternLength argument. */ - bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const; + bool containsAt(const ByteVector &pattern, unsigned int offset, + unsigned int patternOffset = 0, unsigned int patternLength = 0xffffffff) const; /*! * Returns true if the vector starts with \a pattern. @@ -214,14 +215,14 @@ namespace TagLib { /*! * Returns the size of the array. */ - uint size() const; + unsigned int size() const; /*! * Resize the vector to \a size. If the vector is currently less than * \a size, pad the remaining spaces with \a padding. Returns a reference * to the resized vector. */ - ByteVector &resize(uint size, char padding = 0); + ByteVector &resize(unsigned int size, char padding = 0); /*! * Returns an Iterator that points to the front of the vector. @@ -290,7 +291,7 @@ namespace TagLib { * \note This uses an uncommon variant of CRC32 specializes in Ogg. */ // BIC: Remove or make generic. - uint checksum() const; + unsigned int checksum() const; /*! * Converts the first 4 bytes of the vector to an unsigned integer. @@ -302,7 +303,7 @@ namespace TagLib { * * \see fromUInt() */ - uint toUInt(bool mostSignificantByteFirst = true) const; + unsigned int toUInt(bool mostSignificantByteFirst = true) const; /*! * Converts the 4 bytes at \a offset of the vector to an unsigned integer. @@ -314,7 +315,7 @@ namespace TagLib { * * \see fromUInt() */ - uint toUInt(uint offset, bool mostSignificantByteFirst = true) const; + unsigned int toUInt(unsigned int offset, bool mostSignificantByteFirst = true) const; /*! * Converts the \a length bytes at \a offset of the vector to an unsigned @@ -327,7 +328,8 @@ namespace TagLib { * * \see fromUInt() */ - uint toUInt(uint offset, uint length, bool mostSignificantByteFirst = true) const; + unsigned int toUInt(unsigned int offset, unsigned int length, + bool mostSignificantByteFirst = true) const; /*! * Converts the first 2 bytes of the vector to a (signed) short. @@ -349,7 +351,7 @@ namespace TagLib { * * \see fromShort() */ - short toShort(uint offset, bool mostSignificantByteFirst = true) const; + short toShort(unsigned int offset, bool mostSignificantByteFirst = true) const; /*! * Converts the first 2 bytes of the vector to a unsigned short. @@ -371,7 +373,7 @@ namespace TagLib { * * \see fromShort() */ - unsigned short toUShort(uint offset, bool mostSignificantByteFirst = true) const; + unsigned short toUShort(unsigned int offset, bool mostSignificantByteFirst = true) const; /*! * Converts the first 8 bytes of the vector to a (signed) long long. @@ -395,7 +397,7 @@ namespace TagLib { * * \see fromUInt() */ - long long toLongLong(uint offset, bool mostSignificantByteFirst = true) const; + long long toLongLong(unsigned int offset, bool mostSignificantByteFirst = true) const; /* * Converts the 4 bytes at \a offset of the vector to a float as an IEEE754 @@ -446,7 +448,7 @@ namespace TagLib { * * \see toUInt() */ - static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true); + static ByteVector fromUInt(unsigned int value, bool mostSignificantByteFirst = true); /*! * Creates a 2 byte ByteVector based on \a value. If @@ -504,7 +506,7 @@ namespace TagLib { /*! * Returns a ByteVector based on the CString \a s. */ - static ByteVector fromCString(const char *s, uint length = 0xffffffff); + static ByteVector fromCString(const char *s, unsigned int length = 0xffffffff); /*! * Returns a const reference to the byte at \a index. @@ -600,7 +602,7 @@ namespace TagLib { ByteVector toBase64() const; /*! - * Decodes the base64 encoded byte vector. + * Decodes the base64 encoded byte vector. */ static ByteVector fromBase64(const ByteVector &); diff --git a/taglib/toolkit/tbytevectorlist.cpp b/taglib/toolkit/tbytevectorlist.cpp index 40e088d8..c4fdf593 100644 --- a/taglib/toolkit/tbytevectorlist.cpp +++ b/taglib/toolkit/tbytevectorlist.cpp @@ -47,7 +47,7 @@ ByteVectorList ByteVectorList::split(const ByteVector &v, const ByteVector &patt { ByteVectorList l; - uint previousOffset = 0; + unsigned int previousOffset = 0; for(int offset = v.find(pattern, 0, byteAlign); offset != -1 && (max == 0 || max > int(l.size()) + 1); offset = v.find(pattern, offset + pattern.size(), byteAlign)) diff --git a/taglib/toolkit/tbytevectorstream.cpp b/taglib/toolkit/tbytevectorstream.cpp index 90bee8e3..5e200b3d 100644 --- a/taglib/toolkit/tbytevectorstream.cpp +++ b/taglib/toolkit/tbytevectorstream.cpp @@ -80,7 +80,7 @@ ByteVector ByteVectorStream::readBlock(unsigned long length) void ByteVectorStream::writeBlock(const ByteVector &data) { - uint size = data.size(); + unsigned int size = data.size(); if(long(d->position + size) > length()) { truncate(d->position + size); } diff --git a/taglib/toolkit/tfile.cpp b/taglib/toolkit/tfile.cpp index 4e53f505..c634baa8 100644 --- a/taglib/toolkit/tfile.cpp +++ b/taglib/toolkit/tfile.cpp @@ -488,7 +488,7 @@ bool File::isWritable(const char *file) // protected members //////////////////////////////////////////////////////////////////////////////// -TagLib::uint File::bufferSize() +unsigned int File::bufferSize() { return 1024; } diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h index 33288936..a6dda7ba 100644 --- a/taglib/toolkit/tfile.h +++ b/taglib/toolkit/tfile.h @@ -291,7 +291,7 @@ namespace TagLib { /*! * Returns the buffer size that is used for internal buffering. */ - static uint bufferSize(); + static unsigned int bufferSize(); private: File(const File &); diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp index 200b7fec..e20412f2 100644 --- a/taglib/toolkit/tfilestream.cpp +++ b/taglib/toolkit/tfilestream.cpp @@ -186,10 +186,10 @@ ByteVector FileStream::readBlock(unsigned long length) if(length > bufferSize() && length > streamLength) length = streamLength; - ByteVector buffer(static_cast<uint>(length)); + ByteVector buffer(static_cast<unsigned int>(length)); const size_t count = readFile(d->file, buffer); - buffer.resize(static_cast<uint>(count)); + buffer.resize(static_cast<unsigned int>(count)); return buffer; } @@ -254,7 +254,7 @@ void FileStream::insert(const ByteVector &data, unsigned long start, unsigned lo long writePosition = start; ByteVector buffer = data; - ByteVector aboutToOverwrite(static_cast<uint>(bufferLength)); + ByteVector aboutToOverwrite(static_cast<unsigned int>(bufferLength)); while(true) { @@ -303,7 +303,7 @@ void FileStream::removeBlock(unsigned long start, unsigned long length) long readPosition = start + length; long writePosition = start; - ByteVector buffer(static_cast<uint>(bufferLength)); + ByteVector buffer(static_cast<unsigned int>(bufferLength)); for(size_t bytesRead = -1; bytesRead != 0;) { @@ -490,7 +490,7 @@ void FileStream::truncate(long length) #endif } -TagLib::uint FileStream::bufferSize() +unsigned int FileStream::bufferSize() { return 1024; } diff --git a/taglib/toolkit/tfilestream.h b/taglib/toolkit/tfilestream.h index a871032d..96a476d6 100644 --- a/taglib/toolkit/tfilestream.h +++ b/taglib/toolkit/tfilestream.h @@ -142,7 +142,7 @@ namespace TagLib { /*! * Returns the buffer size that is used for internal buffering. */ - static uint bufferSize(); + static unsigned int bufferSize(); private: class FileStreamPrivate; diff --git a/taglib/toolkit/tlist.h b/taglib/toolkit/tlist.h index 7375d752..6b4aa0a5 100644 --- a/taglib/toolkit/tlist.h +++ b/taglib/toolkit/tlist.h @@ -149,7 +149,7 @@ namespace TagLib { * * \see isEmpty() */ - uint size() const; + unsigned int size() const; /*! * Returns whether or not the list is empty. @@ -213,14 +213,14 @@ namespace TagLib { * * \warning This method is slow. Use iterators to loop through the list. */ - T &operator[](uint i); + T &operator[](unsigned int i); /*! * Returns a const reference to item \a i in the list. * * \warning This method is slow. Use iterators to loop through the list. */ - const T &operator[](uint i) const; + const T &operator[](unsigned int i) const; /*! * Make a shallow, implicitly shared, copy of \a l. Because this is diff --git a/taglib/toolkit/tlist.tcc b/taglib/toolkit/tlist.tcc index 5f8414ca..bf8b0007 100644 --- a/taglib/toolkit/tlist.tcc +++ b/taglib/toolkit/tlist.tcc @@ -194,7 +194,7 @@ List<T> &List<T>::clear() } template <class T> -TagLib::uint List<T>::size() const +unsigned int List<T>::size() const { return d->list.size(); } @@ -263,7 +263,7 @@ T &List<T>::back() } template <class T> -T &List<T>::operator[](uint i) +T &List<T>::operator[](unsigned int i) { Iterator it = d->list.begin(); std::advance(it, i); @@ -272,7 +272,7 @@ T &List<T>::operator[](uint i) } template <class T> -const T &List<T>::operator[](uint i) const +const T &List<T>::operator[](unsigned int i) const { ConstIterator it = d->list.begin(); std::advance(it, i); diff --git a/taglib/toolkit/tmap.h b/taglib/toolkit/tmap.h index a7d99303..c24c7636 100644 --- a/taglib/toolkit/tmap.h +++ b/taglib/toolkit/tmap.h @@ -119,7 +119,7 @@ namespace TagLib { * * \see isEmpty() */ - uint size() const; + unsigned int size() const; /*! * Returns true if the map is empty. diff --git a/taglib/toolkit/tmap.tcc b/taglib/toolkit/tmap.tcc index 8c1106df..68f0d311 100644 --- a/taglib/toolkit/tmap.tcc +++ b/taglib/toolkit/tmap.tcc @@ -150,7 +150,7 @@ Map<Key, T> &Map<Key,T>::erase(const Key &key) } template <class Key, class T> -TagLib::uint Map<Key, T>::size() const +unsigned int Map<Key, T>::size() const { return d->map.size(); } diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp index 6ad80528..8a596e4c 100644 --- a/taglib/toolkit/tstring.cpp +++ b/taglib/toolkit/tstring.cpp @@ -234,7 +234,7 @@ public: StringPrivate() : RefCounter() {} - StringPrivate(uint n, wchar_t c) : + StringPrivate(unsigned int n, wchar_t c) : RefCounter(), data(static_cast<size_t>(n), c) {} @@ -448,7 +448,7 @@ bool String::startsWith(const String &s) const return substr(0, s.length()) == s; } -String String::substr(uint position, uint n) const +String String::substr(unsigned int position, unsigned int n) const { return String(d->data.substr(position, n)); } @@ -482,12 +482,12 @@ String String::upper() const return s; } -TagLib::uint String::size() const +unsigned int String::size() const { return d->data.size(); } -TagLib::uint String::length() const +unsigned int String::length() const { return size(); } diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h index 839b2f23..97e9ff66 100644 --- a/taglib/toolkit/tstring.h +++ b/taglib/toolkit/tstring.h @@ -291,7 +291,7 @@ namespace TagLib { * Extract a substring from this string starting at \a position and * continuing for \a n characters. */ - String substr(uint position, uint n = 0xffffffff) const; + String substr(unsigned int position, unsigned int n = 0xffffffff) const; /*! * Append \a s to the current string and return a reference to the current @@ -314,12 +314,12 @@ namespace TagLib { /*! * Returns the size of the string. */ - uint size() const; + unsigned int size() const; /*! * Returns the length of the string. Equivalent to size(). */ - uint length() const; + unsigned int length() const; /*! * Returns true if the string is empty. diff --git a/taglib/toolkit/tutils.h b/taglib/toolkit/tutils.h index 4e2c13ce..5b5bfd6e 100644 --- a/taglib/toolkit/tutils.h +++ b/taglib/toolkit/tutils.h @@ -95,7 +95,7 @@ namespace TagLib /*! * Reverses the order of bytes in an 32-bit integer. */ - inline uint byteSwap(uint x) + inline unsigned int byteSwap(unsigned int x) { #if defined(HAVE_BOOST_BYTESWAP) diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp index 0ff3fa5e..7910c485 100644 --- a/taglib/trueaudio/trueaudiofile.cpp +++ b/taglib/trueaudio/trueaudiofile.cpp @@ -66,7 +66,7 @@ public: const ID3v2::FrameFactory *ID3v2FrameFactory; long ID3v2Location; - uint ID3v2OriginalSize; + unsigned int ID3v2OriginalSize; long ID3v1Location; diff --git a/taglib/trueaudio/trueaudioproperties.cpp b/taglib/trueaudio/trueaudioproperties.cpp index 17e3a2ab..0aab2419 100644 --- a/taglib/trueaudio/trueaudioproperties.cpp +++ b/taglib/trueaudio/trueaudioproperties.cpp @@ -54,7 +54,7 @@ public: int sampleRate; int channels; int bitsPerSample; - uint sampleFrames; + unsigned int sampleFrames; }; //////////////////////////////////////////////////////////////////////////////// @@ -108,7 +108,7 @@ int TrueAudio::Properties::channels() const return d->channels; } -TagLib::uint TrueAudio::Properties::sampleFrames() const +unsigned int TrueAudio::Properties::sampleFrames() const { return d->sampleFrames; } @@ -134,7 +134,7 @@ void TrueAudio::Properties::read(const ByteVector &data, long streamLength) return; } - uint pos = 3; + unsigned int pos = 3; d->version = data[pos] - '0'; pos += 1; diff --git a/taglib/trueaudio/trueaudioproperties.h b/taglib/trueaudio/trueaudioproperties.h index 4d8cd451..8dfcf375 100644 --- a/taglib/trueaudio/trueaudioproperties.h +++ b/taglib/trueaudio/trueaudioproperties.h @@ -38,7 +38,7 @@ namespace TagLib { class File; - static const uint HeaderSize = 18; + static const unsigned int HeaderSize = 18; //! An implementation of audio property reading for TrueAudio @@ -111,7 +111,7 @@ namespace TagLib { /*! * Returns the total number of sample frames */ - uint sampleFrames() const; + unsigned int sampleFrames() const; /*! * Returns the major version number. diff --git a/taglib/wavpack/wavpackfile.cpp b/taglib/wavpack/wavpackfile.cpp index f7c97f7e..e7b7049e 100644 --- a/taglib/wavpack/wavpackfile.cpp +++ b/taglib/wavpack/wavpackfile.cpp @@ -64,7 +64,7 @@ public: } long APELocation; - uint APESize; + unsigned int APESize; long ID3v1Location; diff --git a/taglib/wavpack/wavpackproperties.cpp b/taglib/wavpack/wavpackproperties.cpp index 12d47c44..c1d04fd2 100644 --- a/taglib/wavpack/wavpackproperties.cpp +++ b/taglib/wavpack/wavpackproperties.cpp @@ -58,7 +58,7 @@ public: int version; int bitsPerSample; bool lossless; - uint sampleFrames; + unsigned int sampleFrames; }; //////////////////////////////////////////////////////////////////////////////// @@ -129,7 +129,7 @@ bool WavPack::Properties::isLossless() const return d->lossless; } -TagLib::uint WavPack::Properties::sampleFrames() const +unsigned int WavPack::Properties::sampleFrames() const { return d->sampleFrames; } @@ -178,7 +178,7 @@ void WavPack::Properties::read(File *file, long streamLength) break; } - const uint flags = data.toUInt(24, false); + const unsigned int flags = data.toUInt(24, false); if(offset == 0) { d->version = data.toShort(8, false); @@ -196,7 +196,7 @@ void WavPack::Properties::read(File *file, long streamLength) if(flags & FINAL_BLOCK) break; - const uint blockSize = data.toUInt(4, false); + const unsigned int blockSize = data.toUInt(4, false); offset += blockSize + 8; } @@ -210,7 +210,7 @@ void WavPack::Properties::read(File *file, long streamLength) } } -TagLib::uint WavPack::Properties::seekFinalIndex(File *file, long streamLength) +unsigned int WavPack::Properties::seekFinalIndex(File *file, long streamLength) { const long offset = file->rfind("wvpk", streamLength); if(offset == -1) @@ -225,12 +225,12 @@ TagLib::uint WavPack::Properties::seekFinalIndex(File *file, long streamLength) if(version < MIN_STREAM_VERS || version > MAX_STREAM_VERS) return 0; - const uint flags = data.toUInt(24, false); + const unsigned int flags = data.toUInt(24, false); if(!(flags & FINAL_BLOCK)) return 0; - const uint blockIndex = data.toUInt(16, false); - const uint blockSamples = data.toUInt(20, false); + const unsigned int blockIndex = data.toUInt(16, false); + const unsigned int blockSamples = data.toUInt(20, false); return blockIndex + blockSamples; } diff --git a/taglib/wavpack/wavpackproperties.h b/taglib/wavpack/wavpackproperties.h index 2955b1d8..0f5d1dcb 100644 --- a/taglib/wavpack/wavpackproperties.h +++ b/taglib/wavpack/wavpackproperties.h @@ -39,7 +39,7 @@ namespace TagLib { class File; - static const uint HeaderSize = 32; + static const unsigned int HeaderSize = 32; //! An implementation of audio property reading for WavPack @@ -126,7 +126,7 @@ namespace TagLib { /*! * Returns the total number of audio samples in file. */ - uint sampleFrames() const; + unsigned int sampleFrames() const; /*! * Returns WavPack version. @@ -138,7 +138,7 @@ namespace TagLib { Properties &operator=(const Properties &); void read(File *file, long streamLength); - uint seekFinalIndex(File *file, long streamLength); + unsigned int seekFinalIndex(File *file, long streamLength); class PropertiesPrivate; PropertiesPrivate *d; diff --git a/taglib/xm/xmfile.cpp b/taglib/xm/xmfile.cpp index 7def0c09..0a3b950e 100644 --- a/taglib/xm/xmfile.cpp +++ b/taglib/xm/xmfile.cpp @@ -30,7 +30,6 @@ using namespace TagLib; using namespace XM; -using TagLib::uint; /*! * The Reader classes are helpers to make handling of the stripped XM @@ -72,35 +71,35 @@ public: * Reads associated values from \a file, but never reads more * then \a limit bytes. */ - virtual uint read(TagLib::File &file, uint limit) = 0; + virtual unsigned int read(TagLib::File &file, unsigned int limit) = 0; /*! * Returns the number of bytes this reader would like to read. */ - virtual uint size() const = 0; + virtual unsigned int size() const = 0; }; class SkipReader : public Reader { public: - SkipReader(uint size) : m_size(size) + SkipReader(unsigned int size) : m_size(size) { } - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { - uint count = std::min(m_size, limit); + unsigned int count = std::min(m_size, limit); file.seek(count, TagLib::File::Current); return count; } - uint size() const + unsigned int size() const { return m_size; } private: - uint m_size; + unsigned int m_size; }; template<typename T> @@ -118,15 +117,15 @@ protected: class StringReader : public ValueReader<String> { public: - StringReader(String &string, uint size) : + StringReader(String &string, unsigned int size) : ValueReader<String>(string), m_size(size) { } - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { ByteVector data = file.readBlock(std::min(m_size, limit)); - uint count = data.size(); + unsigned int count = data.size(); int index = data.find((char) 0); if(index > -1) { data.resize(index); @@ -136,13 +135,13 @@ public: return count; } - uint size() const + unsigned int size() const { return m_size; } private: - uint m_size; + unsigned int m_size; }; class ByteReader : public ValueReader<unsigned char> @@ -150,7 +149,7 @@ class ByteReader : public ValueReader<unsigned char> public: ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {} - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { ByteVector data = file.readBlock(std::min(1U,limit)); if(data.size() > 0) { @@ -159,7 +158,7 @@ public: return data.size(); } - uint size() const + unsigned int size() const { return 1; } @@ -184,14 +183,14 @@ public: U16Reader(unsigned short &value, bool bigEndian) : NumberReader<unsigned short>(value, bigEndian) {} - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { ByteVector data = file.readBlock(std::min(2U,limit)); value = data.toUShort(bigEndian); return data.size(); } - uint size() const + unsigned int size() const { return 2; } @@ -205,14 +204,14 @@ public: { } - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { ByteVector data = file.readBlock(std::min(4U,limit)); value = data.toUInt(bigEndian); return data.size(); } - uint size() const + unsigned int size() const { return 4; } @@ -238,7 +237,7 @@ public: /*! * Don't read anything but skip \a size bytes. */ - StructReader &skip(uint size) + StructReader &skip(unsigned int size) { m_readers.append(new SkipReader(size)); return *this; @@ -247,7 +246,7 @@ public: /*! * Read a string of \a size characters (bytes) into \a string. */ - StructReader &string(String &string, uint size) + StructReader &string(String &string, unsigned int size) { m_readers.append(new StringReader(string, size)); return *this; @@ -314,9 +313,9 @@ public: return u32(number, true); } - uint size() const + unsigned int size() const { - uint size = 0; + unsigned int size = 0; for(List<Reader*>::ConstIterator i = m_readers.begin(); i != m_readers.end(); ++ i) { size += (*i)->size(); @@ -324,12 +323,12 @@ public: return size; } - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { - uint sumcount = 0; + unsigned int sumcount = 0; for(List<Reader*>::ConstIterator i = m_readers.begin(); limit > 0 && i != m_readers.end(); ++ i) { - uint count = (*i)->read(file, limit); + unsigned int count = (*i)->read(file, limit); limit -= count; sumcount += count; } @@ -437,7 +436,7 @@ bool XM::File::save() } const StringList lines = d->tag.comment().split("\n"); - uint sampleNameIndex = instrumentCount; + unsigned int sampleNameIndex = instrumentCount; for(unsigned short i = 0; i < instrumentCount; ++ i) { seek(pos); unsigned long instrumentHeaderSize = 0; @@ -445,7 +444,7 @@ bool XM::File::save() return false; seek(pos + 4); - const uint len = std::min(22UL, instrumentHeaderSize - 4U); + const unsigned int len = std::min(22UL, instrumentHeaderSize - 4U); if(i >= lines.size()) writeString(String(), len); else @@ -476,7 +475,7 @@ bool XM::File::save() if(sampleHeaderSize > 18U) { seek(pos + 18); - const uint len = std::min(sampleHeaderSize - 18U, 22UL); + const unsigned int len = std::min(sampleHeaderSize - 18U, 22UL); if(sampleNameIndex >= lines.size()) writeString(String(), len); else @@ -530,8 +529,8 @@ void XM::File::read(bool) .u16L(tempo) .u16L(bpmSpeed); - uint count = header.read(*this, headerSize - 4U); - uint size = std::min(headerSize - 4U, (unsigned long)header.size()); + unsigned int count = header.read(*this, headerSize - 4U); + unsigned int size = std::min(headerSize - 4U, (unsigned long)header.size()); READ_ASSERT(count == size); @@ -557,7 +556,7 @@ void XM::File::read(bool) StructReader pattern; pattern.byte(packingType).u16L(rowCount).u16L(dataSize); - uint count = pattern.read(*this, patternHeaderLength - 4U); + unsigned int count = pattern.read(*this, patternHeaderLength - 4U); READ_ASSERT(count == std::min(patternHeaderLength - 4U, (unsigned long)pattern.size())); seek(patternHeaderLength - (4 + count) + dataSize, Current); @@ -565,7 +564,7 @@ void XM::File::read(bool) StringList intrumentNames; StringList sampleNames; - uint sumSampleCount = 0; + unsigned int sumSampleCount = 0; // read instruments: for(unsigned short i = 0; i < instrumentCount; ++ i) { @@ -580,7 +579,7 @@ void XM::File::read(bool) instrument.string(instrumentName, 22).byte(instrumentType).u16L(sampleCount); // 4 for instrumentHeaderSize - uint count = 4 + instrument.read(*this, instrumentHeaderSize - 4U); + unsigned int count = 4 + instrument.read(*this, instrumentHeaderSize - 4U); READ_ASSERT(count == std::min(instrumentHeaderSize, (unsigned long)instrument.size() + 4)); unsigned long sampleHeaderSize = 0; @@ -615,7 +614,7 @@ void XM::File::read(bool) .byte(compression) .string(sampleName, 22); - uint count = sample.read(*this, sampleHeaderSize); + unsigned int count = sample.read(*this, sampleHeaderSize); READ_ASSERT(count == std::min(sampleHeaderSize, (unsigned long)sample.size())); // skip unhandeled header proportion: seek(sampleHeaderSize - count, Current); diff --git a/taglib/xm/xmproperties.cpp b/taglib/xm/xmproperties.cpp index 9a7fa6b2..5002a4e5 100644 --- a/taglib/xm/xmproperties.cpp +++ b/taglib/xm/xmproperties.cpp @@ -47,7 +47,7 @@ public: unsigned short restartPosition; unsigned short patternCount; unsigned short instrumentCount; - uint sampleCount; + unsigned int sampleCount; unsigned short flags; unsigned short tempo; unsigned short bpmSpeed; @@ -119,7 +119,7 @@ unsigned short XM::Properties::instrumentCount() const return d->instrumentCount; } -TagLib::uint XM::Properties::sampleCount() const +unsigned int XM::Properties::sampleCount() const { return d->sampleCount; } @@ -169,7 +169,7 @@ void XM::Properties::setInstrumentCount(unsigned short instrumentCount) d->instrumentCount = instrumentCount; } -void XM::Properties::setSampleCount(uint sampleCount) +void XM::Properties::setSampleCount(unsigned int sampleCount) { d->sampleCount = sampleCount; } diff --git a/taglib/xm/xmproperties.h b/taglib/xm/xmproperties.h index 4fdf8b4b..db948815 100644 --- a/taglib/xm/xmproperties.h +++ b/taglib/xm/xmproperties.h @@ -51,7 +51,7 @@ namespace TagLib { unsigned short restartPosition() const; unsigned short patternCount() const; unsigned short instrumentCount() const; - uint sampleCount() const; + unsigned int sampleCount() const; unsigned short flags() const; unsigned short tempo() const; unsigned short bpmSpeed() const; @@ -63,7 +63,7 @@ namespace TagLib { void setRestartPosition(unsigned short restartPosition); void setPatternCount(unsigned short patternCount); void setInstrumentCount(unsigned short instrumentCount); - void setSampleCount(uint sampleCount); + void setSampleCount(unsigned int sampleCount); void setFlags(unsigned short flags); void setTempo(unsigned short tempo); void setBpmSpeed(unsigned short bpmSpeed); diff --git a/tests/test_apetag.cpp b/tests/test_apetag.cpp index 42475766..71d0be26 100644 --- a/tests/test_apetag.cpp +++ b/tests/test_apetag.cpp @@ -78,7 +78,7 @@ public: APE::Item item3 = APE::Item("TRACKNUMBER", "29"); tag.setItem("TRACKNUMBER", item3); properties = tag.properties(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), properties["TRACKNUMBER"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, properties["TRACKNUMBER"].size()); CPPUNIT_ASSERT_EQUAL(String("17"), properties["TRACKNUMBER"][0]); CPPUNIT_ASSERT_EQUAL(String("29"), properties["TRACKNUMBER"][1]); @@ -94,7 +94,7 @@ public: APE::Tag tag; PropertyMap unsuccessful = tag.setProperties(properties); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), unsuccessful.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, unsuccessful.size()); CPPUNIT_ASSERT(unsuccessful.contains("A")); CPPUNIT_ASSERT(unsuccessful.contains("MP+")); } diff --git a/tests/test_asf.cpp b/tests/test_asf.cpp index 2dfcb64d..0098fdc3 100644 --- a/tests/test_asf.cpp +++ b/tests/test_asf.cpp @@ -105,7 +105,7 @@ public: CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber")); CPPUNIT_ASSERT_EQUAL(ASF::Attribute::DWordType, f.tag()->attribute("WM/TrackNumber").front().type()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(123), f.tag()->track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)123, f.tag()->track()); f.tag()->setTrack(234); f.save(); } @@ -114,7 +114,7 @@ public: CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber")); CPPUNIT_ASSERT_EQUAL(ASF::Attribute::UnicodeType, f.tag()->attribute("WM/TrackNumber").front().type()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(234), f.tag()->track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)234, f.tag()->track()); } } @@ -193,7 +193,7 @@ public: { ASF::File f(newname.c_str()); ASF::AttributeList values2 = f.tag()->attribute("WM/Picture"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), values2.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, values2.size()); ASF::Attribute attr2 = values2.front(); ASF::Picture picture2 = attr2.toPicture(); CPPUNIT_ASSERT(picture2.isValid()); @@ -230,7 +230,7 @@ public: { ASF::File f(newname.c_str()); ASF::AttributeList values2 = f.tag()->attribute("WM/Picture"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), values2.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, values2.size()); ASF::Picture picture3 = values2[1].toPicture(); CPPUNIT_ASSERT(picture3.isValid()); CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), picture3.mimeType()); diff --git a/tests/test_bytevector.cpp b/tests/test_bytevector.cpp index 5d82fedb..9ff71272 100644 --- a/tests/test_bytevector.cpp +++ b/tests/test_bytevector.cpp @@ -350,24 +350,24 @@ public: ByteVector a = ByteVector("0123456789"); ByteVector b = a.mid(3, 4); b.resize(6, 'A'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), b.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)6, b.size()); CPPUNIT_ASSERT_EQUAL('6', b[3]); CPPUNIT_ASSERT_EQUAL('A', b[4]); CPPUNIT_ASSERT_EQUAL('A', b[5]); b.resize(10, 'B'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), b.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)10, b.size()); CPPUNIT_ASSERT_EQUAL('6', b[3]); CPPUNIT_ASSERT_EQUAL('B', b[6]); CPPUNIT_ASSERT_EQUAL('B', b[9]); b.resize(3, 'C'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size()); CPPUNIT_ASSERT_EQUAL(-1, b.find('C')); b.resize(3); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size()); // Check if a and b were properly detached. - CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), a.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)10, a.size()); CPPUNIT_ASSERT_EQUAL('3', a[3]); CPPUNIT_ASSERT_EQUAL('5', a[5]); @@ -375,17 +375,17 @@ public: ByteVector c = ByteVector("0123456789").mid(3, 4); c.resize(6, 'A'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), c.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)6, c.size()); CPPUNIT_ASSERT_EQUAL('6', c[3]); CPPUNIT_ASSERT_EQUAL('A', c[4]); CPPUNIT_ASSERT_EQUAL('A', c[5]); c.resize(10, 'B'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), c.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)10, c.size()); CPPUNIT_ASSERT_EQUAL('6', c[3]); CPPUNIT_ASSERT_EQUAL('B', c[6]); CPPUNIT_ASSERT_EQUAL('B', c[9]); c.resize(3, 'C'); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), c.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, c.size()); CPPUNIT_ASSERT_EQUAL(-1, c.find('C')); } @@ -439,7 +439,7 @@ public: CPPUNIT_ASSERT_EQUAL(t2, ByteVector::fromBase64(s2.toBase64())); CPPUNIT_ASSERT_EQUAL(t3, ByteVector::fromBase64(s3.toBase64())); - ByteVector all((uint)256); + ByteVector all((unsigned int)256); // in order { diff --git a/tests/test_bytevectorlist.cpp b/tests/test_bytevectorlist.cpp index 7e4a9fd7..ff5ef2fe 100644 --- a/tests/test_bytevectorlist.cpp +++ b/tests/test_bytevectorlist.cpp @@ -19,7 +19,7 @@ public: ByteVector v("a b"); ByteVectorList l = ByteVectorList::split(v, " "); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size()); CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]); CPPUNIT_ASSERT_EQUAL(ByteVector("b"), l[1]); } @@ -29,7 +29,7 @@ public: ByteVector v("a"); ByteVectorList l = ByteVectorList::split(v, " "); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), l.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, l.size()); CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]); } diff --git a/tests/test_file.cpp b/tests/test_file.cpp index a19bce89..5c4aaa0f 100644 --- a/tests/test_file.cpp +++ b/tests/test_file.cpp @@ -65,7 +65,7 @@ public: file.seek(0); const ByteVector v = file.readBlock(file.length()); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size()); CPPUNIT_ASSERT_EQUAL((long)v.find("23"), file.find("23")); CPPUNIT_ASSERT_EQUAL((long)v.find("23", 2), file.find("23", 2)); @@ -93,7 +93,7 @@ public: file.seek(0); const ByteVector v = file.readBlock(file.length()); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size()); CPPUNIT_ASSERT_EQUAL((long)v.rfind("23"), file.rfind("23")); CPPUNIT_ASSERT_EQUAL((long)v.rfind("23", 7), file.rfind("23", 7)); diff --git a/tests/test_fileref.cpp b/tests/test_fileref.cpp index 88f711a7..d7945e48 100644 --- a/tests/test_fileref.cpp +++ b/tests/test_fileref.cpp @@ -71,8 +71,8 @@ public: CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("test title")); CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("Test!")); CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("albummmm")); - CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(5)); - CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2020)); + CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)5); + CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2020); f.tag()->setArtist("ttest artist"); f.tag()->setTitle("ytest title"); f.tag()->setGenre("uTest!"); @@ -88,8 +88,8 @@ public: CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("ytest title")); CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!")); CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm")); - CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(7)); - CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2080)); + CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7); + CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080); } { FileStream fs(newname.c_str()); @@ -99,8 +99,8 @@ public: CPPUNIT_ASSERT_EQUAL(f.tag()->title(), String("ytest title")); CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!")); CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm")); - CPPUNIT_ASSERT_EQUAL(f.tag()->track(), TagLib::uint(7)); - CPPUNIT_ASSERT_EQUAL(f.tag()->year(), TagLib::uint(2080)); + CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7); + CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080); } } diff --git a/tests/test_flac.cpp b/tests/test_flac.cpp index 9fdd51e1..8ab81c86 100644 --- a/tests/test_flac.cpp +++ b/tests/test_flac.cpp @@ -63,7 +63,7 @@ public: FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); FLAC::Picture *pic = lst.front(); CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type()); @@ -73,7 +73,7 @@ public: CPPUNIT_ASSERT_EQUAL(0, pic->numColors()); CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType()); CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic->data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size()); } void testAddPicture() @@ -84,7 +84,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); FLAC::Picture *newpic = new FLAC::Picture(); newpic->setType(FLAC::Picture::BackCover); @@ -101,7 +101,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, lst.size()); FLAC::Picture *pic = lst[0]; CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type()); @@ -111,7 +111,7 @@ public: CPPUNIT_ASSERT_EQUAL(0, pic->numColors()); CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType()); CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic->data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size()); pic = lst[1]; CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type()); @@ -133,7 +133,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); FLAC::Picture *newpic = new FLAC::Picture(); newpic->setType(FLAC::Picture::BackCover); @@ -151,7 +151,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); FLAC::Picture *pic = lst[0]; CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type()); @@ -173,7 +173,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); f.removePictures(); f.save(); @@ -181,7 +181,7 @@ public: { FLAC::File f(newname.c_str()); List<FLAC::Picture *> lst = f.pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, lst.size()); } } @@ -220,7 +220,7 @@ public: { FLAC::File f(newname.c_str()); Ogg::FieldListMap m = f.xiphComment()->fieldListMap(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), m["ARTIST"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, m["ARTIST"].size()); CPPUNIT_ASSERT_EQUAL(String("artist 1"), m["ARTIST"][0]); CPPUNIT_ASSERT_EQUAL(String("artist 2"), m["ARTIST"][1]); } @@ -243,7 +243,7 @@ public: { FLAC::File f(newname.c_str()); PropertyMap dict = f.properties(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["ARTIST"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["ARTIST"].size()); CPPUNIT_ASSERT_EQUAL(String("artøst 1"), dict["ARTIST"][0]); CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]); } @@ -256,8 +256,8 @@ public: map[L"H\x00c4\x00d6"] = String("bla"); FLAC::File f(copy.fileName().c_str()); PropertyMap invalid = f.setProperties(map); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), invalid.size()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.properties().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, invalid.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.properties().size()); } void testAudioProperties() diff --git a/tests/test_flacpicture.cpp b/tests/test_flacpicture.cpp index eefa9306..c5043d2f 100644 --- a/tests/test_flacpicture.cpp +++ b/tests/test_flacpicture.cpp @@ -34,7 +34,7 @@ public: CPPUNIT_ASSERT_EQUAL(0, pic.numColors()); CPPUNIT_ASSERT_EQUAL(String("image/png"), pic.mimeType()); CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic.description()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(150), pic.data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic.data().size()); } void testPassThrough() diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp index fe188505..28fa467f 100644 --- a/tests/test_id3v2.cpp +++ b/tests/test_id3v2.cpp @@ -204,7 +204,7 @@ public: "d\x00" "\x00", 14); ID3v2::AttachedPictureFrame *frame = - static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, TagLib::uint(2))); + static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, (unsigned int)2)); CPPUNIT_ASSERT(frame); CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), frame->mimeType()); @@ -225,13 +225,13 @@ public: "d\x00" "\x00", 14); ID3v2::AttachedPictureFrame *frame = - static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, TagLib::uint(2))); + static_cast<TagLib::ID3v2::AttachedPictureFrame*>(factory->createFrame(data, (unsigned int)2)); CPPUNIT_ASSERT(frame); ID3v2::Tag tag; tag.addFrame(frame); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1034), tag.render().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1034, tag.render().size()); } // http://bugs.kde.org/show_bug.cgi?id=151078 @@ -260,7 +260,7 @@ public: "\x00\x00\x00\x03", 33)); CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email()); CPPUNIT_ASSERT_EQUAL(2, f.rating()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.counter()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, f.counter()); } void testParsePOPMWithoutCounter() @@ -272,7 +272,7 @@ public: "\x02", 29)); CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email()); CPPUNIT_ASSERT_EQUAL(2, f.rating()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.counter()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.counter()); } void testRenderPOPM() @@ -476,11 +476,11 @@ public: CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::Lyrics, f.type()); CPPUNIT_ASSERT_EQUAL(String("foo"), f.description()); ID3v2::SynchronizedLyricsFrame::SynchedTextList stl = f.synchedText(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), stl.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, stl.size()); CPPUNIT_ASSERT_EQUAL(String("Example"), stl[0].text); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1234), stl[0].time); + CPPUNIT_ASSERT_EQUAL((unsigned int)1234, stl[0].time); CPPUNIT_ASSERT_EQUAL(String("Lyrics"), stl[1].text); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4567), stl[1].time); + CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time); } void testRenderSynchronizedLyricsFrame() @@ -525,11 +525,11 @@ public: CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AbsoluteMilliseconds, f.timestampFormat()); ID3v2::EventTimingCodesFrame::SynchedEventList sel = f.synchedEvents(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), sel.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, sel.size()); CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::IntroStart, sel[0].type); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(62300), sel[0].time); + CPPUNIT_ASSERT_EQUAL((unsigned int)62300, sel[0].time); CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AudioFileEnds, sel[1].type); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3600000), sel[1].time); + CPPUNIT_ASSERT_EQUAL((unsigned int)3600000, sel[1].time); } void testRenderEventTimingCodesFrame() @@ -589,8 +589,8 @@ public: "\x00" // Encoding "(22)Death Metal", 26); // Text ID3v2::TextIdentificationFrame *frame = - static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(3))); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), frame->fieldList().size()); + static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, frame->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("Death Metal"), frame->fieldList()[0]); ID3v2::Tag tag; @@ -608,8 +608,8 @@ public: "\x00" // Encoding "(4)Eurodisco", 23); // Text ID3v2::TextIdentificationFrame *frame = - static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(3))); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), frame->fieldList().size()); + static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("4"), frame->fieldList()[0]); CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]); @@ -627,8 +627,8 @@ public: "\0" // Encoding "14\0Eurodisco", 23); // Text ID3v2::TextIdentificationFrame *frame = - static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, TagLib::uint(4))); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), frame->fieldList().size()); + static_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, (unsigned int)4)); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("14"), frame->fieldList()[0]); CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]); @@ -641,7 +641,7 @@ public: { MPEG::File f(TEST_FILE_PATH_C("id3v22-tda.mp3"), false); CPPUNIT_ASSERT(f.tag()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2010), f.tag()->year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2010, f.tag()->year()); } void testUpdateFullDate22() @@ -685,15 +685,15 @@ public: MPEG::File bar(newname.c_str()); tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDOR").front()); CPPUNIT_ASSERT(tf); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), tf->fieldList().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("2011"), tf->fieldList().front()); tf = static_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDRC").front()); CPPUNIT_ASSERT(tf); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), tf->fieldList().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("2012-04-17T12:01"), tf->fieldList().front()); tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TIPL").front()); CPPUNIT_ASSERT(tf); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), tf->fieldList().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)8, tf->fieldList().size()); CPPUNIT_ASSERT_EQUAL(String("Guitar"), tf->fieldList()[0]); CPPUNIT_ASSERT_EQUAL(String("Artist 1"), tf->fieldList()[1]); CPPUNIT_ASSERT_EQUAL(String("Drums"), tf->fieldList()[2]); @@ -726,7 +726,7 @@ public: CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType()); CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type()); CPPUNIT_ASSERT_EQUAL(String(""), frame->description()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(86414), frame->picture().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)86414, frame->picture().size()); #else @@ -756,12 +756,12 @@ public: string newname = copy.fileName(); MPEG::File f(newname.c_str()); PropertyMap dict = f.ID3v2Tag(false)->properties(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(6), dict.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)6, dict.size()); CPPUNIT_ASSERT(dict.contains("USERTEXTDESCRIPTION1")); CPPUNIT_ASSERT(dict.contains("QuodLibet::USERTEXTDESCRIPTION2")); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["USERTEXTDESCRIPTION1"].size()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["QuodLibet::USERTEXTDESCRIPTION2"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["USERTEXTDESCRIPTION1"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["QuodLibet::USERTEXTDESCRIPTION2"].size()); CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["USERTEXTDESCRIPTION1"][0]); CPPUNIT_ASSERT_EQUAL(String("userTextData2"), dict["USERTEXTDESCRIPTION1"][1]); CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["QuodLibet::USERTEXTDESCRIPTION2"][0]); @@ -912,20 +912,20 @@ public: ID3v2::ChapterFrame f1(&header, chapterData); CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f1.elementID()); - CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.startTime()); - CPPUNIT_ASSERT((TagLib::uint)0x05 == f1.endTime()); - CPPUNIT_ASSERT((TagLib::uint)0x02 == f1.startOffset()); - CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.endOffset()); - CPPUNIT_ASSERT((TagLib::uint)0x00 == f1.embeddedFrameList().size()); + CPPUNIT_ASSERT((unsigned int)0x03 == f1.startTime()); + CPPUNIT_ASSERT((unsigned int)0x05 == f1.endTime()); + CPPUNIT_ASSERT((unsigned int)0x02 == f1.startOffset()); + CPPUNIT_ASSERT((unsigned int)0x03 == f1.endOffset()); + CPPUNIT_ASSERT((unsigned int)0x00 == f1.embeddedFrameList().size()); ID3v2::ChapterFrame f2(&header, chapterData + embeddedFrameData); CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f2.elementID()); - CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.startTime()); - CPPUNIT_ASSERT((TagLib::uint)0x05 == f2.endTime()); - CPPUNIT_ASSERT((TagLib::uint)0x02 == f2.startOffset()); - CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.endOffset()); - CPPUNIT_ASSERT((TagLib::uint)0x01 == f2.embeddedFrameList().size()); + CPPUNIT_ASSERT((unsigned int)0x03 == f2.startTime()); + CPPUNIT_ASSERT((unsigned int)0x05 == f2.endTime()); + CPPUNIT_ASSERT((unsigned int)0x02 == f2.startOffset()); + CPPUNIT_ASSERT((unsigned int)0x03 == f2.endOffset()); + CPPUNIT_ASSERT((unsigned int)0x01 == f2.embeddedFrameList().size()); CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2").size() == 1); CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2")[0]->toString() == "CH1"); } @@ -1018,10 +1018,10 @@ public: CPPUNIT_ASSERT_EQUAL(ByteVector("T"), f.elementID()); CPPUNIT_ASSERT(!f.isTopLevel()); CPPUNIT_ASSERT(f.isOrdered()); - CPPUNIT_ASSERT((TagLib::uint)0x02 == f.entryCount()); + CPPUNIT_ASSERT((unsigned int)0x02 == f.entryCount()); CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f.childElements()[0]); CPPUNIT_ASSERT_EQUAL(ByteVector("D"), f.childElements()[1]); - CPPUNIT_ASSERT((TagLib::uint)0x01 == f.embeddedFrameList().size()); + CPPUNIT_ASSERT((unsigned int)0x01 == f.embeddedFrameList().size()); CPPUNIT_ASSERT(f.embeddedFrameList("TIT2").size() == 1); CPPUNIT_ASSERT(f.embeddedFrameList("TIT2")[0]->toString() == "TC1"); } @@ -1132,7 +1132,7 @@ public: // Sample rate will be 32000 if we can't skip the second tag. CPPUNIT_ASSERT(f.hasID3v2Tag()); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)8049, f.ID3v2Tag()->header()->completeTagSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)8049, f.ID3v2Tag()->header()->completeTagSize()); CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate()); @@ -1143,7 +1143,7 @@ public: MPEG::File f(copy.fileName().c_str()); CPPUNIT_ASSERT(f.hasID3v2Tag()); CPPUNIT_ASSERT_EQUAL((long)3594, f.length()); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)1505, f.ID3v2Tag()->header()->completeTagSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1505, f.ID3v2Tag()->header()->completeTagSize()); CPPUNIT_ASSERT_EQUAL(String("Artist A"), f.ID3v2Tag()->artist()); CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate()); diff --git a/tests/test_info.cpp b/tests/test_info.cpp index de1f4bbe..6b583b2c 100644 --- a/tests/test_info.cpp +++ b/tests/test_info.cpp @@ -24,7 +24,7 @@ public: tag.setFieldText("TEST", "Dummy Text"); CPPUNIT_ASSERT_EQUAL(String("Test title 1"), tag.title()); - + RIFF::Info::FieldListMap map = tag.fieldListMap(); CPPUNIT_ASSERT_EQUAL(String("Test title 1"), map["INAM"]); CPPUNIT_ASSERT_EQUAL(String("Dummy Text"), map["TEST"]); @@ -34,14 +34,14 @@ public: { RIFF::Info::Tag tag; - CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.track()); tag.setTrack(1234); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.track()); CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("IPRT")); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.year()); tag.setYear(1234); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.year()); CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD")); } }; diff --git a/tests/test_it.cpp b/tests/test_it.cpp index 24cfb1a6..0558884c 100644 --- a/tests/test_it.cpp +++ b/tests/test_it.cpp @@ -26,7 +26,6 @@ using namespace std; using namespace TagLib; -using TagLib::uint; static const String titleBefore("test song name"); static const String titleAfter("changed title"); diff --git a/tests/test_mp4.cpp b/tests/test_mp4.cpp index b47ddedf..b5a2bf98 100644 --- a/tests/test_mp4.cpp +++ b/tests/test_mp4.cpp @@ -249,11 +249,11 @@ public: MP4::File f(TEST_FILE_PATH_C("has-tags.m4a")); CPPUNIT_ASSERT(f.tag()->contains("covr")); MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size()); } void testCovrWrite() @@ -273,13 +273,13 @@ public: MP4::File f(filename.c_str()); CPPUNIT_ASSERT(f.tag()->contains("covr")); MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), l.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, l.size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[2].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), l[2].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, l[2].data().size()); } } @@ -288,11 +288,11 @@ public: MP4::File f(TEST_FILE_PATH_C("covr-junk.m4a")); CPPUNIT_ASSERT(f.tag()->contains("covr")); MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), l.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(79), l[0].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size()); CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(287), l[1].data().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size()); } void testProperties() diff --git a/tests/test_mpeg.cpp b/tests/test_mpeg.cpp index ee3575e3..a4ceced4 100644 --- a/tests/test_mpeg.cpp +++ b/tests/test_mpeg.cpp @@ -128,7 +128,7 @@ public: } { MPEG::File f2(newname.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f2.ID3v2Tag()->header()->majorVersion()); + CPPUNIT_ASSERT_EQUAL((unsigned int)4, f2.ID3v2Tag()->header()->majorVersion()); CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist()); CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title()); } @@ -148,7 +148,7 @@ public: } { MPEG::File f2(newname.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f2.ID3v2Tag()->header()->majorVersion()); + CPPUNIT_ASSERT_EQUAL((unsigned int)4, f2.ID3v2Tag()->header()->majorVersion()); CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist()); CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title()); } @@ -171,7 +171,7 @@ public: } { MPEG::File f2(newname.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f2.ID3v2Tag()->header()->majorVersion()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, f2.ID3v2Tag()->header()->majorVersion()); CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist()); CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title()); } diff --git a/tests/test_ogg.cpp b/tests/test_ogg.cpp index 4adf0c50..2469aa15 100644 --- a/tests/test_ogg.cpp +++ b/tests/test_ogg.cpp @@ -95,7 +95,7 @@ public: Vorbis::File f(newname.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.tag()->properties().size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.tag()->properties().size()); PropertyMap newTags; StringList values("value 1"); @@ -104,8 +104,8 @@ public: f.tag()->setProperties(newTags); PropertyMap map = f.tag()->properties(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), map.size()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), map["ARTIST"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, map.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, map["ARTIST"].size()); CPPUNIT_ASSERT_EQUAL(String("value 1"), map["ARTIST"][0]); } @@ -117,7 +117,7 @@ public: Vorbis::File f(newname.c_str()); PropertyMap tags = f.tag()->properties(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), tags["UNUSUALTAG"].size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2, tags["UNUSUALTAG"].size()); CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]); CPPUNIT_ASSERT_EQUAL(String("another value"), tags["UNUSUALTAG"][1]); CPPUNIT_ASSERT_EQUAL( @@ -160,7 +160,7 @@ public: f.save(); f.seek(0x50); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)0x3d3bd92d, f.readBlock(4).toUInt(0, true)); + CPPUNIT_ASSERT_EQUAL((unsigned int)0x3d3bd92d, f.readBlock(4).toUInt(0, true)); } { Vorbis::File f(copy.fileName().c_str()); @@ -168,7 +168,7 @@ public: f.save(); f.seek(0x50); - CPPUNIT_ASSERT_EQUAL((TagLib::uint)0xd985291c, f.readBlock(4).toUInt(0, true)); + CPPUNIT_ASSERT_EQUAL((unsigned int)0xd985291c, f.readBlock(4).toUInt(0, true)); } } @@ -194,7 +194,7 @@ public: f = new Vorbis::File(newname.c_str()); List<FLAC::Picture *> lst = f->tag()->pictureList(); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size()); CPPUNIT_ASSERT_EQUAL(int(5), lst[0]->width()); CPPUNIT_ASSERT_EQUAL(int(6), lst[0]->height()); CPPUNIT_ASSERT_EQUAL(int(16), lst[0]->colorDepth()); diff --git a/tests/test_riff.cpp b/tests/test_riff.cpp index 4ee8d080..8efedf89 100644 --- a/tests/test_riff.cpp +++ b/tests/test_riff.cpp @@ -13,14 +13,14 @@ class PublicRIFF : public RIFF::File { public: PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {}; - TagLib::uint riffSize() { return RIFF::File::riffSize(); }; - TagLib::uint chunkCount() { return RIFF::File::chunkCount(); }; - TagLib::uint chunkOffset(TagLib::uint i) { return RIFF::File::chunkOffset(i); }; - TagLib::uint chunkPadding(TagLib::uint i) { return RIFF::File::chunkPadding(i); }; - TagLib::uint chunkDataSize(TagLib::uint i) { return RIFF::File::chunkDataSize(i); }; - ByteVector chunkName(TagLib::uint i) { return RIFF::File::chunkName(i); }; - ByteVector chunkData(TagLib::uint i) { return RIFF::File::chunkData(i); }; - void setChunkData(TagLib::uint i, const ByteVector &data) { + unsigned int riffSize() { return RIFF::File::riffSize(); }; + unsigned int chunkCount() { return RIFF::File::chunkCount(); }; + unsigned int chunkOffset(unsigned int i) { return RIFF::File::chunkOffset(i); }; + unsigned int chunkPadding(unsigned int i) { return RIFF::File::chunkPadding(i); }; + unsigned int chunkDataSize(unsigned int i) { return RIFF::File::chunkDataSize(i); }; + ByteVector chunkName(unsigned int i) { return RIFF::File::chunkName(i); }; + ByteVector chunkData(unsigned int i) { return RIFF::File::chunkData(i); }; + void setChunkData(unsigned int i, const ByteVector &data) { RIFF::File::setChunkData(i, data); } void setChunkData(const ByteVector &name, const ByteVector &data) { @@ -29,7 +29,7 @@ public: virtual TagLib::Tag* tag() const { return 0; }; virtual TagLib::AudioProperties* audioProperties() const { return 0;}; virtual bool save() { return false; }; - void removeChunk(TagLib::uint i) { RIFF::File::removeChunk(i); } + void removeChunk(unsigned int i) { RIFF::File::removeChunk(i); } void removeChunk(const ByteVector &name) { RIFF::File::removeChunk(name); } }; @@ -53,7 +53,7 @@ public: { PublicRIFF f(filename.c_str()); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2)); f.setChunkData("TEST", "foo"); } @@ -61,8 +61,8 @@ public: PublicRIFF f(filename.c_str()); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("foo"), f.chunkData(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2)); f.setChunkData("SSND", "abcd"); @@ -95,33 +95,33 @@ public: { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); CPPUNIT_ASSERT_EQUAL(long(4400), f.length()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize()); f.setChunkData("TEST", "abcd"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4412 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize()); } { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3)); CPPUNIT_ASSERT_EQUAL(long(4412), f.length()); } } @@ -133,33 +133,33 @@ public: { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2)); CPPUNIT_ASSERT_EQUAL(long(4399), f.length()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize()); f.setChunkData("TEST", "abcd"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4412 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize()); } { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3)); CPPUNIT_ASSERT_EQUAL(long(4412), f.length()); } } @@ -171,33 +171,33 @@ public: { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0xff0 + 8), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0xff0 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2)); CPPUNIT_ASSERT_EQUAL(long(4399), f.length()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4399 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize()); f.setChunkData("TEST", "abc"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4411 - 8), f.riffSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4411 - 8), f.riffSize()); } { PublicRIFF f(filename.c_str()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4088), f.chunkOffset(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(311), f.chunkDataSize(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4088), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(4408), f.chunkOffset(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.chunkDataSize(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(4408), f.chunkOffset(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), f.chunkPadding(3)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3)); CPPUNIT_ASSERT_EQUAL(long(4412), f.length()); } } @@ -210,17 +210,17 @@ public: PublicRIFF f(filename.c_str()); CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.chunkName(0)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0)); CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(1)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0026 + 8), f.chunkOffset(1)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0026 + 8), f.chunkOffset(1)); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x1728 + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x1728 + 8), f.chunkOffset(2)); const ByteVector data(0x400, ' '); f.setChunkData("SSND", data); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0026 + 8), f.chunkOffset(1)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x042E + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0026 + 8), f.chunkOffset(1)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x042E + 8), f.chunkOffset(2)); f.seek(f.chunkOffset(0) - 8); CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4)); @@ -230,9 +230,9 @@ public: CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4)); f.setChunkData(0, data); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0414 + 8), f.chunkOffset(1)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x081C + 8), f.chunkOffset(2)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0414 + 8), f.chunkOffset(1)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x081C + 8), f.chunkOffset(2)); f.seek(f.chunkOffset(0) - 8); CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4)); @@ -242,8 +242,8 @@ public: CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4)); f.removeChunk("SSND"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0)); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x0414 + 8), f.chunkOffset(1)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x0414 + 8), f.chunkOffset(1)); f.seek(f.chunkOffset(0) - 8); CPPUNIT_ASSERT_EQUAL(ByteVector("COMM"), f.readBlock(4)); @@ -251,7 +251,7 @@ public: CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4)); f.removeChunk(0); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0x000C + 8), f.chunkOffset(0)); + CPPUNIT_ASSERT_EQUAL((unsigned int)(0x000C + 8), f.chunkOffset(0)); f.seek(f.chunkOffset(0) - 8); CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.readBlock(4)); diff --git a/tests/test_string.cpp b/tests/test_string.cpp index 73b08073..2ccba7b2 100644 --- a/tests/test_string.cpp +++ b/tests/test_string.cpp @@ -266,9 +266,9 @@ public: ByteVector lf("abc\x0axyz", 7); ByteVector crlf("abc\x0d\x0axyz", 8); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(cr).size()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(lf).size()); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), String(crlf).size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(cr).size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(lf).size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)8, String(crlf).size()); CPPUNIT_ASSERT_EQUAL(L'\x0d', String(cr)[3]); CPPUNIT_ASSERT_EQUAL(L'\x0a', String(lf)[3]); diff --git a/tests/test_synchdata.cpp b/tests/test_synchdata.cpp index 2e3021ea..04a5c07b 100644 --- a/tests/test_synchdata.cpp +++ b/tests/test_synchdata.cpp @@ -47,7 +47,7 @@ public: char data[] = { 0, 0, 0, 127 }; ByteVector v(data, 4); - CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(127)); + CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)127); CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(127), v); } @@ -56,7 +56,7 @@ public: char data[] = { 0, 0, 1, 0 }; ByteVector v(data, 4); - CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(128)); + CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)128); CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(128), v); } @@ -65,7 +65,7 @@ public: char data[] = { 0, 0, 1, 1 }; ByteVector v(data, 4); - CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(129)); + CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)129); CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(129), v); } @@ -74,8 +74,8 @@ public: char data[] = { 0, 0, 0, -1 }; char data2[] = { 0, 0, -1, -1 }; - CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(ByteVector(data, 4))); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(65535), ID3v2::SynchData::toUInt(ByteVector(data2, 4))); + CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(ByteVector(data, 4))); + CPPUNIT_ASSERT_EQUAL((unsigned int)65535, ID3v2::SynchData::toUInt(ByteVector(data2, 4))); } void testToUIntBrokenAndTooLarge() @@ -83,7 +83,7 @@ public: char data[] = { 0, 0, 0, -1, 0 }; ByteVector v(data, 5); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(255), ID3v2::SynchData::toUInt(v)); + CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(v)); } void testDecode1() diff --git a/tests/test_xiphcomment.cpp b/tests/test_xiphcomment.cpp index 617bd765..621179fe 100644 --- a/tests/test_xiphcomment.cpp +++ b/tests/test_xiphcomment.cpp @@ -27,11 +27,11 @@ public: void testYear() { Ogg::XiphComment cmt; - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), cmt.year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.year()); cmt.addField("YEAR", "2009"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2009), cmt.year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2009, cmt.year()); cmt.addField("DATE", "2008"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(2008), cmt.year()); + CPPUNIT_ASSERT_EQUAL((unsigned int)2008, cmt.year()); } void testSetYear() @@ -47,11 +47,11 @@ public: void testTrack() { Ogg::XiphComment cmt; - CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), cmt.track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.track()); cmt.addField("TRACKNUM", "7"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), cmt.track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)7, cmt.track()); cmt.addField("TRACKNUMBER", "8"); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), cmt.track()); + CPPUNIT_ASSERT_EQUAL((unsigned int)8, cmt.track()); } void testSetTrack() @@ -73,7 +73,7 @@ public: Ogg::XiphComment cmt; PropertyMap unsuccessful = cmt.setProperties(map); - CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), unsuccessful.size()); + CPPUNIT_ASSERT_EQUAL((unsigned int)3, unsuccessful.size()); CPPUNIT_ASSERT(cmt.properties().isEmpty()); } |