Fixes warnings
authorOlivier Goffart <olivier.goffart@nokia.com>
Wed, 27 Apr 2011 16:29:27 +0000 (18:29 +0200)
committerOlivier Goffart <olivier.goffart@nokia.com>
Tue, 10 May 2011 10:54:51 +0000 (12:54 +0200)
In QString, it would comlain that:
   assuming signed overflow does not occur when assuming that (X - c) > X is always false
Changing to unsigned comparison fix the warning

Others are about unused variables

Reviewed-by: Thiago
(cherry picked from commit 5e5485809e8c6f8339bb9f19ad71ed623a8b23c7)

src/corelib/io/qfilesystemengine_unix.cpp
src/corelib/tools/qlocale.cpp
src/corelib/tools/qstring.h

index c9ebaa4..742b05e 100644 (file)
@@ -356,6 +356,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
         const QByteArray &path = entry.nativeFilePath();
         nativeFilePath = path.constData();
         nativeFilePathLength = path.size();
+        Q_UNUSED(nativeFilePathLength);
     }
 
     bool entryExists = true; // innocent until proven otherwise
index 5c4085a..c8ed94b 100644 (file)
@@ -2782,8 +2782,6 @@ bool QLocalePrivate::numberToCLocale(const QString &num,
     if (idx == l)
         return false;
 
-    const QChar _group = group();
-
     while (idx < l) {
         const QChar &in = uc[idx];
 
index 2b3026c..4c5f2f0 100644 (file)
@@ -695,9 +695,9 @@ inline QString::QString(const QLatin1String &aLatin1) : d(fromLatin1_helper(aLat
 inline int QString::length() const
 { return d->size; }
 inline const QChar QString::at(int i) const
-{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return d->data[i]; }
 inline const QChar QString::operator[](int i) const
-{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return d->data[i]; }
 inline const QChar QString::operator[](uint i) const
 { Q_ASSERT(i < uint(size())); return d->data[i]; }
 inline bool QString::isEmpty() const