mirror of
https://github.com/taglib/taglib.git
synced 2026-02-07 16:00:22 -05:00
Change the size type of containers from uint to size_t
This commit is contained in:
@ -82,7 +82,7 @@ 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());
|
||||
uint n = std::min(static_cast<uint>(lines.size()), d->properties.instrumentCount());
|
||||
for(uint i = 0; i < n; ++ i) {
|
||||
writeString(lines[i], 22);
|
||||
seek(8, Current);
|
||||
|
||||
@ -44,8 +44,8 @@ bool Mod::FileBase::readString(String &s, uint size)
|
||||
{
|
||||
ByteVector data(readBlock(size));
|
||||
if(data.size() < size) return false;
|
||||
int index = data.find((char) 0);
|
||||
if(index > -1)
|
||||
const size_t index = data.find((char) 0);
|
||||
if(index != ByteVector::npos)
|
||||
{
|
||||
data.resize(index);
|
||||
}
|
||||
@ -63,22 +63,22 @@ void Mod::FileBase::writeByte(uchar byte)
|
||||
|
||||
void Mod::FileBase::writeU16L(ushort number)
|
||||
{
|
||||
writeBlock(ByteVector::fromShort(number, false));
|
||||
writeBlock(ByteVector::fromUInt16(number, false));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU32L(uint number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt(number, false));
|
||||
writeBlock(ByteVector::fromUInt32(number, false));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU16B(ushort number)
|
||||
{
|
||||
writeBlock(ByteVector::fromShort(number, true));
|
||||
writeBlock(ByteVector::fromUInt16(number, true));
|
||||
}
|
||||
|
||||
void Mod::FileBase::writeU32B(uint number)
|
||||
{
|
||||
writeBlock(ByteVector::fromUInt(number, true));
|
||||
writeBlock(ByteVector::fromUInt32(number, true));
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readByte(uchar &byte)
|
||||
@ -93,14 +93,14 @@ bool Mod::FileBase::readU16L(ushort &number)
|
||||
{
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
number = data.toUShort(false);
|
||||
number = data.toUInt16(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU32L(uint &number) {
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt(false);
|
||||
number = data.toUInt32(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -108,13 +108,13 @@ bool Mod::FileBase::readU16B(ushort &number)
|
||||
{
|
||||
ByteVector data(readBlock(2));
|
||||
if(data.size() < 2) return false;
|
||||
number = data.toUShort(true);
|
||||
number = data.toUInt16(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mod::FileBase::readU32B(uint &number) {
|
||||
ByteVector data(readBlock(4));
|
||||
if(data.size() < 4) return false;
|
||||
number = data.toUInt(true);
|
||||
number = data.toUInt32(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user