Suppress MSVC warnings about narrowing conversions.

This commit is contained in:
Tsuda Kageyu 2016-10-31 01:03:33 +09:00
parent f355110d18
commit 28470221c0
7 changed files with 11 additions and 11 deletions

View File

@ -73,7 +73,7 @@ namespace TagLib
inline String readString(File *file, int length)
{
ByteVector data = file->readBlock(length);
unsigned int size = data.size();
size_t size = data.size();
while (size >= 2) {
if(data[size - 1] != '\0' || data[size - 2] != '\0') {
break;

View File

@ -119,7 +119,7 @@ namespace
return file;
#ifdef _WIN32
const String s = toFileName(arg).toString();
const String s(toFileName(arg).wstr());
#else
const String s(toFileName(arg));
#endif

View File

@ -132,9 +132,9 @@ Ogg::Page::ContainsPacketFlags Ogg::Page::containsPacket(int index) const
return flags;
}
size_t Ogg::Page::packetCount() const
unsigned int Ogg::Page::packetCount() const
{
return d->header.packetSizes().size();
return static_cast<unsigned int>(d->header.packetSizes().size());
}
ByteVectorList Ogg::Page::packets() const

View File

@ -138,7 +138,7 @@ namespace TagLib {
/*!
* Returns the number of packets (whole or partial) in this page.
*/
size_t packetCount() const;
unsigned int packetCount() const;
/*!
* Returns a list of the packets in this page.

View File

@ -184,7 +184,7 @@ void RIFF::File::setChunkData(unsigned int i, const ByteVector &data)
writeChunk(it->name, data, it->offset - 8, it->size + it->padding + 8);
it->size = data.size();
it->size = static_cast<unsigned int>(data.size());
it->padding = data.size() % 2;
const long long diff = static_cast<long long>(it->size) + it->padding - originalSize;
@ -253,7 +253,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
Chunk chunk;
chunk.name = name;
chunk.size = data.size();
chunk.size = static_cast<unsigned int>(data.size());
chunk.offset = offset + 8;
chunk.padding = data.size() % 2;

View File

@ -115,9 +115,9 @@ ByteVector zlib::decompress(const ByteVector &data)
std::streamsize write(char const* s, std::streamsize n)
{
const unsigned int originalSize = data.size();
const size_t originalSize = data.size();
data.resize(static_cast<unsigned int>(originalSize + n));
data.resize(static_cast<size_t>(originalSize + n));
::memcpy(data.data() + originalSize, s, static_cast<size_t>(n));
return n;

View File

@ -133,8 +133,8 @@ namespace
{
ByteVector data = file.readBlock(std::min(m_size, limit));
size_t count = data.size();
int index = data.find((char) 0);
if(index > -1) {
size_t index = data.find('\0');
if(index != ByteVector::npos()) {
data.resize(index);
}
data.replace('\xff', ' ');