]> granicus.if.org Git - taglib/commitdiff
Use a standard type rather than TagLib::uchar.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 2 Dec 2015 09:11:52 +0000 (18:11 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 2 Dec 2015 09:11:52 +0000 (18:11 +0900)
This won't break the ABI compatibility.

32 files changed:
taglib/it/itproperties.cpp
taglib/it/itproperties.h
taglib/mod/modfilebase.cpp
taglib/mod/modfilebase.h
taglib/mod/modfileprivate.h
taglib/mod/modproperties.cpp
taglib/mod/modproperties.h
taglib/mp4/mp4item.cpp
taglib/mp4/mp4item.h
taglib/mp4/mp4tag.cpp
taglib/mpeg/id3v1/id3v1tag.cpp
taglib/mpeg/id3v2/frames/eventtimingcodesframe.cpp
taglib/mpeg/id3v2/id3v2header.cpp
taglib/mpeg/id3v2/id3v2synchdata.cpp
taglib/mpeg/mpegfile.cpp
taglib/mpeg/mpegheader.cpp
taglib/ogg/oggpageheader.cpp
taglib/ogg/opus/opusproperties.cpp
taglib/ogg/vorbis/vorbisproperties.cpp
taglib/riff/aiff/aiffproperties.cpp
taglib/riff/riffutils.h
taglib/s3m/s3mfile.cpp
taglib/s3m/s3mproperties.cpp
taglib/s3m/s3mproperties.h
taglib/toolkit/tbytevector.cpp
taglib/toolkit/tstring.cpp
taglib/xm/xmfile.cpp
tests/test_bytevector.cpp
tests/test_id3v2.cpp
tests/test_it.cpp
tests/test_mod.cpp
tests/test_s3m.cpp

index 0359533de7642a766e906fe65bc595876f5b6210..8b1fc43c02f45ecdb93cf9f12144a8b436734268 100644 (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;
 }
index 060ad358f8e638ca1543381c00ab103faecd1df4..e2da6e66d0acdee64cd9585ada52336eee3a367b 100644 (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&);
index e074dac855c02aca6c63b1854461ebaa22ac0259..a73e9367f9835d8e2d6a36168ee3cd72c092c843 100644 (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;
index 383bde11898779d1c705cb437e2f58caaf67393c..8b483d3820c60c2d0a6e680a53abb72210e78359 100644 (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);
index 19a300199053289ceea23cee55b22994f312657a..7aa52db1fa4a2dae62813d174e4ce26a6b36ec3d 100644 (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)
index db5a98e2748b53ddcf931e18d399db4fd205a882..86fa38459255c069722903145d5a2d3e9c107f42 100644 (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;
 }
index ac4bf7f37bcb343d0cb9ffd142b8557213fada91..cf0f9e7b45fa648085a5a50672c867f0af570575 100644 (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;
index d36e52008f264c996af0d75eaac9acf8cae19009..f7edbb55b5fb3ffc2c0f83a937d23a0e76b735c3 100644 (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;
index 38b6c25ee1937068e21d2a789d0a37d667eb2013..63fc93bd6e7aceaff7fcf6baa4030a59b6a8a3cb 100644 (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;
index 842191969822aa3804a2ca9788274cddba91c37f..6ad75a87fdd2e5a731efef47a3ab5d06559ce51f 100644 (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)));
   }
 }
 
index dd32326f2272f7c18385bdf8ae9ff4ef6c27e1b5..1ca297e25d915e0dc69d6d7cd1c154816c2706ff 100644 (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]);
 }
index 70214badbb44c3777d4cacbf915f147bf1ebb90f..6a3f7d2652896f727d6755dd8f95663492b8b028 100644 (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));
index 6e567193612e3f74813a1302696da18c28893a5d..69d700eee3a240d1445cf7e22fc43a3d6b6b4b54 100644 (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;
index 4acfd914797e92fc63f6a697999829849dc3e4ea..03767371075ba93a43fa9a4cb9f2f63cd17560eb 100644 (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;
 }
index 523f804c36a6097f9d447b38e4b73218e3a6bd0a..adf7a850bc194288c5e947e36c9eccad785e43ab 100644 (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);
   }
index 0c9a0f1c928039d64208e77517bf7954102c1b1e..01cc6c57bd8d66ac2d1079f466506fe877b45338 100644 (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
 
index b933313548dc9bf5e94fab8ef0d8c0eca154250c..54c6c2597a36c7a4c22d273431f93178c1b3d9a9 100644 (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;
index c8aff624632a145c2e2e9902df887d6b53e8c4b8..365658f8b16f2df791818bcdf0a7605372838e17 100644 (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)
index d9dfc0a89e916607664b0868b7590d5a59e0efeb..cef0b39563d6bdaa51f1fc2fe9471738ffef5ddb 100644 (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);
index f074fae3365a45e7ddd3a33b6e836beb5621b170..020ac6cf78ce7a9667f346f78f82fc7127752f6f 100644 (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);
   }
 }
index c9270dff6b07bb01e74c86b407ca69bc9ed73165..42977efe989682ee7f1e4bd05b2cfe3570ad0b38 100644 (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;
       }
index f15d740b6a270ae8400598c9bd1b8e3c28e84fdc..c83e09d7f07d8a7de2bf1a4d7251798591cb4018 100644 (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)?
index 6f93eec350e7946b600b9bb18a1637b351a60aa2..de2d1ebe5208b6b13d48a2ac6c9ba8e08e118915 100644 (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;
 }
index 4499627f72040053fd2b023308fcc00704db7dc9..f77d22040f6691ed571d107b19e0b45a116182b8 100644 (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&);
index fbdc8b7c7345894bb159ad8a58cd837b4730eaf0..71bcb43ac65c33e0ad6158729dad9627af185bed 100644 (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;
 }
 
index 9d68a23f4960dc4b70607b244144421206703ad3..f9884da70ed4f82b694f8f16d6519b7f7fb14bf4 100644 (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;
 }
 
index 5919abace70394cf567dcb5ea446598c1f93d713..fc337ba4f0bcab211b78504b4d22684321a57095 100644 (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)
index 2848c6ce9359598cd69452ba1c711fd6177e0f78..5d82fedb079322e16336f809f7ae6ccba0d5e797 100644 (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));
index c6592bbea3bb7de2986698183aa7c665ed760502..b6257e8cddd1c78d7deeb7feac67a83e0e25bfdf 100644 (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);
index 3270eb25b3ac720c4ef308df42e0d3bd40533ad6..7bb9084b91d05c34b99943afe7989c8f7206b764 100644 (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());
index c62a870ba0e857d0eb74df8d04dda2a48ce6363f..b150c7fb5e2d82babc6d7592b53b434725a09360 100644 (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());
index 997c565328f85a1ee2fd294823961a6bc19c1a22..41579d3c60ec6b9e4ed8b4ec273ce5922651c06a 100644 (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());