Use a standard type rather than TagLib::uint.

This won't break the ABI compatibility.
This commit is contained in:
Tsuda Kageyu 2015-12-03 01:50:44 +09:00
parent 085a0ef298
commit a0b8683656
131 changed files with 775 additions and 771 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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.

View File

@ -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())

View File

@ -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.

View File

@ -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.

View File

@ -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));

View File

@ -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.

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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));
}

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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.");

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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:

View File

@ -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)
{
}

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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));
}

View File

@ -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;
};

View File

@ -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));
}
}
}

View File

@ -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.

View File

@ -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];

View File

@ -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));

View File

@ -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;
};

View File

@ -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);
}

View File

@ -95,7 +95,7 @@ namespace TagLib {
*
* \see childElements()
*/
uint entryCount() const;
unsigned int entryCount() const;
/*!
* Returns list of child elements of the frame.

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -42,7 +42,7 @@ Footer::~Footer()
{
}
TagLib::uint Footer::size()
unsigned int Footer::size()
{
return 10;
}

View File

@ -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.

View File

@ -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;
}

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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.

View File

@ -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

View File

@ -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());

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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;
}

View File

@ -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

View File

@ -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));

View File

@ -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);

View File

@ -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");

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -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())

View File

@ -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.

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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]) {

View File

@ -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);

View File

@ -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.

View File

@ -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

View File

@ -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);
}

View File

@ -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)

View File

@ -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.

View File

@ -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;
}

View File

@ -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 &);

View File

@ -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))

View File

@ -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);
}

View File

@ -488,7 +488,7 @@ bool File::isWritable(const char *file)
// protected members
////////////////////////////////////////////////////////////////////////////////
TagLib::uint File::bufferSize()
unsigned int File::bufferSize()
{
return 1024;
}

View File

@ -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 &);

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -119,7 +119,7 @@ namespace TagLib {
*
* \see isEmpty()
*/
uint size() const;
unsigned int size() const;
/*!
* Returns true if the map is empty.

Some files were not shown because too many files have changed in this diff Show More