summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-07-21 10:27:25 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-21 10:53:26 +0200
commit6a818cffe2ec775f8cab68af7249bc41b44a765b (patch)
treef2053a392af52b90e76636a79dac5592b912e3e1
parent41f9e765f593787cbe05f836c0a9ec8a8471e79d (diff)
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 <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
-rw-r--r--src/corelib/tools/qstring.h6
1 files changed, 3 insertions, 3 deletions
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<Data *>(&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<const QChar *>(autf16), asize); }
inline QCharRef QString::operator[](int i)