diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2019-06-14 13:40:04 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-06-24 11:13:08 +0200 |
| commit | e9de399dda27e4f8e8a2763b574c9fafaf2a5469 (patch) | |
| tree | 79889588c2f887ef98f96df753678b04a52f8602 /src/qml/compiler/qv4compileddata.cpp | |
| parent | 8f62f07bbc59ee3d97cd3d7d54b60b47c979a3cc (diff) | |
Move unit checksum generation into qv4compiler
Only the compiler ever has to do this, and we want the structure
definition for the compiled data as a common header.
Change-Id: Ie5c6d6c9dcd180dea79f54d0f7d10f3fc50fa20e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
| -rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index a7e0909b16..e548085873 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -41,7 +41,6 @@ #include <private/qv4staticvalue_p.h> #include <private/qqmlirbuilder_p.h> #include <QCoreApplication> -#include <QCryptographicHash> #include <QScopeGuard> #include <QFileInfo> @@ -161,24 +160,6 @@ void CompilationUnit::unlink() runtimeClasses = nullptr; } -void Unit::generateChecksum() -{ -#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1 - QCryptographicHash hash(QCryptographicHash::Md5); - - const int checksummableDataOffset = offsetof(QV4::CompiledData::Unit, md5Checksum) + sizeof(md5Checksum); - - const char *dataPtr = reinterpret_cast<const char *>(this) + checksummableDataOffset; - hash.addData(dataPtr, unitSize - checksummableDataOffset); - - QByteArray checksum = hash.result(); - Q_ASSERT(checksum.size() == sizeof(md5Checksum)); - memcpy(md5Checksum, checksum.constData(), sizeof(md5Checksum)); -#else - memset(md5Checksum, 0, sizeof(md5Checksum)); -#endif -} - } } |
