Use a standard type rather than TagLib::uchar.

This won't break the ABI compatibility.
This commit is contained in:
Tsuda Kageyu 2015-12-02 18:11:52 +09:00
parent 2cb89b85c9
commit 8bdddaabce
32 changed files with 131 additions and 130 deletions

View File

@ -55,12 +55,12 @@ public:
ushort compatibleVersion;
ushort flags;
ushort special;
uchar globalVolume;
uchar mixVolume;
uchar tempo;
uchar bpmSpeed;
uchar panningSeparation;
uchar pitchWheelDepth;
unsigned char globalVolume;
unsigned char mixVolume;
unsigned char tempo;
unsigned char bpmSpeed;
unsigned char panningSeparation;
unsigned char pitchWheelDepth;
};
IT::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
@ -149,32 +149,32 @@ TagLib::ushort IT::Properties::special() const
return d->special;
}
uchar IT::Properties::globalVolume() const
unsigned char IT::Properties::globalVolume() const
{
return d->globalVolume;
}
uchar IT::Properties::mixVolume() const
unsigned char IT::Properties::mixVolume() const
{
return d->mixVolume;
}
uchar IT::Properties::tempo() const
unsigned char IT::Properties::tempo() const
{
return d->tempo;
}
uchar IT::Properties::bpmSpeed() const
unsigned char IT::Properties::bpmSpeed() const
{
return d->bpmSpeed;
}
uchar IT::Properties::panningSeparation() const
unsigned char IT::Properties::panningSeparation() const
{
return d->panningSeparation;
}
uchar IT::Properties::pitchWheelDepth() const
unsigned char IT::Properties::pitchWheelDepth() const
{
return d->pitchWheelDepth;
}
@ -224,32 +224,32 @@ void IT::Properties::setVersion(ushort version)
d->version = version;
}
void IT::Properties::setGlobalVolume(uchar globalVolume)
void IT::Properties::setGlobalVolume(unsigned char globalVolume)
{
d->globalVolume = globalVolume;
}
void IT::Properties::setMixVolume(uchar mixVolume)
void IT::Properties::setMixVolume(unsigned char mixVolume)
{
d->mixVolume = mixVolume;
}
void IT::Properties::setTempo(uchar tempo)
void IT::Properties::setTempo(unsigned char tempo)
{
d->tempo = tempo;
}
void IT::Properties::setBpmSpeed(uchar bpmSpeed)
void IT::Properties::setBpmSpeed(unsigned char bpmSpeed)
{
d->bpmSpeed = bpmSpeed;
}
void IT::Properties::setPanningSeparation(uchar panningSeparation)
void IT::Properties::setPanningSeparation(unsigned char panningSeparation)
{
d->panningSeparation = panningSeparation;
}
void IT::Properties::setPitchWheelDepth(uchar pitchWheelDepth)
void IT::Properties::setPitchWheelDepth(unsigned char pitchWheelDepth)
{
d->pitchWheelDepth = pitchWheelDepth;
}

View File

@ -67,12 +67,12 @@ namespace TagLib {
ushort compatibleVersion() const;
ushort flags() const;
ushort special() const;
uchar globalVolume() const;
uchar mixVolume() const;
uchar tempo() const;
uchar bpmSpeed() const;
uchar panningSeparation() const;
uchar pitchWheelDepth() const;
unsigned char globalVolume() const;
unsigned char mixVolume() const;
unsigned char tempo() const;
unsigned char bpmSpeed() const;
unsigned char panningSeparation() const;
unsigned char pitchWheelDepth() const;
void setChannels(int channels);
void setLengthInPatterns(ushort lengthInPatterns);
@ -83,12 +83,12 @@ namespace TagLib {
void setCompatibleVersion(ushort compatibleVersion);
void setFlags (ushort flags);
void setSpecial (ushort special);
void setGlobalVolume(uchar globalVolume);
void setMixVolume (uchar mixVolume);
void setTempo (uchar tempo);
void setBpmSpeed (uchar bpmSpeed);
void setPanningSeparation(uchar panningSeparation);
void setPitchWheelDepth (uchar pitchWheelDepth);
void setGlobalVolume(unsigned char globalVolume);
void setMixVolume (unsigned char mixVolume);
void setTempo (unsigned char tempo);
void setBpmSpeed (unsigned char bpmSpeed);
void setPanningSeparation(unsigned char panningSeparation);
void setPitchWheelDepth (unsigned char pitchWheelDepth);
private:
Properties(const Properties&);

View File

@ -55,7 +55,7 @@ bool Mod::FileBase::readString(String &s, ulong size)
return true;
}
void Mod::FileBase::writeByte(uchar byte)
void Mod::FileBase::writeByte(unsigned char byte)
{
ByteVector data(1, byte);
writeBlock(data);
@ -81,7 +81,7 @@ void Mod::FileBase::writeU32B(ulong number)
writeBlock(ByteVector::fromUInt(number, true));
}
bool Mod::FileBase::readByte(uchar &byte)
bool Mod::FileBase::readByte(unsigned char &byte)
{
ByteVector data(readBlock(1));
if(data.size() < 1) return false;

View File

@ -41,14 +41,14 @@ namespace TagLib {
FileBase(IOStream *stream);
void writeString(const String &s, ulong size, char padding = 0);
void writeByte(uchar byte);
void writeByte(unsigned char byte);
void writeU16L(ushort number);
void writeU32L(ulong number);
void writeU16B(ushort number);
void writeU32B(ulong number);
bool readString(String &s, ulong size);
bool readByte(uchar &byte);
bool readByte(unsigned char &byte);
bool readU16L(ushort &number);
bool readU32L(ulong &number);
bool readU16B(ushort &number);

View File

@ -37,7 +37,7 @@
setter(number); \
}
#define READ_BYTE(setter) READ(setter,uchar,readByte)
#define READ_BYTE(setter) READ(setter,unsigned char,readByte)
#define READ_U16L(setter) READ(setter,ushort,readU16L)
#define READ_U32L(setter) READ(setter,ulong,readU32L)
#define READ_U16B(setter) READ(setter,ushort,readU16B)
@ -54,7 +54,7 @@
type name = 0; \
READ_ASSERT(read(name));
#define READ_BYTE_AS(name) READ_AS(uchar,name,readByte)
#define READ_BYTE_AS(name) READ_AS(unsigned char,name,readByte)
#define READ_U16L_AS(name) READ_AS(ushort,name,readU16L)
#define READ_U32L_AS(name) READ_AS(ulong,name,readU32L)
#define READ_U16B_AS(name) READ_AS(ushort,name,readU16B)

View File

@ -36,7 +36,7 @@ public:
int channels;
uint instrumentCount;
uchar lengthInPatterns;
unsigned char lengthInPatterns;
};
Mod::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
@ -85,7 +85,7 @@ TagLib::uint Mod::Properties::instrumentCount() const
return d->instrumentCount;
}
uchar Mod::Properties::lengthInPatterns() const
unsigned char Mod::Properties::lengthInPatterns() const
{
return d->lengthInPatterns;
}
@ -100,7 +100,7 @@ void Mod::Properties::setInstrumentCount(uint instrumentCount)
d->instrumentCount = instrumentCount;
}
void Mod::Properties::setLengthInPatterns(uchar lengthInPatterns)
void Mod::Properties::setLengthInPatterns(unsigned char lengthInPatterns)
{
d->lengthInPatterns = lengthInPatterns;
}

View File

@ -43,12 +43,12 @@ namespace TagLib {
int channels() const;
uint instrumentCount() const;
uchar lengthInPatterns() const;
unsigned char lengthInPatterns() const;
void setChannels(int channels);
void setInstrumentCount(uint sampleCount);
void setLengthInPatterns(uchar lengthInPatterns);
void setLengthInPatterns(unsigned char lengthInPatterns);
private:
friend class File;

View File

@ -44,7 +44,7 @@ public:
bool m_bool;
int m_int;
IntPair m_intPair;
uchar m_byte;
unsigned char m_byte;
uint m_uint;
long long m_longlong;
};
@ -98,7 +98,7 @@ MP4::Item::Item(int value) :
d->m_int = value;
}
MP4::Item::Item(uchar value) :
MP4::Item::Item(unsigned char value) :
d(new ItemPrivate())
{
d->m_byte = value;
@ -163,7 +163,7 @@ MP4::Item::toInt() const
return d->m_int;
}
uchar
unsigned char
MP4::Item::toByte() const
{
return d->m_byte;

View File

@ -57,7 +57,7 @@ namespace TagLib {
~Item();
Item(int value);
Item(uchar value);
Item(unsigned char value);
Item(uint value);
Item(long long value);
Item(bool value);
@ -70,7 +70,7 @@ namespace TagLib {
AtomDataType atomDataType() const;
int toInt() const;
uchar toByte() const;
unsigned char toByte() const;
uint toUInt() const;
long long toLongLong() const;
bool toBool() const;

View File

@ -189,7 +189,7 @@ MP4::Tag::parseByte(const MP4::Atom *atom)
{
ByteVectorList data = parseData(atom);
if(!data.isEmpty()) {
addItem(atom->name, (uchar)data[0].at(0));
addItem(atom->name, static_cast<unsigned char>(data[0].at(0)));
}
}

View File

@ -50,8 +50,8 @@ public:
String album;
String year;
String comment;
uchar track;
uchar genre;
unsigned char track;
unsigned char genre;
};
////////////////////////////////////////////////////////////////////////////////
@ -251,12 +251,12 @@ void ID3v1::Tag::parse(const ByteVector &data)
// ID3v1.1 detected
d->comment = stringHandler->parse(data.mid(offset, 28));
d->track = uchar(data[offset + 29]);
d->track = static_cast<unsigned char>(data[offset + 29]);
}
else
d->comment = data.mid(offset, 30);
offset += 30;
d->genre = uchar(data[offset]);
d->genre = static_cast<unsigned char>(data[offset]);
}

View File

@ -109,7 +109,7 @@ void EventTimingCodesFrame::parseFields(const ByteVector &data)
int pos = 1;
d->synchedEvents.clear();
while(pos + 4 < end) {
EventType type = EventType(uchar(data[pos++]));
EventType type = static_cast<EventType>(static_cast<unsigned char>(data[pos++]));
uint time = data.toUInt(pos, true);
pos += 4;
d->synchedEvents.append(SynchedEvent(time, type));

View File

@ -212,7 +212,7 @@ void Header::parse(const ByteVector &data)
}
for(ByteVector::ConstIterator it = sizeData.begin(); it != sizeData.end(); it++) {
if(uchar(*it) >= 128) {
if(static_cast<unsigned char>(*it) >= 128) {
d->tagSize = 0;
debug("TagLib::ID3v2::Header::parse() - One of the size bytes in the id3v2 header was greater than the allowed 128.");
return;

View File

@ -67,7 +67,7 @@ ByteVector SynchData::fromUInt(uint value)
ByteVector v(4, 0);
for(int i = 0; i < 4; i++)
v[i] = uchar(value >> ((3 - i) * 7) & 0x7f);
v[i] = static_cast<unsigned char>(value >> ((3 - i) * 7) & 0x7f);
return v;
}

View File

@ -45,12 +45,12 @@ namespace
* starts with \e 111 is a bit more tricky, hence these functions.
*/
inline bool firstSyncByte(uchar byte)
inline bool firstSyncByte(unsigned char byte)
{
return (byte == 0xFF);
}
inline bool secondSynchByte(uchar byte)
inline bool secondSynchByte(unsigned char byte)
{
return ((byte & 0xE0) == 0xE0);
}

View File

@ -164,7 +164,7 @@ MPEG::Header &MPEG::Header::operator=(const Header &h)
void MPEG::Header::parse(const ByteVector &data)
{
if(data.size() < 4 || uchar(data[0]) != 0xff) {
if(data.size() < 4 || static_cast<unsigned char>(data[0]) != 0xff) {
debug("MPEG::Header::parse() -- First byte did not match MPEG synch.");
return;
}
@ -219,7 +219,7 @@ void MPEG::Header::parse(const ByteVector &data)
// The bitrate index is encoded as the first 4 bits of the 3rd byte,
// i.e. 1111xxxx
int i = uchar(data[2]) >> 4;
int i = static_cast<unsigned char>(data[2]) >> 4;
d->bitrate = bitrates[versionIndex][layerIndex][i];
@ -233,7 +233,7 @@ void MPEG::Header::parse(const ByteVector &data)
// The sample rate index is encoded as two bits in the 3nd byte, i.e. xxxx11xx
i = uchar(data[2]) >> 2 & 0x03;
i = static_cast<unsigned char>(data[2]) >> 2 & 0x03;
d->sampleRate = sampleRates[d->version][i];
@ -245,7 +245,7 @@ void MPEG::Header::parse(const ByteVector &data)
// The channel mode is encoded as a 2 bit value at the end of the 3nd byte,
// i.e. xxxxxx11
d->channelMode = ChannelMode((uchar(data[3]) & 0xC0) >> 6);
d->channelMode = static_cast<ChannelMode>((static_cast<unsigned char>(data[3]) & 0xC0) >> 6);
// TODO: Add mode extension for completeness

View File

@ -222,7 +222,7 @@ ByteVector Ogg::PageHeader::render() const
ByteVector pageSegments = lacingValues();
data.append(char(uchar(pageSegments.size())));
data.append(static_cast<unsigned char>(pageSegments.size()));
data.append(pageSegments);
return data;
@ -263,7 +263,7 @@ void Ogg::PageHeader::read()
// length portion of the page header. After reading the number of page
// segments we'll then read in the corresponding data for this count.
int pageSegmentCount = uchar(data[26]);
int pageSegmentCount = static_cast<unsigned char>(data[26]);
ByteVector pageSegments = d->file->readBlock(pageSegmentCount);
@ -279,10 +279,10 @@ void Ogg::PageHeader::read()
int packetSize = 0;
for(int i = 0; i < pageSegmentCount; i++) {
d->dataSize += uchar(pageSegments[i]);
packetSize += uchar(pageSegments[i]);
d->dataSize += static_cast<unsigned char>(pageSegments[i]);
packetSize += static_cast<unsigned char>(pageSegments[i]);
if(uchar(pageSegments[i]) < 255) {
if(static_cast<unsigned char>(pageSegments[i]) < 255) {
d->packetSizes.append(packetSize);
packetSize = 0;
}
@ -313,10 +313,10 @@ ByteVector Ogg::PageHeader::lacingValues() const
div_t n = div(*it, 255);
for(int i = 0; i < n.quot; i++)
data.append(char(uchar(255)));
data.append(static_cast<unsigned char>(255));
if(it != --sizes.end() || d->lastPacketCompleted)
data.append(char(uchar(n.rem)));
data.append(static_cast<unsigned char>(n.rem));
}
return data;

View File

@ -130,11 +130,11 @@ void Opus::Properties::read(File *file)
uint pos = 8;
// *Version* (8 bits, unsigned)
d->opusVersion = uchar(data.at(pos));
d->opusVersion = static_cast<unsigned char>(data.at(pos));
pos += 1;
// *Output Channel Count* 'C' (8 bits, unsigned)
d->channels = uchar(data.at(pos));
d->channels = static_cast<unsigned char>(data.at(pos));
pos += 1;
// *Pre-skip* (16 bits, unsigned, little endian)

View File

@ -156,7 +156,7 @@ void Vorbis::Properties::read(File *file)
d->vorbisVersion = data.toUInt(pos, false);
pos += 4;
d->channels = uchar(data[pos]);
d->channels = static_cast<unsigned char>(data[pos]);
pos += 1;
d->sampleRate = data.toUInt(pos, false);

View File

@ -186,6 +186,7 @@ void RIFF::AIFF::Properties::read(File *file)
if(data.size() >= 23) {
d->compressionType = data.mid(18, 4);
d->compressionName = String(data.mid(23, static_cast<uchar>(data[22])), String::Latin1);
d->compressionName
= String(data.mid(23, static_cast<unsigned char>(data[22])), String::Latin1);
}
}

View File

@ -40,7 +40,7 @@ namespace TagLib
return false;
for(ByteVector::ConstIterator it = name.begin(); it != name.end(); ++it) {
const uchar c = static_cast<uchar>(*it);
const int c = static_cast<unsigned char>(*it);
if(c < 32 || 127 < c)
return false;
}

View File

@ -110,7 +110,7 @@ bool S3M::File::save()
int channels = 0;
for(int i = 0; i < 32; ++ i) {
uchar setting = 0;
unsigned char setting = 0;
if(!readByte(setting))
return false;
// or if(setting >= 128)?

View File

@ -51,10 +51,10 @@ public:
ushort flags;
ushort trackerVersion;
ushort fileFormatVersion;
uchar globalVolume;
uchar masterVolume;
uchar tempo;
uchar bpmSpeed;
unsigned char globalVolume;
unsigned char masterVolume;
unsigned char tempo;
unsigned char bpmSpeed;
};
S3M::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) :
@ -133,22 +133,22 @@ TagLib::ushort S3M::Properties::fileFormatVersion() const
return d->fileFormatVersion;
}
uchar S3M::Properties::globalVolume() const
unsigned char S3M::Properties::globalVolume() const
{
return d->globalVolume;
}
uchar S3M::Properties::masterVolume() const
unsigned char S3M::Properties::masterVolume() const
{
return d->masterVolume;
}
uchar S3M::Properties::tempo() const
unsigned char S3M::Properties::tempo() const
{
return d->tempo;
}
uchar S3M::Properties::bpmSpeed() const
unsigned char S3M::Properties::bpmSpeed() const
{
return d->bpmSpeed;
}
@ -193,22 +193,22 @@ void S3M::Properties::setFileFormatVersion(ushort fileFormatVersion)
d->fileFormatVersion = fileFormatVersion;
}
void S3M::Properties::setGlobalVolume(uchar globalVolume)
void S3M::Properties::setGlobalVolume(unsigned char globalVolume)
{
d->globalVolume = globalVolume;
}
void S3M::Properties::setMasterVolume(uchar masterVolume)
void S3M::Properties::setMasterVolume(unsigned char masterVolume)
{
d->masterVolume = masterVolume;
}
void S3M::Properties::setTempo(uchar tempo)
void S3M::Properties::setTempo(unsigned char tempo)
{
d->tempo = tempo;
}
void S3M::Properties::setBpmSpeed(uchar bpmSpeed)
void S3M::Properties::setBpmSpeed(unsigned char bpmSpeed)
{
d->bpmSpeed = bpmSpeed;
}

View File

@ -58,10 +58,10 @@ namespace TagLib {
ushort flags() const;
ushort trackerVersion() const;
ushort fileFormatVersion() const;
uchar globalVolume() const;
uchar masterVolume() const;
uchar tempo() const;
uchar bpmSpeed() const;
unsigned char globalVolume() const;
unsigned char masterVolume() const;
unsigned char tempo() const;
unsigned char bpmSpeed() const;
void setChannels(int channels);
@ -72,10 +72,10 @@ namespace TagLib {
void setFlags (ushort flags);
void setTrackerVersion (ushort trackerVersion);
void setFileFormatVersion(ushort fileFormatVersion);
void setGlobalVolume (uchar globalVolume);
void setMasterVolume (uchar masterVolume);
void setTempo (uchar tempo);
void setBpmSpeed (uchar bpmSpeed);
void setGlobalVolume (unsigned char globalVolume);
void setMasterVolume (unsigned char masterVolume);
void setTempo (unsigned char tempo);
void setBpmSpeed (unsigned char bpmSpeed);
private:
Properties(const Properties&);

View File

@ -177,7 +177,7 @@ T toNumber(const ByteVector &v, size_t offset, size_t length, bool mostSignifica
T sum = 0;
for(size_t i = 0; i < length; i++) {
const size_t shift = (mostSignificantByteFirst ? length - 1 - i : i) * 8;
sum |= static_cast<T>(static_cast<uchar>(v[offset + i])) << shift;
sum |= static_cast<T>(static_cast<unsigned char>(v[offset + i])) << shift;
}
return sum;
@ -259,7 +259,7 @@ long double toFloat80(const ByteVector &v, size_t offset)
return 0.0;
}
uchar bytes[10];
unsigned char bytes[10];
::memcpy(bytes, v.data() + offset, 10);
if(ENDIAN == Utils::LittleEndian) {
@ -695,7 +695,7 @@ TagLib::uint ByteVector::checksum() const
{
uint sum = 0;
for(ByteVector::ConstIterator it = begin(); it != end(); ++it)
sum = (sum << 8) ^ crcTable[((sum >> 24) & 0xff) ^ uchar(*it)];
sum = (sum << 8) ^ crcTable[((sum >> 24) & 0xff) ^ static_cast<unsigned char>(*it)];
return sum;
}

View File

@ -133,7 +133,7 @@ namespace
data.resize(length);
for(size_t i = 0; i < length; ++i)
data[i] = static_cast<uchar>(s[i]);
data[i] = static_cast<unsigned char>(s[i]);
}
// Converts a UTF-8 string into UTF-16(without BOM/CPU byte order)
@ -337,7 +337,7 @@ String::String(wchar_t c, Type t) :
}
String::String(char c, Type t) :
d(new StringPrivate(1, static_cast<uchar>(c)))
d(new StringPrivate(1, static_cast<unsigned char>(c)))
{
if(t != Latin1 && t != UTF8) {
debug("String::String() -- char should not contain UTF16.");
@ -661,7 +661,7 @@ bool String::operator==(const char *s) const
const wchar_t *p = toCWString();
while(*p != L'\0' || *s != '\0') {
if(*p++ != static_cast<uchar>(*s++))
if(*p++ != static_cast<unsigned char>(*s++))
return false;
}
return true;
@ -703,7 +703,7 @@ String &String::operator+=(const char *s)
detach();
for(int i = 0; s[i] != 0; i++)
d->data += uchar(s[i]);
d->data += static_cast<unsigned char>(s[i]);
return *this;
}
@ -719,7 +719,7 @@ String &String::operator+=(char c)
{
detach();
d->data += uchar(c);
d->data += static_cast<unsigned char>(c);
return *this;
}

View File

@ -147,10 +147,10 @@ private:
uint m_size;
};
class ByteReader : public ValueReader<uchar>
class ByteReader : public ValueReader<unsigned char>
{
public:
ByteReader(uchar &byte) : ValueReader<uchar>(byte) {}
ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
uint read(TagLib::File &file, uint limit)
{
@ -258,7 +258,7 @@ public:
/*!
* Read a byte into \a byte.
*/
StructReader &byte(uchar &byte)
StructReader &byte(unsigned char &byte)
{
m_readers.append(new ByteReader(byte));
return *this;
@ -553,7 +553,7 @@ void XM::File::read(bool)
READ_U32L_AS(patternHeaderLength);
READ_ASSERT(patternHeaderLength >= 4);
uchar packingType = 0;
unsigned char packingType = 0;
ushort rowCount = 0;
ushort dataSize = 0;
StructReader pattern;
@ -575,7 +575,7 @@ void XM::File::read(bool)
READ_ASSERT(instrumentHeaderSize >= 4);
String instrumentName;
uchar instrumentType = 0;
unsigned char instrumentType = 0;
ushort sampleCount = 0;
StructReader instrument;
@ -598,12 +598,12 @@ void XM::File::read(bool)
ulong sampleLength = 0;
ulong loopStart = 0;
ulong loopLength = 0;
uchar volume = 0;
uchar finetune = 0;
uchar sampleType = 0;
uchar panning = 0;
uchar noteNumber = 0;
uchar compression = 0;
unsigned char volume = 0;
unsigned char finetune = 0;
unsigned char sampleType = 0;
unsigned char panning = 0;
unsigned char noteNumber = 0;
unsigned char compression = 0;
String sampleName;
StructReader sample;
sample.u32L(sampleLength)

View File

@ -211,12 +211,12 @@ public:
CPPUNIT_ASSERT_EQUAL((unsigned short)0xFF01, ByteVector("\xFF\x01", 2).toUShort());
CPPUNIT_ASSERT_EQUAL((unsigned short)0x01FF, ByteVector("\xFF\x01", 2).toUShort(false));
const uchar PI32LE[] = { 0x00, 0xdb, 0x0f, 0x49, 0x40 };
const uchar PI32BE[] = { 0x00, 0x40, 0x49, 0x0f, 0xdb };
const uchar PI64LE[] = { 0x00, 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40 };
const uchar PI64BE[] = { 0x00, 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18 };
const uchar PI80LE[] = { 0x00, 0x00, 0xc0, 0x68, 0x21, 0xa2, 0xda, 0x0f, 0xc9, 0x00, 0x40 };
const uchar PI80BE[] = { 0x00, 0x40, 0x00, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc0, 0x00 };
const unsigned char PI32LE[] = { 0x00, 0xdb, 0x0f, 0x49, 0x40 };
const unsigned char PI32BE[] = { 0x00, 0x40, 0x49, 0x0f, 0xdb };
const unsigned char PI64LE[] = { 0x00, 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40 };
const unsigned char PI64BE[] = { 0x00, 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18 };
const unsigned char PI80LE[] = { 0x00, 0x00, 0xc0, 0x68, 0x21, 0xa2, 0xda, 0x0f, 0xc9, 0x00, 0x40 };
const unsigned char PI80BE[] = { 0x00, 0x40, 0x00, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc0, 0x00 };
ByteVector pi32le(reinterpret_cast<const char*>(PI32LE), 5);
CPPUNIT_ASSERT_EQUAL(31415, static_cast<int>(pi32le.toFloat32LE(1) * 10000));

View File

@ -338,7 +338,7 @@ public:
CPPUNIT_ASSERT_EQUAL(String("ident"), f.identification());
CPPUNIT_ASSERT_EQUAL(15.0f / 512.0f,
f.volumeAdjustment(ID3v2::RelativeVolumeFrame::FrontRight));
CPPUNIT_ASSERT_EQUAL((uchar)8,
CPPUNIT_ASSERT_EQUAL((unsigned char)8,
f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).bitsRepresentingPeak);
CPPUNIT_ASSERT_EQUAL(ByteVector("\x45"),
f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).peakVolume);

View File

@ -116,12 +116,12 @@ private:
CPPUNIT_ASSERT_EQUAL((TagLib::ushort)535, p->version());
CPPUNIT_ASSERT_EQUAL((TagLib::ushort)532, p->compatibleVersion());
CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 9, p->flags());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar)128, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 48, p->mixVolume());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar)125, p->tempo());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 6, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar)128, p->panningSeparation());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 0, p->pitchWheelDepth());
CPPUNIT_ASSERT_EQUAL((unsigned char)128, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->mixVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
CPPUNIT_ASSERT_EQUAL((unsigned char) 6, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL((unsigned char)128, p->panningSeparation());
CPPUNIT_ASSERT_EQUAL((unsigned char) 0, p->pitchWheelDepth());
CPPUNIT_ASSERT_EQUAL(title, t->title());
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
CPPUNIT_ASSERT_EQUAL(String(), t->album());

View File

@ -111,7 +111,7 @@ private:
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
CPPUNIT_ASSERT_EQUAL(8, p->channels());
CPPUNIT_ASSERT_EQUAL(31U, p->instrumentCount());
CPPUNIT_ASSERT_EQUAL((uchar)1, p->lengthInPatterns());
CPPUNIT_ASSERT_EQUAL((unsigned char)1, p->lengthInPatterns());
CPPUNIT_ASSERT_EQUAL(title, t->title());
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
CPPUNIT_ASSERT_EQUAL(String(), t->album());

View File

@ -105,10 +105,10 @@ private:
CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 0, p->flags());
CPPUNIT_ASSERT_EQUAL((TagLib::ushort)4896, p->trackerVersion());
CPPUNIT_ASSERT_EQUAL((TagLib::ushort) 2, p->fileFormatVersion());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 64, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 48, p->masterVolume());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar)125, p->tempo());
CPPUNIT_ASSERT_EQUAL((TagLib::uchar) 6, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL((unsigned char) 64, p->globalVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->masterVolume());
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
CPPUNIT_ASSERT_EQUAL((unsigned char) 6, p->bpmSpeed());
CPPUNIT_ASSERT_EQUAL(title, t->title());
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
CPPUNIT_ASSERT_EQUAL(String(), t->album());