summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-08 04:12:57 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-11-08 04:12:57 (GMT)
commit16316f170fde30b91ed884a95d5910bd4de63782 (patch)
treea604f53d2d97fe6e39695b0dcca42929231c0eef
parent2875e6b26c9a40ad1f5e4e214937e5a19a56432c (diff)
downloadQt-16316f170fde30b91ed884a95d5910bd4de63782.zip
Qt-16316f170fde30b91ed884a95d5910bd4de63782.tar.gz
Qt-16316f170fde30b91ed884a95d5910bd4de63782.tar.bz2
Don't use stdint.h in our headers since it is a C99 header.
This caused problems in user applications depending upon the order of inlcusion and/or defining __STDC_LIMIT_MACROS. stdint.h is also not present in msvc, but is present in mingw. Switch to using quintptr. Task-number: QTBUG-14691 Task-number: QTBUG-13953 Reviewed-by: Bea Lam
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h5
-rw-r--r--src/declarative/qml/qmetaobjectbuilder.cpp12
2 files changed, 5 insertions, 12 deletions
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index d45ddbc..388c92e 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -55,9 +55,6 @@
#include <QtCore/qglobal.h>
#include <QtCore/qvariant.h>
-#ifndef Q_OS_WIN
-#include <stdint.h>
-#endif
QT_BEGIN_HEADER
@@ -105,7 +102,7 @@ namespace QDeclarativePrivate
template<class From, class To>
struct StaticCastSelectorClass<From, To, sizeof(int)>
{
- static inline int cast() { return int(reinterpret_cast<intptr_t>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; }
+ static inline int cast() { return int(reinterpret_cast<quintptr>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; }
};
template<class From, class To>
diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp
index 58f8811..dfe89f8 100644
--- a/src/declarative/qml/qmetaobjectbuilder.cpp
+++ b/src/declarative/qml/qmetaobjectbuilder.cpp
@@ -41,10 +41,6 @@
#include "private/qmetaobjectbuilder_p.h"
-#ifndef Q_OS_WIN
-#include <stdint.h>
-#endif
-
QT_BEGIN_NAMESPACE
/*!
@@ -1264,8 +1260,8 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
char *str = reinterpret_cast<char *>(buf + size);
if (buf) {
if (relocatable) {
- meta->d.stringdata = reinterpret_cast<const char *>((intptr_t)size);
- meta->d.data = reinterpret_cast<uint *>((intptr_t)pmetaSize);
+ meta->d.stringdata = reinterpret_cast<const char *>((quintptr)size);
+ meta->d.data = reinterpret_cast<uint *>((quintptr)pmetaSize);
} else {
meta->d.stringdata = str;
meta->d.data = reinterpret_cast<uint *>(data);
@@ -1502,8 +1498,8 @@ void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output,
const char *buf = data.constData();
const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf);
- intptr_t stringdataOffset = (intptr_t)dataMo->d.stringdata;
- intptr_t dataOffset = (intptr_t)dataMo->d.data;
+ quintptr stringdataOffset = (quintptr)dataMo->d.stringdata;
+ quintptr dataOffset = (quintptr)dataMo->d.data;
output->d.superdata = superclass;
output->d.stringdata = buf + stringdataOffset;