diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-12-22 08:33:21 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-26 20:28:24 (GMT) |
commit | 1d69887b8eb8236bf595ad5be3b527200b6c14b7 (patch) | |
tree | 3836f0b7512f20446b09ca2da38196bc0bd334f8 | |
parent | 5a3fcbf6b88ecf6d377a756f0bb95d066ca9daa1 (diff) | |
download | Qt-1d69887b8eb8236bf595ad5be3b527200b6c14b7.zip Qt-1d69887b8eb8236bf595ad5be3b527200b6c14b7.tar.gz Qt-1d69887b8eb8236bf595ad5be3b527200b6c14b7.tar.bz2 |
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 <thiago.macieira@intel.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
-rw-r--r-- | src/declarative/qml/qdeclarativemetatype.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 2 | ||||
-rw-r--r-- | 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<void *>(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) {} |