summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-15 16:05:01 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-16 11:18:04 (GMT)
commit1d45cf765ab467e6a0f9302eaf65b18419858aac (patch)
tree9da093eccc643f3d903eeb5d7a9a499d0a835b7d /src/corelib/kernel
parentb49a69f58346bcdf395840d5345ea32a144bfb50 (diff)
downloadQt-1d45cf765ab467e6a0f9302eaf65b18419858aac.zip
Qt-1d45cf765ab467e6a0f9302eaf65b18419858aac.tar.gz
Qt-1d45cf765ab467e6a0f9302eaf65b18419858aac.tar.bz2
Fix warnings for mingw
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetatype.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 91266db..6d9daec 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -430,16 +430,15 @@ int QMetaType::registerType(const char *typeName, Destructor destructor,
#endif
QWriteLocker locker(customTypesLock());
- static int currentIdx = User;
int idx = qMetaTypeType_unlocked(normalizedTypeName);
if (!idx) {
- idx = currentIdx++;
- ct->resize(ct->count() + 1);
- QCustomTypeInfo &inf = (*ct)[idx - User];
+ QCustomTypeInfo inf;
inf.typeName = normalizedTypeName;
inf.constr = constructor;
inf.destr = destructor;
+ idx = ct->size() + User;
+ ct->append(inf);
}
return idx;
}