]> granicus.if.org Git - taglib/commitdiff
Use a standard type rather than TagLib::ulonglong.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 2 Dec 2015 00:13:10 +0000 (09:13 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 2 Dec 2015 00:13:10 +0000 (09:13 +0900)
TagLib::ulonglong is not used in the public headers, so the changes are trivial.

taglib/flac/flacproperties.cpp
taglib/riff/rifffile.cpp
taglib/toolkit/tbytevector.cpp
taglib/toolkit/tutils.h

index efc9fa1b4a5a322b2cbe827e0ce75d59f192eb9e..9f0f92566d08de78e61043607f778cb7c3a5feee 100644 (file)
@@ -159,8 +159,8 @@ void FLAC::Properties::read(const ByteVector &data, long streamLength)
   // The last 4 bits are the most significant 4 bits for the 36 bit
   // stream length in samples. (Audio files measured in days)
 
-  const ulonglong hi = flags & 0xf;
-  const ulonglong lo = data.toUInt(pos, true);
+  const unsigned long long hi = flags & 0xf;
+  const unsigned long long lo = data.toUInt(pos, true);
   pos += 4;
 
   d->sampleFrames = (hi << 32) | lo;
index 1d834b04d696c625503aa82c252b1fbcc591a426..8317a57e26abe46831c363cff62d316a58fe826d 100644 (file)
@@ -252,7 +252,7 @@ void RIFF::File::read()
       break;
     }
 
-    if(static_cast<ulonglong>(tell()) + chunkSize > static_cast<ulonglong>(length())) {
+    if(static_cast<long long>(tell()) + chunkSize > length()) {
       debug("RIFF::File::read() -- Chunk '" + chunkName + "' has invalid size (larger than the file size)");
       setValid(false);
       break;
@@ -278,8 +278,8 @@ void RIFF::File::read()
         chunk.padding = 1;
       }
     }
-    d->chunks.push_back(chunk);
 
+    d->chunks.push_back(chunk);
   }
 }
 
index c65962dabf54deb9c29c93518e4b7cf85de21204..909a2aae2781aadc0ca1e0c280f0deaa7d9e5926 100644 (file)
@@ -277,15 +277,15 @@ long double toFloat80(const ByteVector &v, size_t offset)
   const int exponent = ((bytes[0] & 0x7F) << 8) | bytes[1];
 
   // 64-bit fraction. Leading 1 is explicit.
-  const ulonglong fraction
-    = (static_cast<ulonglong>(bytes[2]) << 56)
-    | (static_cast<ulonglong>(bytes[3]) << 48)
-    | (static_cast<ulonglong>(bytes[4]) << 40)
-    | (static_cast<ulonglong>(bytes[5]) << 32)
-    | (static_cast<ulonglong>(bytes[6]) << 24)
-    | (static_cast<ulonglong>(bytes[7]) << 16)
-    | (static_cast<ulonglong>(bytes[8]) <<  8)
-    | (static_cast<ulonglong>(bytes[9]));
+  const unsigned long long fraction
+    = (static_cast<unsigned long long>(bytes[2]) << 56)
+    | (static_cast<unsigned long long>(bytes[3]) << 48)
+    | (static_cast<unsigned long long>(bytes[4]) << 40)
+    | (static_cast<unsigned long long>(bytes[5]) << 32)
+    | (static_cast<unsigned long long>(bytes[6]) << 24)
+    | (static_cast<unsigned long long>(bytes[7]) << 16)
+    | (static_cast<unsigned long long>(bytes[8]) <<  8)
+    | (static_cast<unsigned long long>(bytes[9]));
 
   long double val;
   if(exponent == 0 && fraction == 0)
@@ -384,12 +384,12 @@ ByteVector ByteVector::fromFloat32BE(float value)
 
 ByteVector ByteVector::fromFloat64LE(double value)
 {
-  return fromFloat<double, ulonglong, Utils::LittleEndian>(value);
+  return fromFloat<double, unsigned long long, Utils::LittleEndian>(value);
 }
 
 ByteVector ByteVector::fromFloat64BE(double value)
 {
-  return fromFloat<double, ulonglong, Utils::BigEndian>(value);
+  return fromFloat<double, unsigned long long, Utils::BigEndian>(value);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -756,12 +756,12 @@ float ByteVector::toFloat32BE(size_t offset) const
 
 double ByteVector::toFloat64LE(size_t offset) const
 {
-  return toFloat<double, ulonglong, Utils::LittleEndian>(*this, offset);
+  return toFloat<double, unsigned long long, Utils::LittleEndian>(*this, offset);
 }
 
 double ByteVector::toFloat64BE(size_t offset) const
 {
-  return toFloat<double, ulonglong, Utils::BigEndian>(*this, offset);
+  return toFloat<double, unsigned long long, Utils::BigEndian>(*this, offset);
 }
 
 long double ByteVector::toFloat80LE(size_t offset) const
index 0655342a31ab173228df488ef3852003a3acbc0f..9855ed91b2286e76c4da6cb11ba88c5b2dd7ad98 100644 (file)
@@ -134,7 +134,7 @@ namespace TagLib
     /*!
      * Reverses the order of bytes in an 64-bit integer.
      */
-    inline ulonglong byteSwap(ulonglong x)
+    inline unsigned long long byteSwap(unsigned long long x)
     {
 #if defined(HAVE_BOOST_BYTESWAP)