diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-02 11:18:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-09 15:09:22 +0100 |
commit | e4ff64343c0df1af0f653489735d85ec5de1bd39 (patch) | |
tree | c00f7f5a29741c5df069a1b109f4047e0c1a555d /src | |
parent | 4f63f43cf2da59c2e87ae96e8bd84950490a070b (diff) |
Fix a few more compiler warnings in release builds
Change-Id: I826226b7ddd4a74037b5bbe9a4a7322d404f53a9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlinstruction_p.h | 11 | ||||
-rw-r--r-- | src/qml/qml/qqmlvme.cpp | 4 |
3 files changed, 7 insertions, 14 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 0ba90aad27..fdbbed0bf8 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -583,8 +583,7 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, Instruction::StoreTime instr; QTime time = QQmlStringConverters::timeFromString(v->value.asString()); instr.propertyIndex = prop->index; - Q_ASSERT(sizeof(instr.time) == sizeof(QTime)); - ::memcpy(&instr.time, &time, sizeof(QTime)); + instr.time = time.msecsSinceStartOfDay(); output->addInstruction(instr); } break; @@ -595,8 +594,7 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, QTime time = dateTime.time(); instr.propertyIndex = prop->index; instr.date = dateTime.date().toJulianDay(); - Q_ASSERT(sizeof(instr.time) == sizeof(QTime)); - ::memcpy(&instr.time, &time, sizeof(QTime)); + instr.time = time.msecsSinceStartOfDay(); output->addInstruction(instr); } break; diff --git a/src/qml/qml/qqmlinstruction_p.h b/src/qml/qml/qqmlinstruction_p.h index 01b6fa41a4..150ee8df19 100644 --- a/src/qml/qml/qqmlinstruction_p.h +++ b/src/qml/qml/qqmlinstruction_p.h @@ -345,18 +345,13 @@ union QQmlInstruction struct instr_storeTime { QML_INSTR_HEADER int propertyIndex; - struct QTime { - int mds; -#if defined(Q_OS_WINCE) - int startTick; -#endif - } time; + int time; // QTime::fromMSecsSinceStartOfDay }; struct instr_storeDateTime { QML_INSTR_HEADER int propertyIndex; int date; - instr_storeTime::QTime time; + int time; }; struct instr_storeRect { QML_INSTR_HEADER @@ -540,7 +535,7 @@ struct QQmlInstructionMeta { enum { Size = QML_INSTR_SIZE(I, FMT) }; \ typedef QQmlInstruction::instr_##FMT DataType; \ static const DataType &data(const QQmlInstruction &instr) { return instr.FMT; } \ - static void setData(QQmlInstruction &instr, const DataType &v) { instr.FMT = v; } \ + static void setData(QQmlInstruction &instr, const DataType &v) { memcpy(&instr.FMT, &v, Size); } \ }; FOR_EACH_QML_INSTR(QML_INSTR_META_TEMPLATE); #undef QML_INSTR_META_TEMPLATE diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 7c27d77b2e..983136a846 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -400,8 +400,8 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_STORE_PROVIDER_VALUE(StoreColor, QMetaType::QColor, instr.value); QML_STORE_VALUE(StoreDate, QDate, QDate::fromJulianDay(instr.value)); QML_STORE_VALUE(StoreDateTime, QDateTime, - QDateTime(QDate::fromJulianDay(instr.date), *(QTime *)&instr.time)); - QML_STORE_POINTER(StoreTime, (QTime *)&instr.time); + QDateTime(QDate::fromJulianDay(instr.date), QTime::fromMSecsSinceStartOfDay(instr.time))); + QML_STORE_VALUE(StoreTime, QTime, QTime::fromMSecsSinceStartOfDay(instr.time)); QML_STORE_POINTER(StorePoint, (QPoint *)&instr.point); QML_STORE_POINTER(StorePointF, (QPointF *)&instr.point); QML_STORE_POINTER(StoreSize, (QSize *)&instr.size); |