summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-10 23:22:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-10 23:22:23 +0200
commitbcbec4bc49774b80780872c8234acb256c38d779 (patch)
tree038e1c47f9156877b89a840fb69947e0774218b4 /src/corelib
parent507a7b4df918a091c45af35110fd2cdeff3713aa (diff)
parent2346ae167568bb9e5d247da0b946067b7f9aad48 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp6
-rw-r--r--src/corelib/kernel/qmetaobject.cpp9
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qvector.h2
4 files changed, 13 insertions, 6 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index e8904b0ab7..57231b57a9 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -573,9 +573,12 @@ typedef enum { Q_FileIdInfo = 18 } Q_FILE_INFO_BY_HANDLE_CLASS;
# if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700)
+// MinGW-64 defines FILE_ID_128 as of gcc-4.8.1 along with FILE_SUPPORTS_INTEGRITY_STREAMS
+# if !(defined(Q_CC_MINGW) && defined(FILE_SUPPORTS_INTEGRITY_STREAMS))
typedef struct _FILE_ID_128 {
BYTE Identifier[16];
} FILE_ID_128, *PFILE_ID_128;
+# endif // !(Q_CC_MINGW && FILE_SUPPORTS_INTEGRITY_STREAMS)
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
@@ -614,7 +617,8 @@ QByteArray fileIdWin8(HANDLE handle)
&infoEx, sizeof(FILE_ID_INFO))) {
result = QByteArray::number(infoEx.VolumeSerialNumber, 16);
result += ':';
- result += QByteArray((char *)infoEx.FileId.Identifier, sizeof(infoEx.FileId.Identifier)).toHex();
+ // Note: MinGW-64's definition of FILE_ID_128 differs from the MSVC one.
+ result += QByteArray((char *)&infoEx.FileId, sizeof(infoEx.FileId)).toHex();
}
}
return result;
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 4dc766ecc5..8d6cf5beb5 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -42,6 +42,7 @@
#include "qmetaobject.h"
#include "qmetatype.h"
#include "qobject.h"
+#include "qmetaobject_p.h"
#include <qcoreapplication.h>
#include <qcoreevent.h>
@@ -2098,8 +2099,12 @@ bool QMetaMethod::invoke(QObject *object,
if (qstrcmp(returnValue.name(), retType) != 0) {
// normalize the return value as well
QByteArray normalized = QMetaObject::normalizedType(returnValue.name());
- if (qstrcmp(normalized.constData(), retType) != 0)
- return false;
+ if (qstrcmp(normalized.constData(), retType) != 0) {
+ // String comparison failed, try compare the metatype.
+ int t = returnType();
+ if (t == QMetaType::UnknownType || t != QMetaType::type(normalized))
+ return false;
+ }
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 20d4339a19..a2d3891f00 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -646,8 +646,6 @@ static inline char qToLower(char c)
store raw binary data, and when memory conservation is critical
(e.g., with Qt for Embedded Linux).
- The maximum array size of a QByteArray is under 2^30.
-
One way to initialize a QByteArray is simply to pass a \c{const
char *} to its constructor. For example, the following code
creates a byte array of size 5 containing the data "Hello":
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 288404f3c2..0f2acd6986 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -642,7 +642,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
iterator moveEnd = d->end();
while (moveBegin != moveEnd) {
if (QTypeInfo<T>::isComplex)
- abegin->~T();
+ static_cast<T *>(abegin)->~T();
new (abegin++) T(*moveBegin++);
}
if (abegin < d->end()) {