]> granicus.if.org Git - taglib/commitdiff
Fix warnings with VS2010
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 23 Aug 2012 11:54:18 +0000 (20:54 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 23 Aug 2012 11:54:18 +0000 (20:54 +0900)
taglib/asf/asffile.cpp
taglib/flac/flacfile.cpp
taglib/it/itfile.cpp
taglib/mpc/mpcproperties.cpp
taglib/mpeg/id3v2/id3v2tag.cpp
taglib/mpeg/mpegproperties.cpp
taglib/ogg/flac/oggflacfile.cpp
taglib/ogg/vorbis/vorbisproperties.cpp
taglib/riff/aiff/aiffproperties.cpp
taglib/toolkit/tstring.cpp
taglib/toolkit/unicode.cpp

index e2823c7e98affb9f829b2bccaed86d15a2bdb0ff..455631f82f620486a7f5ee7ebe0f066036471630 100644 (file)
@@ -348,7 +348,7 @@ void ASF::File::HeaderExtensionObject::parse(ASF::File *file, uint /*size*/)
     else {
       obj = new UnknownObject(guid);
     }
-    obj->parse(file, size);
+    obj->parse(file, (unsigned int)size);
     objects.append(obj);
     dataPos += size;
   }
@@ -535,7 +535,7 @@ bool ASF::File::save()
     data.append(d->objects[i]->render(this));
   }
   data = headerGuid + ByteVector::fromLongLong(data.size() + 30, false) + ByteVector::fromUInt(d->objects.size(), false) + ByteVector("\x01\x02", 2) + data;
-  insert(data, 0, d->size);
+  insert(data, 0, (TagLib::ulong)d->size);
 
   return true;
 }
index 79acb5394fff868ecc228d35188a3c23a8b0b16b..a02770a8bd8cfdae7e5042ed80bf67d458432d16 100644 (file)
@@ -243,7 +243,7 @@ bool FLAC::File::save()
   }
   ByteVector padding = ByteVector::fromUInt(paddingLength);
   padding.resize(paddingLength + 4);
-  padding[0] = FLAC::MetadataBlock::Padding | LastBlockFlag;
+  padding[0] = (char)(FLAC::MetadataBlock::Padding | LastBlockFlag);
   data.append(padding);
 
   // Write the data to the file
index 51b57b0ce86c6a64a8e368f7df62f38edec6d207..4e049518edb9902c58c218cbadf99c52a9be66b8 100644 (file)
@@ -128,7 +128,7 @@ bool IT::File::save()
 
     seek(sampleOffset + 20);
 
-    if((i + instrumentCount) < lines.size())
+    if((TagLib::uint)(i + instrumentCount) < lines.size())
       writeString(lines[i + instrumentCount], 25);
     else
       writeString(String::null, 25);
index 7046db99742e4e584a3150e537d78b1eaea56898..65d2541fb38e329fc3bcbd059c3b00fad0573c38 100644 (file)
@@ -214,7 +214,7 @@ void MPC::Properties::readSV8(File *file)
       d->channels = flags[7] * 8 + flags[6] * 4 + flags[5] * 2 + flags[4] + 1;
 
       if((d->sampleFrames - begSilence) != 0)
-        d->bitrate = d->streamLength * 8.0 * d->sampleRate / (d->sampleFrames - begSilence);
+        d->bitrate = (int)(d->streamLength * 8.0 * d->sampleRate / (d->sampleFrames - begSilence));
       d->bitrate = d->bitrate / 1000;
 
       d->length = (d->sampleFrames - begSilence) / d->sampleRate;
index 8b623f826703d23b00c07984206dcb416f93981d..ffb0189cebc64c4552bdd0f405cac06501c836df 100644 (file)
@@ -676,8 +676,9 @@ void ID3v2::Tag::parse(const ByteVector &origData)
     // portion of the frame data.
 
     if(data.at(frameDataPosition) == 0) {
-      if(d->header.footerPresent())
+      if(d->header.footerPresent()) {
         debug("Padding *and* a footer found.  This is not allowed by the spec.");
+      }
 
       d->paddingSize = frameDataLength - frameDataPosition;
       return;
index 028ee0615348d9234f746fca4de6ce4099d899d3..3af956643b3476aa324a3b4a05e7342cf015587d 100644 (file)
@@ -221,7 +221,7 @@ void MPEG::Properties::read()
       double length = timePerFrame * d->xingHeader->totalFrames();
 
       d->length = int(length);
-      d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / length / 1000 : 0;
+      d->bitrate = d->length > 0 ? (int)(d->xingHeader->totalSize() * 8 / length / 1000) : 0;
   }
   else {
     // Since there was no valid Xing header found, we hope that we're in a constant
index 3addbffaa9b19760f7cd9a2df6c7954a8db0306b..9d9c303d7c079334bb672ebb5f972639fe1d9979 100644 (file)
@@ -263,9 +263,9 @@ void Ogg::FLAC::File::scan()
       d->hasXiphComment = true;
       d->commentPacket = ipacket;
     }
-    else if(blockType > 5)
+    else if(blockType > 5) {
       debug("Ogg::FLAC::File::scan() -- Unknown metadata block");
-
+    }
   }
 
   // End of metadata, now comes the datastream
index 6de6a5998f96b5172a76191373a3279d69a6efd5..c67e16773e5372e48faef033a671f9f3c4dc9286 100644 (file)
@@ -173,7 +173,7 @@ void Vorbis::Properties::read()
     long long end = last->absoluteGranularPosition();
 
     if(start >= 0 && end >= 0 && d->sampleRate > 0)
-      d->length = (end - start) / (long long) d->sampleRate;
+      d->length = (int)((end - start) / (long long) d->sampleRate);
     else
       debug("Vorbis::Properties::read() -- Either the PCM values for the start or "
             "end of this file was incorrect or the sample rate is zero.");
index c78f0cbae1a3637b54fd6c1aaacf1e7ac3e98086..3ea275825d63fb49faac696f480ef8d44640dfec 100644 (file)
@@ -154,7 +154,7 @@ void RIFF::AIFF::Properties::read(const ByteVector &data)
   d->sampleFrames   = data.mid(2, 4).toUInt();
   d->sampleWidth    = data.mid(6, 2).toShort();
   double sampleRate = ConvertFromIeeeExtended(reinterpret_cast<unsigned char *>(data.mid(8, 10).data()));
-  d->sampleRate     = sampleRate;
-  d->bitrate        = (sampleRate * d->sampleWidth * d->channels) / 1000.0;
+  d->sampleRate     = (int)sampleRate;
+  d->bitrate        = (int)((sampleRate * d->sampleWidth * d->channels) / 1000.0);
   d->length         = d->sampleRate > 0 ? d->sampleFrames / d->sampleRate : 0;
 }
index f99d1c371ede5603c47a9e316404bc6abdd5c610..d0ff9a71f97226e4579824c422baa2b03089b2b2 100644 (file)
@@ -233,8 +233,9 @@ std::string String::to8Bit(bool unicode) const
                                 &target, targetBuffer + outputBufferSize,
                                 Unicode::lenientConversion);
 
-  if(result != Unicode::conversionOK)
+  if(result != Unicode::conversionOK) {
     debug("String::to8Bit() - Unicode conversion error.");
+  }
 
   int newSize = target - targetBuffer;
   s.resize(newSize);
@@ -779,9 +780,9 @@ void String::prepare(Type t)
                                   &target, targetBuffer + bufferSize,
                                   Unicode::lenientConversion);
 
-    if(result != Unicode::conversionOK)
+    if(result != Unicode::conversionOK) {
       debug("String::prepare() - Unicode conversion error.");
-
+    }
 
     int newSize = target != targetBuffer ? target - targetBuffer - 1 : 0;
     d->data.resize(newSize);
index b60264d91b8afaf8958e277d2c43d89be381207a..1b26977e526c5d414df4a4b44ccbbef3e881e9b9 100644 (file)
@@ -155,7 +155,7 @@ ConversionResult ConvertUTF16toUTF8 (
                        case 4: *--target = (ch | byteMark) & byteMask; ch >>= 6;
                        case 3: *--target = (ch | byteMark) & byteMask; ch >>= 6;
                        case 2: *--target = (ch | byteMark) & byteMask; ch >>= 6;
-                       case 1: *--target =  ch | firstByteMark[bytesToWrite];
+                       case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
                }
                target += bytesToWrite;
        }
@@ -253,7 +253,7 @@ ConversionResult ConvertUTF8toUTF16 (
                                result = sourceIllegal;
                                break;
                        } else {
-                           *target++ = ch;     /* normal case */
+                           *target++ = (UTF16)ch;      /* normal case */
                        }
                } else if (ch > UNI_MAX_UTF16) {
                        if (flags == strictConversion) {
@@ -270,7 +270,7 @@ ConversionResult ConvertUTF8toUTF16 (
                                result = targetExhausted; break;
                        }
                        ch -= halfBase;
-                       *target++ = (ch >> halfShift) + UNI_SUR_HIGH_START;
+                       *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
                        *target++ = (ch & halfMask) + UNI_SUR_LOW_START;
                }
        }