From 8fbde82686a5183d1b6e9c98e677f4961fb1b11c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 13 Feb 2015 11:55:40 +0100 Subject: Fix MSVC 2013/64bit warnings about conversion from 'size_t' to 'int'. tools\qstring.cpp(243) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(287) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(292) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(305) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(312) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data Change-Id: I20b92b0783f4859e9da83364b4ec86dd8bbd1c4c Reviewed-by: Kai Koehne --- src/corelib/io/qdebug.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 7b49505228..f55f68f9b3 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -285,12 +285,12 @@ void QDebug::putString(const QChar *begin, size_t length) if (stream->testFlag(Stream::NoQuotes)) { // no quotes, write the string directly too (no pretty-printing) // this respects the QTextStream state, though - stream->ts.d_ptr->putString(begin, length); + stream->ts.d_ptr->putString(begin, int(length)); } else { // we'll reset the QTextStream formatting mechanisms, so save the state QDebugStateSaver saver(*this); stream->ts.d_ptr->params.reset(); - putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast(begin), length); + putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast(begin), int(length)); } } @@ -303,14 +303,14 @@ void QDebug::putByteArray(const char *begin, size_t length, Latin1Content conten if (stream->testFlag(Stream::NoQuotes)) { // no quotes, write the string directly too (no pretty-printing) // this respects the QTextStream state, though - QString string = content == ContainsLatin1 ? QString::fromLatin1(begin, length) : QString::fromUtf8(begin, length); + QString string = content == ContainsLatin1 ? QString::fromLatin1(begin, int(length)) : QString::fromUtf8(begin, int(length)); stream->ts.d_ptr->putString(string); } else { // we'll reset the QTextStream formatting mechanisms, so save the state QDebugStateSaver saver(*this); stream->ts.d_ptr->params.reset(); putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast(begin), - length, content == ContainsLatin1); + int(length), content == ContainsLatin1); } } -- cgit v1.2.3