aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-20 13:38:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-22 04:24:00 +0200
commite04cadca4a6c0b43d29c83d23ac74393694a5ea5 (patch)
treeaa495250e8fa420b6b262c76b1d5ad2050067cb9 /src/qml/qml
parentff959399c9bd13e4c881cd6aa7f953dce92bda5b (diff)
Fix compilation with MSVC 2008 (and prospective Windows CE build fix)
* Only 2010 and newer ship stdint.h, so for 2008 we have to provide a little stdint.h compat header, for some of the third-party code we import. Our own Qt code this patch changes to use quint* types instead. * Include math.h and float.h for some math functions. * disable the JIT on Windows CE for now. * Change use of intptr_t to qintptr in Qt code. intptr_t is in inttypes.h, except that with VS 2008 it is indirectly available through stdio.h. Let's avoid the mess and just use the qt type, that's always available. Change-Id: I19055edd89e0a6b147d9edbb3b711798ed3c05a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/ftw/qhashedstring.cpp2
-rw-r--r--src/qml/qml/ftw/qhashedstring_p.h10
-rw-r--r--src/qml/qml/qqmlabstractbinding_p.h4
-rw-r--r--src/qml/qml/qqmlaccessors_p.h8
-rw-r--r--src/qml/qml/qqmllocale.cpp2
-rw-r--r--src/qml/qml/qqmlnotifier.cpp10
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h2
7 files changed, 18 insertions, 20 deletions
diff --git a/src/qml/qml/ftw/qhashedstring.cpp b/src/qml/qml/ftw/qhashedstring.cpp
index 7e6ea59ef9..40caaf379f 100644
--- a/src/qml/qml/ftw/qhashedstring.cpp
+++ b/src/qml/qml/ftw/qhashedstring.cpp
@@ -394,7 +394,7 @@ QString QHashedCStringRef::toUtf16() const
QString rv;
rv.resize(m_length);
- writeUtf16((uint16_t*)rv.data());
+ writeUtf16((quint16*)rv.data());
return rv;
}
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h
index 4815f787b6..9b7215f0ae 100644
--- a/src/qml/qml/ftw/qhashedstring_p.h
+++ b/src/qml/qml/ftw/qhashedstring_p.h
@@ -64,8 +64,6 @@
#include <stdlib.h>
#endif
-#include <stdint.h>
-
QT_BEGIN_NAMESPACE
// Enable this to debug hash linking assumptions.
@@ -164,7 +162,7 @@ public:
QString toUtf16() const;
inline int utf16length() const;
inline void writeUtf16(QChar *) const;
- inline void writeUtf16(uint16_t *) const;
+ inline void writeUtf16(quint16 *) const;
private:
friend class QHashedStringRef;
@@ -232,7 +230,7 @@ public:
void setQString(bool v) { if (v) next.setFlag(); else next.clearFlag(); }
inline char *cStrData() const { return (char *)ckey; }
- inline uint16_t *utf16Data() const { return (uint16_t *)strData->data(); }
+ inline quint16 *utf16Data() const { return (quint16 *)strData->data(); }
inline bool equals(const QV4::Value &string) const {
QString s = string.toQString();
@@ -1274,10 +1272,10 @@ int QHashedCStringRef::utf16length() const
void QHashedCStringRef::writeUtf16(QChar *output) const
{
- writeUtf16((uint16_t *)output);
+ writeUtf16((quint16 *)output);
}
-void QHashedCStringRef::writeUtf16(uint16_t *output) const
+void QHashedCStringRef::writeUtf16(quint16 *output) const
{
int l = m_length;
const char *d = m_data;
diff --git a/src/qml/qml/qqmlabstractbinding_p.h b/src/qml/qml/qqmlabstractbinding_p.h
index 7ac10a6d63..40d42d8284 100644
--- a/src/qml/qml/qqmlabstractbinding_p.h
+++ b/src/qml/qml/qqmlabstractbinding_p.h
@@ -171,7 +171,7 @@ private:
// the vTables array are used for dispatching.
// This saves a compiler-generated pointer to a compiler-generated vTable, and thus reduces
// the binding object size by sizeof(void*).
- uintptr_t m_nextBindingPtr;
+ qintptr m_nextBindingPtr;
static VTable *vTables[];
inline const VTable *vtable() const { return vTables[bindingType()]; }
@@ -200,7 +200,7 @@ QQmlAbstractBinding *QQmlAbstractBinding::nextBinding() const
void QQmlAbstractBinding::setNextBinding(QQmlAbstractBinding *b)
{
- m_nextBindingPtr = uintptr_t(b) | (m_nextBindingPtr & 0x3);
+ m_nextBindingPtr = qintptr(b) | (m_nextBindingPtr & 0x3);
}
QQmlAbstractBinding::BindingType QQmlAbstractBinding::bindingType() const
diff --git a/src/qml/qml/qqmlaccessors_p.h b/src/qml/qml/qqmlaccessors_p.h
index 6df624eaf1..1a4aae0ef7 100644
--- a/src/qml/qml/qqmlaccessors_p.h
+++ b/src/qml/qml/qqmlaccessors_p.h
@@ -94,7 +94,7 @@ class QQmlNotifier;
} while (false);
#define QML_PRIVATE_ACCESSOR(clazz, cpptype, name, variable) \
- static void clazz ## _ ## name ## Read(QObject *o, intptr_t, void *rv) \
+ static void clazz ## _ ## name ## Read(QObject *o, qintptr, void *rv) \
{ \
clazz ## Private *d = clazz ## Private::get(static_cast<clazz *>(o)); \
*static_cast<cpptype *>(rv) = d->variable; \
@@ -105,15 +105,15 @@ class QQmlNotifier;
class QQmlAccessors
{
public:
- void (*read)(QObject *object, intptr_t property, void *output);
- void (*notifier)(QObject *object, intptr_t property, QQmlNotifier **notifier);
+ void (*read)(QObject *object, qintptr property, void *output);
+ void (*notifier)(QObject *object, qintptr property, QQmlNotifier **notifier);
};
namespace QQmlAccessorProperties {
struct Property {
const char *name;
unsigned int nameLength;
- intptr_t data;
+ qintptr data;
QQmlAccessors *accessors;
};
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index c07144a66c..4694e33abd 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -416,7 +416,7 @@ QV4::Value QQmlNumberExtension::toLocaleString(QV4::SimpleCallContext *ctx)
GET_LOCALE_DATA_RESOURCE(ctx->arguments[0]);
- uint16_t format = 'f';
+ quint16 format = 'f';
if (ctx->argumentCount > 1) {
if (!ctx->arguments[1].isString())
V4THROW_ERROR("Locale: Number.toLocaleString(): Invalid arguments");
diff --git a/src/qml/qml/qqmlnotifier.cpp b/src/qml/qml/qqmlnotifier.cpp
index da016c90a5..3d4b260574 100644
--- a/src/qml/qml/qqmlnotifier.cpp
+++ b/src/qml/qml/qqmlnotifier.cpp
@@ -61,15 +61,15 @@ static Callback QQmlNotifier_callbacks[] = {
void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint, void **a)
{
- intptr_t originalSenderPtr;
- intptr_t *disconnectWatch;
+ qintptr originalSenderPtr;
+ qintptr *disconnectWatch;
if (!endpoint->isNotifying()) {
originalSenderPtr = endpoint->senderPtr;
disconnectWatch = &originalSenderPtr;
- endpoint->senderPtr = intptr_t(disconnectWatch) | 0x1;
+ endpoint->senderPtr = qintptr(disconnectWatch) | 0x1;
} else {
- disconnectWatch = (intptr_t *)(endpoint->senderPtr & ~0x1);
+ disconnectWatch = (qintptr *)(endpoint->senderPtr & ~0x1);
}
if (endpoint->next)
@@ -111,7 +111,7 @@ void QQmlNotifierEndpoint::connect(QObject *source, int sourceSignal, QQmlEngine
qPrintable(engineName));
}
- senderPtr = intptr_t(source);
+ senderPtr = qintptr(source);
this->sourceSignal = sourceSignal;
QQmlPropertyPrivate::flushSignal(source, sourceSignal);
QQmlData *ddata = QQmlData::get(source, true);
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index daba6e856d..21fee28b02 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -205,7 +205,7 @@ public:
};
struct { // When HasAccessors
QQmlAccessors *accessors;
- intptr_t accessorData;
+ qintptr accessorData;
};
};