From 1d69887b8eb8236bf595ad5be3b527200b6c14b7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Dec 2012 00:33:21 -0800 Subject: Fix some warnings in qtquick1 found by Clang qml/qdeclarativevme.cpp:286:26: error: destination for this 'memset' call is a pointer to dynamic class 'QObject'; vtable pointer will be overwritten [-Werror,-Wdynamic-class-memaccess] qml/qdeclarativemetatype.cpp:441:9: error: expression result unused; should this cast be to 'void'? [-Werror,-Wunused-value] util/qdeclarativefontloader.cpp:87:52: error: addition of default argument on redeclaration makes this constructor a default constructor [-Werror,-Wdefault-arg-special-member] Cherry-picked from qtquick1/99f138ad08101315cc871489c78cd10755b046b0 Change-Id: If0a690eacf9421f932214d2917cd3fa0a7daac9a Reviewed-by: Thiago Macieira Reviewed-by: Alan Alpert --- src/declarative/qml/qdeclarativemetatype.cpp | 4 ++-- src/declarative/qml/qdeclarativevme.cpp | 2 +- src/declarative/util/qdeclarativefontloader.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 2fe181f..8c8a1e8 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -448,7 +448,7 @@ QObject *QDeclarativeType::create() const d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); return rv; } @@ -461,7 +461,7 @@ void QDeclarativeType::create(QObject **out, void **memory, size_t additionalMem d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); *out = rv; *memory = ((char *)rv) + d->m_allocationSize; diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 1a9ba19..477580f 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -283,7 +283,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack, { QObject *o = (QObject *)operator new(instr.createSimple.typeSize + sizeof(QDeclarativeData)); - ::memset(o, 0, instr.createSimple.typeSize + sizeof(QDeclarativeData)); + ::memset(static_cast(o), 0, instr.createSimple.typeSize + sizeof(QDeclarativeData)); instr.createSimple.create(o); QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize); diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index 5482d66..d9c382f 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -64,7 +64,7 @@ class QDeclarativeFontObject : public QObject Q_OBJECT public: - QDeclarativeFontObject(int _id); + QDeclarativeFontObject(int _id = -1); void download(const QUrl &url, QNetworkAccessManager *manager); @@ -84,7 +84,7 @@ private: Q_DISABLE_COPY(QDeclarativeFontObject) }; -QDeclarativeFontObject::QDeclarativeFontObject(int _id = -1) +QDeclarativeFontObject::QDeclarativeFontObject(int _id) : QObject(0), id(_id), reply(0), redirectCount(0) {} -- cgit v0.12