summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2009-09-13 10:18:57 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-13 10:18:57 +0200
commitb2f2967411bcb23a807f6a17b042b4c58701af95 (patch)
tree7db490cf7846973e8b9850a87a0abd0e54944c0c /src/corelib/tools/qvector.h
parent139cffbfe1598b32ffe658968694d163dc53e3dd (diff)
Fix -Wconversion warnings where possible.
In order to detect "int foo = myQReal" mistakes, one needs to compile with -Wconversion. However that flag triggers many warnings inside Qt. This commit fixes many of them, like qchar.h:295: warning: conversion to 'ushort' from 'unsigned int' may alter its value qglobal.h:1026: warning: conversion to 'qreal' from 'qint64' may alter its value qbytearray.h:441: warning: conversion to 'char' from 'int' may alter its value Other warnings remain (such as those coming from bitfields) Merge-request: 1460 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r--src/corelib/tools/qvector.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 60d6921c4e..2737a8774f 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -543,7 +543,7 @@ void QVector<T>::append(const T &t)
template <typename T>
Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
{
- int offset = before - p->array;
+ int offset = int(before - p->array);
if (n != 0) {
const T copy(t);
if (d->ref != 1 || d->size + n > d->alloc)
@@ -577,8 +577,8 @@ Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n,
template <typename T>
Q_TYPENAME QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
{
- int f = abegin - p->array;
- int l = aend - p->array;
+ int f = int(abegin - p->array);
+ int l = int(aend - p->array);
int n = l - f;
detach();
if (QTypeInfo<T>::isComplex) {