summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-07-27 19:01:15 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-28 13:16:50 +0200
commit404126d578ee351ec42856e351412d20ff5faf0b (patch)
tree7be28bfdd0ee30e5ef60bab91f383a1cb35cc5f9 /src/corelib/tools/qstring.cpp
parent4f59b5b5308011fdc4bb08bc179d5298077fd9ad (diff)
Get rid of compiler warnings with MSVC
Change-Id: Ibd027c502a5b8bcbfc6dae71c4f244f1080d4064 Reviewed-on: http://codereview.qt.nokia.com/2303 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 9e238193a3..9ce5eead8c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1267,10 +1267,10 @@ void QString::resize(int size)
QString::free(d);
d = x;
} else {
- if (d->ref != 1 || size > d->alloc ||
- (!d->capacityReserved && size < d->size && size < d->alloc >> 1))
+ if (d->ref != 1 || size > int(d->alloc) ||
+ (!d->capacityReserved && size < d->size && size < int(d->alloc) >> 1))
realloc(grow(size));
- if (d->alloc >= size) {
+ if (int(d->alloc) >= size) {
d->size = size;
d->data()[size] = '\0';
}
@@ -1560,7 +1560,7 @@ QString &QString::append(const QString &str)
if (d == &shared_null.str) {
operator=(str);
} else {
- if (d->ref != 1 || d->size + str.d->size > d->alloc)
+ if (d->ref != 1 || d->size + str.d->size > int(d->alloc))
realloc(grow(d->size + str.d->size));
memcpy(d->data() + d->size, str.d->data(), str.d->size * sizeof(QChar));
d->size += str.d->size;
@@ -1580,7 +1580,7 @@ QString &QString::append(const QLatin1String &str)
const uchar *s = (const uchar *)str.latin1();
if (s) {
int len = qstrlen((char *)s);
- if (d->ref != 1 || d->size + len > d->alloc)
+ if (d->ref != 1 || d->size + len > int(d->alloc))
realloc(grow(d->size + len));
ushort *i = d->data() + d->size;
while ((*i++ = *s++))
@@ -1623,7 +1623,7 @@ QString &QString::append(const QLatin1String &str)
*/
QString &QString::append(QChar ch)
{
- if (d->ref != 1 || d->size + 1 > d->alloc)
+ if (d->ref != 1 || d->size + 1 > int(d->alloc))
realloc(grow(d->size + 1));
d->data()[d->size++] = ch.unicode();
d->data()[d->size] = '\0';
@@ -3550,8 +3550,8 @@ static QByteArray toLatin1_helper(const QChar *data, int length)
const __m128i questionMark = _mm_set1_epi16('?');
// SSE has no compare instruction for unsigned comparison.
// The variables must be shiffted + 0x8000 to be compared
- const __m128i signedBitOffset = _mm_set1_epi16(0x8000);
- const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000);
+ const __m128i signedBitOffset = _mm_set1_epi16(short(0x8000));
+ const __m128i thresholdMask = _mm_set1_epi16(short(0xff + 0x8000));
for (int i = 0; i < chunkCount; ++i) {
__m128i chunk1 = _mm_loadu_si128((__m128i*)src); // load
src += 8;
@@ -6152,7 +6152,7 @@ QString QString::repeated(int times) const
QString result;
result.reserve(resultSize);
- if (result.d->alloc != resultSize)
+ if (int(result.d->alloc) != resultSize)
return QString(); // not enough memory
memcpy(result.d->data(), d->data(), d->size * sizeof(ushort));