From a3c3fb61e08523a563ce3cba86dc50c9c5fc2c5d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 13 Jul 2016 14:43:37 +0200 Subject: Fixed new diagnostics errors --- 3rdparty/valgrind.h | 7 ++++++- common/bufferutils.h | 2 +- common/domainadaptor.h | 2 +- common/messagequeue.cpp | 4 ++-- common/pipeline.cpp | 6 +++--- common/propertymapper.cpp | 2 +- common/store.cpp | 2 +- examples/imapresource/imapresource.cpp | 2 +- examples/maildirresource/maildirresource.cpp | 2 +- tests/hawd/dataset.cpp | 2 +- tests/hawd/datasetdefinition.cpp | 2 +- tests/mailtest.cpp | 2 +- tests/storagetest.cpp | 2 +- 13 files changed, 21 insertions(+), 16 deletions(-) diff --git a/3rdparty/valgrind.h b/3rdparty/valgrind.h index 21caa70..81cb5f2 100644 --- a/3rdparty/valgrind.h +++ b/3rdparty/valgrind.h @@ -70,10 +70,12 @@ problem, you can compile with the NVALGRIND symbol defined (gcc -DNVALGRIND) so that client requests are not even compiled in. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" + #ifndef __VALGRIND_H #define __VALGRIND_H - /* ------------------------------------------------------------------ */ /* VERSION NUMBER OF VALGRIND */ /* ------------------------------------------------------------------ */ @@ -5958,3 +5960,6 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) #undef PLAT_mips64_linux #endif /* __VALGRIND_H */ + +#pragma clang diagnostic pop + diff --git a/common/bufferutils.h b/common/bufferutils.h index d6008c4..6763ced 100644 --- a/common/bufferutils.h +++ b/common/bufferutils.h @@ -26,7 +26,7 @@ static QByteArray extractBuffer(const flatbuffers::FlatBufferBuilder &fbb) static QList fromVector(const flatbuffers::Vector> &vector) { QList list; - for (const auto &data : vector) { + for (const flatbuffers::String *data : vector) { Q_ASSERT(data); list << QByteArray::fromStdString(data->str()); } diff --git a/common/domainadaptor.h b/common/domainadaptor.h index 25448f3..e0912e4 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h @@ -115,7 +115,7 @@ public: /** * Returns all available properties for which a mapping exists (no matter what the buffer contains) */ - virtual QList availableProperties() const + virtual QList availableProperties() const Q_DECL_OVERRIDE { return mResourceMapper->availableProperties() + mLocalMapper->availableProperties(); } diff --git a/common/messagequeue.cpp b/common/messagequeue.cpp index a6e44e3..3567a10 100644 --- a/common/messagequeue.cpp +++ b/common/messagequeue.cpp @@ -55,7 +55,7 @@ void MessageQueue::startTransaction() return; } processRemovals(); - mWriteTransaction = std::move(mStorage.createTransaction(Sink::Storage::ReadWrite)); + mWriteTransaction = mStorage.createTransaction(Sink::Storage::ReadWrite); } void MessageQueue::commit() @@ -87,7 +87,7 @@ void MessageQueue::processRemovals() if (mWriteTransaction) { return; } - auto transaction = std::move(mStorage.createTransaction(Sink::Storage::ReadWrite)); + auto transaction = mStorage.createTransaction(Sink::Storage::ReadWrite); for (const auto &key : mPendingRemoval) { transaction.openDatabase().remove(key); } diff --git a/common/pipeline.cpp b/common/pipeline.cpp index f1a4a32..000d2b2 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -119,9 +119,9 @@ void Pipeline::startTransaction() if (d->storage.exists()) { while (!d->transaction.validateNamedDatabases()) { SinkWarning() << "Opened an invalid transaction!!!!!!"; - d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { + d->transaction = storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { SinkWarning() << error.message; - })); + }); } } } @@ -316,7 +316,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) // Remove deletions if (modifyEntity->deletions()) { - for (const auto &property : *modifyEntity->deletions()) { + for (const flatbuffers::String *property : *modifyEntity->deletions()) { newAdaptor->setProperty(BufferUtils::extractBuffer(property), QVariant()); } } diff --git a/common/propertymapper.cpp b/common/propertymapper.cpp index 130ba0b..9fe2d30 100644 --- a/common/propertymapper.cpp +++ b/common/propertymapper.cpp @@ -53,7 +53,7 @@ flatbuffers::uoffset_t variantToProperty(const QVariant &propert if (property.isValid()) { const auto list = property.value(); std::vector> vector; - for (const auto value : list) { + for (const auto &value : list) { auto offset = fbb.CreateString(value.toStdString()); vector.push_back(offset); } diff --git a/common/store.cpp b/common/store.cpp index 363878c..07f41f8 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -360,7 +360,7 @@ QList Store::read(const Sink::Query &q) SinkTrace() << "Found value: " << value->identifier(); list << *value; }); - for (const auto resourceInstanceIdentifier : resources.keys()) { + for (const auto &resourceInstanceIdentifier : resources.keys()) { const auto resourceType = resources.value(resourceInstanceIdentifier); SinkTrace() << "Looking for " << resourceType << resourceInstanceIdentifier; auto facade = FacadeFactory::instance().getFacade(resourceType, resourceInstanceIdentifier); diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 92f64bf..6f201ff 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp @@ -133,7 +133,7 @@ public: }, [&folderList](const QByteArray &remoteId) -> bool { // folderList.contains(remoteId) - for (const auto folderPath : folderList) { + for (const auto &folderPath : folderList) { if (folderPath.path == remoteId) { return true; } diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index d7a6fff..392b422 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp @@ -296,7 +296,7 @@ public: } ); - for (const auto folderPath : folderList) { + for (const auto &folderPath : folderList) { createFolder(folderPath, "folder"); } } diff --git a/tests/hawd/dataset.cpp b/tests/hawd/dataset.cpp index 372a4b6..c023f31 100644 --- a/tests/hawd/dataset.cpp +++ b/tests/hawd/dataset.cpp @@ -216,7 +216,7 @@ QString Dataset::Row::toString(const QStringList &cols, int standardCols, const Dataset::Dataset(const QString &name, const State &state) : m_definition(state.datasetDefinition(name)), m_storage(state.resultsPath(), name, Sink::Storage::ReadWrite), - m_transaction(std::move(m_storage.createTransaction())), + m_transaction(m_storage.createTransaction()), m_commitHash(state.commitHash()) { } diff --git a/tests/hawd/datasetdefinition.cpp b/tests/hawd/datasetdefinition.cpp index e2af2b9..9b7a20b 100644 --- a/tests/hawd/datasetdefinition.cpp +++ b/tests/hawd/datasetdefinition.cpp @@ -121,7 +121,7 @@ DatasetDefinition::DatasetDefinition(const QString &path) m_description = json.value("description").toString(); auto cols = json.value("columns").toArray(); - for (const auto &entry: cols) { + for (QJsonValueRef entry: cols) { QJsonObject def = entry.toObject(); if (!def.isEmpty()) { m_columns << qMakePair(def.value("name").toString(), DataDefinition(def)); diff --git a/tests/mailtest.cpp b/tests/mailtest.cpp index 2547536..908fb84 100644 --- a/tests/mailtest.cpp +++ b/tests/mailtest.cpp @@ -354,7 +354,7 @@ void MailTest::testCreateDraft() { auto mails = Store::read(Query().filter(folderIdentifier)); bool found = false; - for (const auto m : mails) { + for (const auto &m : mails) { if (m.identifier() == mail.identifier()) { found = true; } diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index e199faf..aa12ec1 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -28,7 +28,7 @@ private: if (i % 10000 == 0) { if (i > 0) { transaction.commit(); - transaction = std::move(storage.createTransaction(Sink::Storage::ReadWrite)); + transaction = storage.createTransaction(Sink::Storage::ReadWrite); } } transaction.openDatabase().write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i)); -- cgit v1.2.3