diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-27 16:29:27 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-28 08:45:11 (GMT) |
commit | 5e5485809e8c6f8339bb9f19ad71ed623a8b23c7 (patch) | |
tree | 7366d94a5ba6d0d56cb0074d411ac571ce8081da /src/corelib/tools | |
parent | ddd253e14318af45e5c56df736028b88257068c4 (diff) | |
download | Qt-5e5485809e8c6f8339bb9f19ad71ed623a8b23c7.zip Qt-5e5485809e8c6f8339bb9f19ad71ed623a8b23c7.tar.gz Qt-5e5485809e8c6f8339bb9f19ad71ed623a8b23c7.tar.bz2 |
Fixes warnings
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
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 5c4085a..c8ed94b 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -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]; diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 66cfa74..6418a8c 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -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 |