diff --git a/taglib/dsf/dsfproperties.cpp b/taglib/dsf/dsfproperties.cpp index 0d15fbac..c5c4fd3f 100644 --- a/taglib/dsf/dsfproperties.cpp +++ b/taglib/dsf/dsfproperties.cpp @@ -46,14 +46,14 @@ public: length(0) {} // Nomenclature is from DSF file format specification - uint formatVersion; - uint formatID; - uint channelType; - uint channelNum; - uint samplingFrequency; - uint bitsPerSample; + unsigned int formatVersion; + unsigned int formatID; + unsigned int channelType; + unsigned int channelNum; + unsigned int samplingFrequency; + unsigned int bitsPerSample; long long sampleCount; - uint blockSizePerChannel; + unsigned int blockSizePerChannel; // Computed int bitrate; diff --git a/taglib/ebml/ebmlelement.cpp b/taglib/ebml/ebmlelement.cpp index 030bc9a2..fde0bc21 100644 --- a/taglib/ebml/ebmlelement.cpp +++ b/taglib/ebml/ebmlelement.cpp @@ -75,8 +75,8 @@ public: // Determine the length of the integer char firstByte = document->readBlock(1)[0]; - uint byteSize = 1; - for(uint i = 0; i < 8 && ((firstByte << i) & (1 << 7)) == 0; ++i) + size_t byteSize = 1; + for(size_t i = 0; i < 8 && ((firstByte << i) & (1 << 7)) == 0; ++i) ++byteSize; // Load the integer @@ -325,7 +325,7 @@ String EBML::Element::getAsString() return String(getAsBinary(), String::UTF8); } -signed long long EBML::Element::getAsInt() +long long EBML::Element::getAsInt() { // The debug note about returning 0 because of empty data is irrelevant. The // behavior is as expected. diff --git a/taglib/ebml/ebmlelement.h b/taglib/ebml/ebmlelement.h index 98d61f06..0f4c6e5c 100644 --- a/taglib/ebml/ebmlelement.h +++ b/taglib/ebml/ebmlelement.h @@ -35,21 +35,21 @@ namespace TagLib { namespace EBML { - + /*! * Represents an element of the EBML. The only instance of this child, that * is directly used is the root element. Every other element is accessed * via pointers to the elements within the root element. - * + * * Just create one root instance per file to prevent race conditions. - * + * * Changes of the document tree will be directly written back to the file. * Invalid values (exceeding the maximal value defined in the RFC) will be * truncated. * * This class should not be used by library users since the proper file * class should handle the internals. - * + * * NOTE: Currently does not adjust CRC32 values. */ class TAGLIB_EXPORT Element @@ -57,218 +57,218 @@ namespace TagLib { public: //! Destroys the instance of the element. ~Element(); - + /*! * Creates an root element using document. */ Element(File *document); - + /*! * Returns the first found child element with the given id. Returns a null * pointer if the child does not exist. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *getChild(const ulli id); - + /*! * Returns a list of all child elements with the given id. Returns an * empty list if no such element exists. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ List getChildren(const ulli id); - + /*! * Returns a list of every child elements available. Returns an empty list * if there are no children. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ List getChildren(); - + /*! * Returns the parent element or null if no such element exists. */ Element *getParent(); - + /*! * Returns the raw content of the element. */ ByteVector getAsBinary(); - + /*! * Returns the content of this element interpreted as a string. */ String getAsString(); - + /*! * Returns the content of this element interpreted as an signed integer. - * + * * Do not call this method if *this element is not an INT element (see * corresponding DTD) */ - signed long long getAsInt(); - + long long getAsInt(); + /*! * Returns the content of this element interpreted as an unsigned integer. - * + * * Do not call this method if *this element is not an UINT element (see * corresponding DTD) */ ulli getAsUnsigned(); - + /*! * Returns the content of this element interpreted as a floating point * type. - * + * * Do not call this method if *this element is not an FLOAT element (see * corresponding DTD) - * + * * NOTE: There are 10 byte floats defined, therefore we might need a long * double to store the value. */ long double getAsFloat(); - + /*! * Adds an empty element with given id to this element. Returns a pointer * to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *addElement(ulli id); - + /*! * Adds a new element, containing the given binary, to this element. * Returns a pointer to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *addElement(ulli id, const ByteVector &binary); - + /*! * Adds a new element, containing the given string, to this element. * Returns a pointer to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *addElement(ulli id, const String &string); - + /*! * Adds a new element, containing the given integer, to this element. * Returns a pointer to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *addElement(ulli id, signed long long number); - + /*! * Adds a new element, containing the given unsigned integer, to this element. * Returns a pointer to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) */ Element *addElement(ulli id, ulli number); - + /*! * Adds a new element, containing the given floating point value, to this element. * Returns a pointer to the new element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) - * + * * This method is not implemented! */ Element *addElement(ulli id, long double number); - + /*! * Removes all children with the given id. Returns false if there was no * such element. * If useVoid is true, the element will be changed to a void element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) - * + * * Every pointer to a removed element is invalidated. */ bool removeChildren(ulli id, bool useVoid = true); - + /*! * Removes all children. Returns false if this element had no children. * If useVoid ist rue, the element will be changed to a void element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) - * + * * Every pointer to a removed element is invalidated. */ bool removeChildren(bool useVoid = true); - + /*! * Removes the given element. * If useVoid is true, the element will be changed to a void element. - * + * * Do not call this method if *this element is not a container element (see * corresponding DTD) - * + * * The pointer to the given element is invalidated. */ bool removeChild(Element *element, bool useVoid = true); - + /*! * Writes the given binary to this element. */ void setAsBinary(const ByteVector &binary); - + /*! * Writes the given string to this element. */ void setAsString(const String &string); - + /*! * Writes the given integer to this element. */ void setAsInt(signed long long number); - + /*! * Writes the given unsigned integer to this element. */ void setAsUnsigned(ulli number); - + /*! * Writes the given floating point variable to this element. - * + * * This method is not implemented! */ void setAsFloat(long double number); - + private: //! Non-copyable Element(const Element &); //! Non-copyable Element &operator=(const File &); - + //! Lazy parsing. This method will be triggered when trying to access //! children. void populate(); - + class ElementPrivate; ElementPrivate *d; - + //! Creates a new Element from an ElementPrivate. (The constructor takes //! ownership of the pointer and will delete it when the element is //! destroyed. Element(ElementPrivate *pe); }; - + } } diff --git a/taglib/ebml/matroska/ebmlmatroskafile.cpp b/taglib/ebml/matroska/ebmlmatroskafile.cpp index 26108bcd..ec525ae6 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.cpp +++ b/taglib/ebml/matroska/ebmlmatroskafile.cpp @@ -483,7 +483,7 @@ String EBML::Matroska::File::Tag::genre() const return String(); } -uint EBML::Matroska::File::Tag::year() const +unsigned int EBML::Matroska::File::Tag::year() const { if(e->year != e->document->d->tags.end()) return e->year->first.find(Constants::DATE_RELEASE)->second.front().toInt(); @@ -491,7 +491,7 @@ uint EBML::Matroska::File::Tag::year() const return 0; } -uint EBML::Matroska::File::Tag::track() const +unsigned int EBML::Matroska::File::Tag::track() const { if(e->track != e->document->d->tags.end()) return e->track->first.find(Constants::PART_NUMBER)->second.front().toInt(); @@ -544,7 +544,7 @@ void EBML::Matroska::File::Tag::setGenre(const String &s) e->insert(Constants::GENRE, Constants::MostCommonPartValue, s); } -void EBML::Matroska::File::Tag::setYear(uint i) +void EBML::Matroska::File::Tag::setYear(unsigned int i) { String s = String::number(i); if(e->year != e->document->d->tags.end()) @@ -553,7 +553,7 @@ void EBML::Matroska::File::Tag::setYear(uint i) e->insert(Constants::DATE_RELEASE, Constants::MostCommonPartValue, s); } -void EBML::Matroska::File::Tag::setTrack(uint i) +void EBML::Matroska::File::Tag::setTrack(unsigned int i) { String s = String::number(i); if(e->track != e->document->d->tags.end()) diff --git a/taglib/ebml/matroska/ebmlmatroskafile.h b/taglib/ebml/matroska/ebmlmatroskafile.h index 09461e0f..27f070b7 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.h +++ b/taglib/ebml/matroska/ebmlmatroskafile.h @@ -142,13 +142,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 s. If s is String::null then this value will be @@ -189,12 +189,12 @@ namespace TagLib { /*! * Sets the year to i. If s is 0 then this value will be cleared. */ - virtual void setYear(uint i); + virtual void setYear(unsigned int i); /*! * Sets the track to i. If s is 0 then this value will be cleared. */ - virtual void setTrack(uint i); + virtual void setTrack(unsigned int i); private: class TagPrivate; diff --git a/taglib/it/itfile.cpp b/taglib/it/itfile.cpp index aad39b2c..65c92d3d 100644 --- a/taglib/it/itfile.cpp +++ b/taglib/it/itfile.cpp @@ -166,7 +166,7 @@ bool IT::File::save() if(messageOffset + messageLength >= fileSize) { // append new message seek(54); - writeU16L(static_cast(message.size())); + writeU16L(static_cast(message.size())); writeU32L(messageOffset); seek(messageOffset); writeBlock(message); diff --git a/taglib/mp4/mp4item.cpp b/taglib/mp4/mp4item.cpp index 70f669cd..e5f842ef 100644 --- a/taglib/mp4/mp4item.cpp +++ b/taglib/mp4/mp4item.cpp @@ -44,8 +44,8 @@ namespace bool m_bool; int m_int; MP4::Item::IntPair m_intPair; - uchar m_byte; - uint m_uint; + unsigned char m_byte; + unsigned int m_uint; long long m_longlong; }; StringList m_stringList; @@ -253,13 +253,13 @@ MP4::Item::toString() const case TypeStringList: return d->data->m_stringList.toString(" / "); case TypeByteVectorList: - for(TagLib::uint i = 0; i < d->data->m_byteVectorList.size(); i++) { + for(size_t i = 0; i < d->data->m_byteVectorList.size(); i++) { desc.append(Utils::formatString( "[%d bytes of data]", static_cast(d->data->m_byteVectorList[i].size()))); } return desc.toString(", "); case TypeCoverArtList: - for(TagLib::uint i = 0; i < d->data->m_coverArtList.size(); i++) { + for(size_t i = 0; i < d->data->m_coverArtList.size(); i++) { desc.append(Utils::formatString( "[%d bytes of data]", static_cast(d->data->m_coverArtList[i].data().size()))); } diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 45564de2..549f9f1a 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -598,7 +598,7 @@ MP4::Tag::updateOffsets(long delta, long long offset) } d->file->seek(atom->offset + 9); ByteVector data = d->file->readBlock(static_cast(atom->length - 9)); - const uint flags = data.toUInt24BE(0); + const unsigned int flags = data.toUInt24BE(0); if(flags & 1) { long long o = data.toInt64BE(7); if(o > offset) { diff --git a/taglib/mpc/mpcproperties.cpp b/taglib/mpc/mpcproperties.cpp index 7b5fe855..de8f14e8 100644 --- a/taglib/mpc/mpcproperties.cpp +++ b/taglib/mpc/mpcproperties.cpp @@ -35,7 +35,7 @@ using namespace TagLib; namespace { - const TagLib::uint HeaderSize = 56; + const unsigned int HeaderSize = 56; } class MPC::AudioProperties::PropertiesPrivate diff --git a/taglib/mpeg/id3v2/id3v2frame.cpp b/taglib/mpeg/id3v2/id3v2frame.cpp index c79d7387..29ed421f 100644 --- a/taglib/mpeg/id3v2/id3v2frame.cpp +++ b/taglib/mpeg/id3v2/id3v2frame.cpp @@ -194,7 +194,7 @@ void Frame::setText(const String &) ByteVector Frame::render() const { ByteVector fieldData = renderFields(); - d->header->setFrameSize(static_cast(fieldData.size())); + d->header->setFrameSize(static_cast(fieldData.size())); ByteVector headerData = d->header->render(); return headerData + fieldData; @@ -733,7 +733,7 @@ void Frame::Header::setData(const ByteVector &data, unsigned int version) // iTunes writes v2.4 tags with v2.3-like frame sizes if(d->frameSize > 127) { if(!isValidFrameID(data.mid(d->frameSize + 10, 4))) { - const uint uintSize = data.toUInt32BE(4); + const unsigned int uintSize = data.toUInt32BE(4); if(isValidFrameID(data.mid(uintSize + 10, 4))) { d->frameSize = uintSize; } diff --git a/taglib/ogg/oggpage.cpp b/taglib/ogg/oggpage.cpp index 63bbc134..0106b18b 100644 --- a/taglib/ogg/oggpage.cpp +++ b/taglib/ogg/oggpage.cpp @@ -131,9 +131,9 @@ Ogg::Page::ContainsPacketFlags Ogg::Page::containsPacket(int index) const return flags; } -unsigned int Ogg::Page::packetCount() const +size_t Ogg::Page::packetCount() const { - return static_cast(d->header.packetSizes().size()); + return d->header.packetSizes().size(); } ByteVectorList Ogg::Page::packets() const diff --git a/taglib/ogg/oggpage.h b/taglib/ogg/oggpage.h index 57f53e59..664c0cae 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. */ - unsigned int packetCount() const; + size_t packetCount() const; /*! * Returns a list of the packets in this page. diff --git a/taglib/riff/rifffile.cpp b/taglib/riff/rifffile.cpp index 73c0c870..513ae169 100644 --- a/taglib/riff/rifffile.cpp +++ b/taglib/riff/rifffile.cpp @@ -95,9 +95,9 @@ unsigned int RIFF::File::riffSize() const return d->size; } -unsigned int RIFF::File::chunkCount() const +size_t RIFF::File::chunkCount() const { - return static_cast(d->chunks.size()); + return d->chunks.size(); } unsigned int RIFF::File::chunkDataSize(unsigned int i) const @@ -105,7 +105,7 @@ unsigned int RIFF::File::chunkDataSize(unsigned int i) const return d->chunks[i].size; } -long long RIFF::File::chunkOffset(uint i) const +long long RIFF::File::chunkOffset(unsigned int i) const { return d->chunks[i].offset; } @@ -187,7 +187,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo // First we update the global size - d->size += static_cast((offset & 1) + data.size() + 8); + d->size += static_cast((offset & 1) + data.size() + 8); if(d->endianness == BigEndian) insert(ByteVector::fromUInt32BE(d->size), 4, 4); else @@ -199,8 +199,8 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo name, data, offset, - static_cast(std::max(0LL, length() - offset)), - static_cast(offset & 1)); + static_cast(std::max(0LL, length() - offset)), + static_cast(offset & 1)); // And update our internal structure @@ -211,7 +211,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo Chunk chunk; chunk.name = name; - chunk.size = static_cast(data.size()); + chunk.size = static_cast(data.size()); chunk.offset = offset + 8; chunk.padding = static_cast(data.size() & 1); diff --git a/taglib/riff/rifffile.h b/taglib/riff/rifffile.h index 199b53d6..5fec8111 100644 --- a/taglib/riff/rifffile.h +++ b/taglib/riff/rifffile.h @@ -63,7 +63,7 @@ namespace TagLib { /*! * \return The number of chunks in the file. */ - unsigned int chunkCount() const; + size_t chunkCount() const; /*! * \return The offset within the file for the selected chunk number. diff --git a/taglib/riff/wav/infotag.cpp b/taglib/riff/wav/infotag.cpp index 2b13637a..fffbf7a6 100644 --- a/taglib/riff/wav/infotag.cpp +++ b/taglib/riff/wav/infotag.cpp @@ -246,7 +246,7 @@ void RIFF::Info::Tag::parse(const ByteVector &data) { size_t p = 4; while(p < data.size()) { - const uint size = data.toUInt32LE(p + 4); + const unsigned int size = data.toUInt32LE(p + 4); if(size > data.size() - p - 8) break; diff --git a/taglib/tagunion.cpp b/taglib/tagunion.cpp index 7e951c9b..e94125ea 100644 --- a/taglib/tagunion.cpp +++ b/taglib/tagunion.cpp @@ -39,7 +39,7 @@ #define numberUnion(method) \ for(size_t j = 0; j < COUNT; ++j) { \ - uint val = d->tags[j] ? d->tags[j]->method() : 0; \ + unsigned int val = d->tags[j] ? d->tags[j]->method() : 0; \ if(val > 0) \ return val; \ } \ diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index 493ecfbc..da0d3e35 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -48,15 +48,6 @@ namespace TagLib { - // 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; - enum ByteOrder { LittleEndian, diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index e3ed0a62..4851fc9f 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -134,7 +134,7 @@ inline T toNumber(const ByteVector &v, size_t offset) T sum = 0; for(size_t i = 0; i < length; ++i) { const size_t shift = (ENDIAN == BigEndian ? length - 1 - i : i) * 8; - sum |= static_cast(static_cast(v[offset + i])) << shift; + sum |= static_cast(static_cast(v[offset + i])) << shift; } return sum; @@ -292,42 +292,42 @@ ByteVector ByteVector::fromCString(const char *s, size_t length) ByteVector ByteVector::fromUInt16LE(size_t value) { - return fromNumber(static_cast(value)); + return fromNumber(static_cast(value)); } ByteVector ByteVector::fromUInt16BE(size_t value) { - return fromNumber(static_cast(value)); + return fromNumber(static_cast(value)); } ByteVector ByteVector::fromUInt32LE(size_t value) { - return fromNumber(static_cast(value)); + return fromNumber(static_cast(value)); } ByteVector ByteVector::fromUInt32BE(size_t value) { - return fromNumber(static_cast(value)); + return fromNumber(static_cast(value)); } -ByteVector ByteVector::fromUInt64LE(ulonglong value) +ByteVector ByteVector::fromUInt64LE(unsigned long long value) { - return fromNumber(value); + return fromNumber(value); } -ByteVector ByteVector::fromUInt64BE(ulonglong value) +ByteVector ByteVector::fromUInt64BE(unsigned long long value) { - return fromNumber(value); + return fromNumber(value); } ByteVector ByteVector::fromFloat32LE(float value) { - return fromFloat(value); + return fromFloat(value); } ByteVector ByteVector::fromFloat32BE(float value) { - return fromFloat(value); + return fromFloat(value); } ByteVector ByteVector::fromFloat64LE(double value) @@ -691,62 +691,62 @@ unsigned int ByteVector::checksum() const short ByteVector::toInt16LE(size_t offset) const { - return static_cast(toNumber(*this, offset)); + return static_cast(toNumber(*this, offset)); } short ByteVector::toInt16BE(size_t offset) const { - return static_cast(toNumber(*this, offset)); + return static_cast(toNumber(*this, offset)); } -ushort ByteVector::toUInt16LE(size_t offset) const +unsigned short ByteVector::toUInt16LE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } -ushort ByteVector::toUInt16BE(size_t offset) const +unsigned short ByteVector::toUInt16BE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } -uint ByteVector::toUInt24LE(size_t offset) const +unsigned int ByteVector::toUInt24LE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } -uint ByteVector::toUInt24BE(size_t offset) const +unsigned int ByteVector::toUInt24BE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } -uint ByteVector::toUInt32LE(size_t offset) const +unsigned int ByteVector::toUInt32LE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } -uint ByteVector::toUInt32BE(size_t offset) const +unsigned int ByteVector::toUInt32BE(size_t offset) const { - return toNumber(*this, offset); + return toNumber(*this, offset); } long long ByteVector::toInt64LE(size_t offset) const { - return static_cast(toNumber(*this, offset)); + return static_cast(toNumber(*this, offset)); } long long ByteVector::toInt64BE(size_t offset) const { - return static_cast(toNumber(*this, offset)); + return static_cast(toNumber(*this, offset)); } float ByteVector::toFloat32LE(size_t offset) const { - return toFloat(*this, offset); + return toFloat(*this, offset); } float ByteVector::toFloat32BE(size_t offset) const { - return toFloat(*this, offset); + return toFloat(*this, offset); } double ByteVector::toFloat64LE(size_t offset) const diff --git a/taglib/toolkit/tbytevector.h b/taglib/toolkit/tbytevector.h index 0ba735d8..2f0ff9cd 100644 --- a/taglib/toolkit/tbytevector.h +++ b/taglib/toolkit/tbytevector.h @@ -295,48 +295,48 @@ namespace TagLib { short toInt16BE(size_t offset) const; /*! - * Converts the 2 bytes at \a offset of the vector to a ushort as an unsigned - * 16-bit little-endian integer. + * Converts the 2 bytes at \a offset of the vector to a unsigned short as an + * unsigned 16-bit little-endian integer. * * \see fromUInt16LE() */ - ushort toUInt16LE(size_t offset) const; + unsigned short toUInt16LE(size_t offset) const; /*! - * Converts the 2 bytes at \a offset of the vector to a ushort as an unsigned - * 16-bit big-endian integer. + * Converts the 2 bytes at \a offset of the vector to a unsigned short as an + * unsigned 16-bit big-endian integer. * * \see fromUInt16BE() */ - ushort toUInt16BE(size_t offset) const; + unsigned short toUInt16BE(size_t offset) const; /*! - * Converts the 3 bytes at \a offset of the vector to a uint as an unsigned - * 24-bit little-endian integer. + * Converts the 3 bytes at \a offset of the vector to a unsigned int as an + * unsigned 24-bit little-endian integer. */ - uint toUInt24LE(size_t offset) const; + unsigned int toUInt24LE(size_t offset) const; /*! - * Converts the 3 bytes at \a offset of the vector to a uint as an unsigned - * 24-bit big-endian integer. + * Converts the 3 bytes at \a offset of the vector to a unsigned int as an + * unsigned 24-bit big-endian integer. */ - uint toUInt24BE(size_t offset) const; + unsigned int toUInt24BE(size_t offset) const; /*! - * Converts the 4 bytes at \a offset of the vector to a uint as an unsigned - * 32-bit little-endian integer. + * Converts the 4 bytes at \a offset of the vector to a unsigned int as an + * unsigned 32-bit little-endian integer. * * \see fromUInt32LE() */ - uint toUInt32LE(size_t offset) const; + unsigned int toUInt32LE(size_t offset) const; /*! - * Converts the 4 bytes at \a offset of the vector to a ushort as an unsigned - * 32-bit big-endian integer. + * Converts the 4 bytes at \a offset of the vector to a unsigned int as an + * unsigned 32-bit big-endian integer. * * \see fromUInt32BE() */ - uint toUInt32BE(size_t offset) const; + unsigned int toUInt32BE(size_t offset) const; /*! * Converts the 8 bytes at \a offset of the vector to a long long as a signed @@ -436,7 +436,7 @@ namespace TagLib { * * \see toUInt64LE() */ - static ByteVector fromUInt64LE(ulonglong value); + static ByteVector fromUInt64LE(unsigned long long value); /*! * Creates a 8 byte ByteVector based on \a value as an unsigned 64-bit @@ -444,7 +444,7 @@ namespace TagLib { * * \see toUInt64BE() */ - static ByteVector fromUInt64BE(ulonglong value); + static ByteVector fromUInt64BE(unsigned long long value); /*! * Creates a 4 byte ByteVector based on \a value as an IEEE754 32-bit diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp index 117dbf5b..d3637e92 100644 --- a/taglib/toolkit/tstring.cpp +++ b/taglib/toolkit/tstring.cpp @@ -708,7 +708,7 @@ String &String::operator+=(char c) { detach(); - *d->data += uchar(c); + *d->data += static_cast(c); return *this; } diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp index fa056ae8..7a5b0e32 100644 --- a/taglib/trueaudio/trueaudiofile.cpp +++ b/taglib/trueaudio/trueaudiofile.cpp @@ -46,7 +46,7 @@ namespace { enum { TrueAudioID3v2Index = 0, TrueAudioID3v1Index = 1 }; - const TagLib::uint HeaderSize = 18; + const unsigned int HeaderSize = 18; } class TrueAudio::File::FilePrivate @@ -166,7 +166,7 @@ bool TrueAudio::File::save() ByteVector data = ID3v2Tag()->render(); insert(data, d->ID3v2Location, d->ID3v2OriginalSize); d->ID3v1Location -= d->ID3v2OriginalSize - data.size(); - d->ID3v2OriginalSize = static_cast(data.size()); + d->ID3v2OriginalSize = static_cast(data.size()); d->hasID3v2 = true; } else if(d->hasID3v2) { diff --git a/taglib/xm/xmfile.cpp b/taglib/xm/xmfile.cpp index 82339232..d0f57779 100644 --- a/taglib/xm/xmfile.cpp +++ b/taglib/xm/xmfile.cpp @@ -74,35 +74,35 @@ namespace * 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 @@ -120,12 +120,12 @@ namespace class StringReader : public ValueReader { public: - StringReader(String &string, uint size) : + StringReader(String &string, unsigned int size) : ValueReader(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)); size_t count = data.size(); @@ -135,33 +135,33 @@ namespace } data.replace((char) 0xff, ' '); value = data; - return static_cast(count); + return static_cast(count); } - uint size() const + unsigned int size() const { return m_size; } private: - uint m_size; + unsigned int m_size; }; - class ByteReader : public ValueReader + class ByteReader : public ValueReader { public: - ByteReader(uchar &byte) : ValueReader(byte) {} + ByteReader(unsigned char &byte) : ValueReader(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) { value = data[0]; } - return static_cast(data.size()); + return static_cast(data.size()); } - uint size() const + unsigned int size() const { return 1; } @@ -180,13 +180,13 @@ namespace bool bigEndian; }; - class U16Reader : public NumberReader + class U16Reader : public NumberReader { public: - U16Reader(ushort &value, bool bigEndian) - : NumberReader(value, bigEndian) {} + U16Reader(unsigned short &value, bool bigEndian) + : NumberReader(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)); @@ -195,24 +195,24 @@ namespace else value = data.toUInt16LE(0); - return static_cast(data.size()); + return static_cast(data.size()); } - uint size() const + unsigned int size() const { return 2; } }; - class U32Reader : public NumberReader + class U32Reader : public NumberReader { public: - U32Reader(uint &value, bool bigEndian = true) : - NumberReader(value, bigEndian) + U32Reader(unsigned int &value, bool bigEndian = true) : + NumberReader(value, bigEndian) { } - uint read(TagLib::File &file, uint limit) + unsigned int read(TagLib::File &file, unsigned int limit) { ByteVector data = file.readBlock(std::min(4U,limit)); @@ -221,10 +221,10 @@ namespace else value = data.toUInt32LE(0); - return static_cast(data.size()); + return static_cast(data.size()); } - uint size() const + unsigned int size() const { return 4; } @@ -250,7 +250,7 @@ namespace /*! * 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; @@ -259,7 +259,7 @@ namespace /*! * 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; @@ -268,7 +268,7 @@ namespace /*! * Read a byte into \a byte. */ - StructReader &byte(uchar &byte) + StructReader &byte(unsigned char &byte) { m_readers.append(new ByteReader(byte)); return *this; @@ -278,7 +278,7 @@ namespace * Read a unsigned 16 Bit integer into \a number. The byte order * is controlled by \a bigEndian. */ - StructReader &u16(ushort &number, bool bigEndian) + StructReader &u16(unsigned short &number, bool bigEndian) { m_readers.append(new U16Reader(number, bigEndian)); return *this; @@ -287,7 +287,7 @@ namespace /*! * Read a unsigned 16 Bit little endian integer into \a number. */ - StructReader &u16L(ushort &number) + StructReader &u16L(unsigned short &number) { return u16(number, false); } @@ -295,7 +295,7 @@ namespace /*! * Read a unsigned 16 Bit big endian integer into \a number. */ - StructReader &u16B(ushort &number) + StructReader &u16B(unsigned short &number) { return u16(number, true); } @@ -304,7 +304,7 @@ namespace * Read a unsigned 32 Bit integer into \a number. The byte order * is controlled by \a bigEndian. */ - StructReader &u32(uint &number, bool bigEndian) + StructReader &u32(unsigned int &number, bool bigEndian) { m_readers.append(new U32Reader(number, bigEndian)); return *this; @@ -313,7 +313,7 @@ namespace /*! * Read a unsigned 32 Bit little endian integer into \a number. */ - StructReader &u32L(uint &number) + StructReader &u32L(unsigned int &number) { return u32(number, false); } @@ -321,14 +321,14 @@ namespace /*! * Read a unsigned 32 Bit big endian integer into \a number. */ - StructReader &u32B(uint &number) + StructReader &u32B(unsigned int &number) { return u32(number, true); } - uint size() const + unsigned int size() const { - uint size = 0; + unsigned int size = 0; for(List::ConstIterator i = m_readers.begin(); i != m_readers.end(); ++ i) { size += (*i)->size(); @@ -336,12 +336,12 @@ namespace 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::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; } @@ -595,7 +595,7 @@ void XM::File::read(bool) // skip unhandeled header proportion: seek(instrumentHeaderSize - count - 4, Current); - for(ushort j = 0; j < sampleCount; ++ j) { + for(unsigned short j = 0; j < sampleCount; ++ j) { unsigned int sampleLength = 0; unsigned int loopStart = 0; unsigned int loopLength = 0; diff --git a/taglib/xm/xmproperties.cpp b/taglib/xm/xmproperties.cpp index 41eec4d6..200eae50 100644 --- a/taglib/xm/xmproperties.cpp +++ b/taglib/xm/xmproperties.cpp @@ -174,7 +174,7 @@ void XM::AudioProperties::setInstrumentCount(unsigned short instrumentCount) d->instrumentCount = instrumentCount; } -void XM::AudioProperties::setSampleCount(uint sampleCount) +void XM::AudioProperties::setSampleCount(unsigned int sampleCount) { d->sampleCount = sampleCount; }