diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-13 14:43:37 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-13 14:43:37 +0200 |
commit | a3c3fb61e08523a563ce3cba86dc50c9c5fc2c5d (patch) | |
tree | d2d8737bb7758fbf521909a367e9188b9c5690f6 | |
parent | 60965ca1431b2b3bed4f49e6bf1a9d5e5d86a3d9 (diff) | |
download | sink-a3c3fb61e08523a563ce3cba86dc50c9c5fc2c5d.tar.gz sink-a3c3fb61e08523a563ce3cba86dc50c9c5fc2c5d.zip |
Fixed new diagnostics errors
-rw-r--r-- | 3rdparty/valgrind.h | 7 | ||||
-rw-r--r-- | common/bufferutils.h | 2 | ||||
-rw-r--r-- | common/domainadaptor.h | 2 | ||||
-rw-r--r-- | common/messagequeue.cpp | 4 | ||||
-rw-r--r-- | common/pipeline.cpp | 6 | ||||
-rw-r--r-- | common/propertymapper.cpp | 2 | ||||
-rw-r--r-- | common/store.cpp | 2 | ||||
-rw-r--r-- | examples/imapresource/imapresource.cpp | 2 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 2 | ||||
-rw-r--r-- | tests/hawd/dataset.cpp | 2 | ||||
-rw-r--r-- | tests/hawd/datasetdefinition.cpp | 2 | ||||
-rw-r--r-- | tests/mailtest.cpp | 2 | ||||
-rw-r--r-- | 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 @@ | |||
70 | problem, you can compile with the NVALGRIND symbol defined (gcc | 70 | problem, you can compile with the NVALGRIND symbol defined (gcc |
71 | -DNVALGRIND) so that client requests are not even compiled in. */ | 71 | -DNVALGRIND) so that client requests are not even compiled in. */ |
72 | 72 | ||
73 | #pragma clang diagnostic push | ||
74 | #pragma clang diagnostic ignored "-Wreserved-id-macro" | ||
75 | |||
73 | #ifndef __VALGRIND_H | 76 | #ifndef __VALGRIND_H |
74 | #define __VALGRIND_H | 77 | #define __VALGRIND_H |
75 | 78 | ||
76 | |||
77 | /* ------------------------------------------------------------------ */ | 79 | /* ------------------------------------------------------------------ */ |
78 | /* VERSION NUMBER OF VALGRIND */ | 80 | /* VERSION NUMBER OF VALGRIND */ |
79 | /* ------------------------------------------------------------------ */ | 81 | /* ------------------------------------------------------------------ */ |
@@ -5958,3 +5960,6 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) | |||
5958 | #undef PLAT_mips64_linux | 5960 | #undef PLAT_mips64_linux |
5959 | 5961 | ||
5960 | #endif /* __VALGRIND_H */ | 5962 | #endif /* __VALGRIND_H */ |
5963 | |||
5964 | #pragma clang diagnostic pop | ||
5965 | |||
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) | |||
26 | static QList<QByteArray> fromVector(const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> &vector) | 26 | static QList<QByteArray> fromVector(const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> &vector) |
27 | { | 27 | { |
28 | QList<QByteArray> list; | 28 | QList<QByteArray> list; |
29 | for (const auto &data : vector) { | 29 | for (const flatbuffers::String *data : vector) { |
30 | Q_ASSERT(data); | 30 | Q_ASSERT(data); |
31 | list << QByteArray::fromStdString(data->str()); | 31 | list << QByteArray::fromStdString(data->str()); |
32 | } | 32 | } |
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: | |||
115 | /** | 115 | /** |
116 | * Returns all available properties for which a mapping exists (no matter what the buffer contains) | 116 | * Returns all available properties for which a mapping exists (no matter what the buffer contains) |
117 | */ | 117 | */ |
118 | virtual QList<QByteArray> availableProperties() const | 118 | virtual QList<QByteArray> availableProperties() const Q_DECL_OVERRIDE |
119 | { | 119 | { |
120 | return mResourceMapper->availableProperties() + mLocalMapper->availableProperties(); | 120 | return mResourceMapper->availableProperties() + mLocalMapper->availableProperties(); |
121 | } | 121 | } |
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() | |||
55 | return; | 55 | return; |
56 | } | 56 | } |
57 | processRemovals(); | 57 | processRemovals(); |
58 | mWriteTransaction = std::move(mStorage.createTransaction(Sink::Storage::ReadWrite)); | 58 | mWriteTransaction = mStorage.createTransaction(Sink::Storage::ReadWrite); |
59 | } | 59 | } |
60 | 60 | ||
61 | void MessageQueue::commit() | 61 | void MessageQueue::commit() |
@@ -87,7 +87,7 @@ void MessageQueue::processRemovals() | |||
87 | if (mWriteTransaction) { | 87 | if (mWriteTransaction) { |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | auto transaction = std::move(mStorage.createTransaction(Sink::Storage::ReadWrite)); | 90 | auto transaction = mStorage.createTransaction(Sink::Storage::ReadWrite); |
91 | for (const auto &key : mPendingRemoval) { | 91 | for (const auto &key : mPendingRemoval) { |
92 | transaction.openDatabase().remove(key); | 92 | transaction.openDatabase().remove(key); |
93 | } | 93 | } |
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() | |||
119 | if (d->storage.exists()) { | 119 | if (d->storage.exists()) { |
120 | while (!d->transaction.validateNamedDatabases()) { | 120 | while (!d->transaction.validateNamedDatabases()) { |
121 | SinkWarning() << "Opened an invalid transaction!!!!!!"; | 121 | SinkWarning() << "Opened an invalid transaction!!!!!!"; |
122 | d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { | 122 | d->transaction = storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { |
123 | SinkWarning() << error.message; | 123 | SinkWarning() << error.message; |
124 | })); | 124 | }); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | } | 127 | } |
@@ -316,7 +316,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
316 | 316 | ||
317 | // Remove deletions | 317 | // Remove deletions |
318 | if (modifyEntity->deletions()) { | 318 | if (modifyEntity->deletions()) { |
319 | for (const auto &property : *modifyEntity->deletions()) { | 319 | for (const flatbuffers::String *property : *modifyEntity->deletions()) { |
320 | newAdaptor->setProperty(BufferUtils::extractBuffer(property), QVariant()); | 320 | newAdaptor->setProperty(BufferUtils::extractBuffer(property), QVariant()); |
321 | } | 321 | } |
322 | } | 322 | } |
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<QByteArrayList>(const QVariant &propert | |||
53 | if (property.isValid()) { | 53 | if (property.isValid()) { |
54 | const auto list = property.value<QByteArrayList>(); | 54 | const auto list = property.value<QByteArrayList>(); |
55 | std::vector<flatbuffers::Offset<flatbuffers::String>> vector; | 55 | std::vector<flatbuffers::Offset<flatbuffers::String>> vector; |
56 | for (const auto value : list) { | 56 | for (const auto &value : list) { |
57 | auto offset = fbb.CreateString(value.toStdString()); | 57 | auto offset = fbb.CreateString(value.toStdString()); |
58 | vector.push_back(offset); | 58 | vector.push_back(offset); |
59 | } | 59 | } |
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<DomainType> Store::read(const Sink::Query &q) | |||
360 | SinkTrace() << "Found value: " << value->identifier(); | 360 | SinkTrace() << "Found value: " << value->identifier(); |
361 | list << *value; | 361 | list << *value; |
362 | }); | 362 | }); |
363 | for (const auto resourceInstanceIdentifier : resources.keys()) { | 363 | for (const auto &resourceInstanceIdentifier : resources.keys()) { |
364 | const auto resourceType = resources.value(resourceInstanceIdentifier); | 364 | const auto resourceType = resources.value(resourceInstanceIdentifier); |
365 | SinkTrace() << "Looking for " << resourceType << resourceInstanceIdentifier; | 365 | SinkTrace() << "Looking for " << resourceType << resourceInstanceIdentifier; |
366 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceType, resourceInstanceIdentifier); | 366 | auto facade = FacadeFactory::instance().getFacade<DomainType>(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: | |||
133 | }, | 133 | }, |
134 | [&folderList](const QByteArray &remoteId) -> bool { | 134 | [&folderList](const QByteArray &remoteId) -> bool { |
135 | // folderList.contains(remoteId) | 135 | // folderList.contains(remoteId) |
136 | for (const auto folderPath : folderList) { | 136 | for (const auto &folderPath : folderList) { |
137 | if (folderPath.path == remoteId) { | 137 | if (folderPath.path == remoteId) { |
138 | return true; | 138 | return true; |
139 | } | 139 | } |
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: | |||
296 | } | 296 | } |
297 | ); | 297 | ); |
298 | 298 | ||
299 | for (const auto folderPath : folderList) { | 299 | for (const auto &folderPath : folderList) { |
300 | createFolder(folderPath, "folder"); | 300 | createFolder(folderPath, "folder"); |
301 | } | 301 | } |
302 | } | 302 | } |
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 | |||
216 | Dataset::Dataset(const QString &name, const State &state) | 216 | Dataset::Dataset(const QString &name, const State &state) |
217 | : m_definition(state.datasetDefinition(name)), | 217 | : m_definition(state.datasetDefinition(name)), |
218 | m_storage(state.resultsPath(), name, Sink::Storage::ReadWrite), | 218 | m_storage(state.resultsPath(), name, Sink::Storage::ReadWrite), |
219 | m_transaction(std::move(m_storage.createTransaction())), | 219 | m_transaction(m_storage.createTransaction()), |
220 | m_commitHash(state.commitHash()) | 220 | m_commitHash(state.commitHash()) |
221 | { | 221 | { |
222 | } | 222 | } |
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) | |||
121 | 121 | ||
122 | m_description = json.value("description").toString(); | 122 | m_description = json.value("description").toString(); |
123 | auto cols = json.value("columns").toArray(); | 123 | auto cols = json.value("columns").toArray(); |
124 | for (const auto &entry: cols) { | 124 | for (QJsonValueRef entry: cols) { |
125 | QJsonObject def = entry.toObject(); | 125 | QJsonObject def = entry.toObject(); |
126 | if (!def.isEmpty()) { | 126 | if (!def.isEmpty()) { |
127 | m_columns << qMakePair(def.value("name").toString(), DataDefinition(def)); | 127 | 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() | |||
354 | { | 354 | { |
355 | auto mails = Store::read<ApplicationDomain::Mail>(Query().filter<Mail::Folder>(folderIdentifier)); | 355 | auto mails = Store::read<ApplicationDomain::Mail>(Query().filter<Mail::Folder>(folderIdentifier)); |
356 | bool found = false; | 356 | bool found = false; |
357 | for (const auto m : mails) { | 357 | for (const auto &m : mails) { |
358 | if (m.identifier() == mail.identifier()) { | 358 | if (m.identifier() == mail.identifier()) { |
359 | found = true; | 359 | found = true; |
360 | } | 360 | } |
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: | |||
28 | if (i % 10000 == 0) { | 28 | if (i % 10000 == 0) { |
29 | if (i > 0) { | 29 | if (i > 0) { |
30 | transaction.commit(); | 30 | transaction.commit(); |
31 | transaction = std::move(storage.createTransaction(Sink::Storage::ReadWrite)); | 31 | transaction = storage.createTransaction(Sink::Storage::ReadWrite); |
32 | } | 32 | } |
33 | } | 33 | } |
34 | transaction.openDatabase().write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i)); | 34 | transaction.openDatabase().write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i)); |