From 6a818cffe2ec775f8cab68af7249bc41b44a765b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 21 Jul 2011 10:27:25 +0200 Subject: Fix more use of C style cast. Commit 77ed8787ac9ef0f74c2ab6699af3fec434e433e5 was not enough Fix the test tst_Moc::oldStyleCasts() Change-Id: Ia2f98f4e02ba512c3f7fd7cd09b692a1aabd8de0 Reviewed-on: http://codereview.qt.nokia.com/1927 Reviewed-by: Qt Sanity Bot Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qstring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 28c2932e96..af3e3f3ff9 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -337,7 +337,7 @@ public: inline QString &prepend(const QLatin1String &s) { return insert(0, s); } inline QString &operator+=(QChar c) { - if (d->ref != 1 || d->size + 1 > (int)d->alloc) + if (d->ref != 1 || d->size + 1 > int(d->alloc)) realloc(grow(d->size + 1)); d->data()[d->size++] = c.unicode(); d->data()[d->size] = '\0'; @@ -633,7 +633,7 @@ public: class Q_CORE_EXPORT QLatin1String { public: - inline explicit QLatin1String(const char *s) : m_size(s ? (int)strlen(s) : 0), m_data(s) {} + inline explicit QLatin1String(const char *s) : m_size(s ? int(strlen(s)) : 0), m_data(s) {} inline const char *latin1() const { return m_data; } inline int size() const { return m_size; } @@ -842,7 +842,7 @@ inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); } inline QString::QString() : d(const_cast(&shared_null.str)) {} inline QString::~QString() { if (!d->ref.deref()) free(d); } -inline void QString::reserve(int asize) { if (d->ref != 1 || asize > (int)d->alloc) realloc(asize); d->capacityReserved = true;} +inline void QString::reserve(int asize) { if (d->ref != 1 || asize > int(d->alloc)) realloc(asize); d->capacityReserved = true;} inline QString &QString::setUtf16(const ushort *autf16, int asize) { return setUnicode(reinterpret_cast(autf16), asize); } inline QCharRef QString::operator[](int i) -- cgit v1.2.3