diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-31 11:21:48 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-31 11:21:48 +0100 |
commit | cf8c6dfe32580d2d93cb67f496f50fa14c572f5c (patch) | |
tree | f06e531c8316810f6fed688f3d7c16fa6582c4ac | |
parent | 7c52358e3fc9798715895a57e6eee3274a2b84f3 (diff) | |
download | sink-cf8c6dfe32580d2d93cb67f496f50fa14c572f5c.tar.gz sink-cf8c6dfe32580d2d93cb67f496f50fa14c572f5c.zip |
Enabled and fixed a bunch of warnings
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 30 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 7 | ||||
-rw-r--r-- | common/genericresource.cpp | 1 | ||||
-rw-r--r-- | common/log.cpp | 14 | ||||
-rw-r--r-- | common/propertymapper.h | 4 | ||||
-rw-r--r-- | common/resourceaccess.cpp | 3 | ||||
-rw-r--r-- | common/resultprovider.h | 13 | ||||
-rw-r--r-- | common/storage_lmdb.cpp | 2 | ||||
-rw-r--r-- | examples/client/main.cpp | 1 | ||||
-rw-r--r-- | sinksh/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sinksh/sinksh_utils.h | 1 | ||||
-rw-r--r-- | sinksh/syntax_modules/core_syntax.cpp | 1 | ||||
-rw-r--r-- | tests/dummyresourcewritebenchmark.cpp | 1 |
14 files changed, 69 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f96f631..26f2f08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -58,7 +58,8 @@ function(add_clang_static_analysis target) | |||
58 | endfunction() | 58 | endfunction() |
59 | 59 | ||
60 | set(CMAKE_AUTOMOC ON) | 60 | set(CMAKE_AUTOMOC ON) |
61 | add_definitions("-Wall -std=c++0x -g") | 61 | add_definitions("-Wall -Weverything -Wno-cast-align -Wno-used-but-marked-unused -Wno-shadow -Wno-weak-vtables -Wno-global-constructors -Wno-deprecated -Wno-weak-template-vtables -Wno-exit-time-destructors -Wno-covered-switch-default -Wno-shorten-64-to-32 -Wno-documentation -Wno-old-style-cast -Wno-extra-semi -Wno-unused-parameter -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-missing-noreturn -Wno-missing-prototypes -Wno-documentation-unknown-command -Wno-sign-conversion") |
62 | add_definitions("-std=c++0x -g") | ||
62 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/common) | 63 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/common) |
63 | include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/common/domain) | 64 | include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/common/domain) |
64 | 65 | ||
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index b0433be..fccf082 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -100,6 +100,36 @@ QByteArray ApplicationDomainType::identifier() const | |||
100 | return mIdentifier; | 100 | return mIdentifier; |
101 | } | 101 | } |
102 | 102 | ||
103 | Entity::~Entity() | ||
104 | { | ||
105 | |||
106 | } | ||
107 | |||
108 | Event::~Event() | ||
109 | { | ||
110 | |||
111 | } | ||
112 | |||
113 | Todo::~Todo() | ||
114 | { | ||
115 | |||
116 | } | ||
117 | |||
118 | Mail::~Mail() | ||
119 | { | ||
120 | |||
121 | } | ||
122 | |||
123 | Folder::~Folder() | ||
124 | { | ||
125 | |||
126 | } | ||
127 | |||
128 | SinkResource::~SinkResource() | ||
129 | { | ||
130 | |||
131 | } | ||
132 | |||
103 | template<> | 133 | template<> |
104 | QByteArray getTypeName<Event>() | 134 | QByteArray getTypeName<Event>() |
105 | { | 135 | { |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 63f030c..88f094a 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -85,31 +85,37 @@ inline bool operator==(const ApplicationDomainType& lhs, const ApplicationDomain | |||
85 | struct Entity : public ApplicationDomainType { | 85 | struct Entity : public ApplicationDomainType { |
86 | typedef QSharedPointer<Entity> Ptr; | 86 | typedef QSharedPointer<Entity> Ptr; |
87 | using ApplicationDomainType::ApplicationDomainType; | 87 | using ApplicationDomainType::ApplicationDomainType; |
88 | virtual ~Entity(); | ||
88 | }; | 89 | }; |
89 | 90 | ||
90 | struct Event : public Entity { | 91 | struct Event : public Entity { |
91 | typedef QSharedPointer<Event> Ptr; | 92 | typedef QSharedPointer<Event> Ptr; |
92 | using Entity::Entity; | 93 | using Entity::Entity; |
94 | virtual ~Event(); | ||
93 | }; | 95 | }; |
94 | 96 | ||
95 | struct Todo : public Entity { | 97 | struct Todo : public Entity { |
96 | typedef QSharedPointer<Todo> Ptr; | 98 | typedef QSharedPointer<Todo> Ptr; |
97 | using Entity::Entity; | 99 | using Entity::Entity; |
100 | virtual ~Todo(); | ||
98 | }; | 101 | }; |
99 | 102 | ||
100 | struct Calendar : public Entity { | 103 | struct Calendar : public Entity { |
101 | typedef QSharedPointer<Calendar> Ptr; | 104 | typedef QSharedPointer<Calendar> Ptr; |
102 | using Entity::Entity; | 105 | using Entity::Entity; |
106 | virtual ~Calendar(); | ||
103 | }; | 107 | }; |
104 | 108 | ||
105 | struct Mail : public Entity { | 109 | struct Mail : public Entity { |
106 | typedef QSharedPointer<Mail> Ptr; | 110 | typedef QSharedPointer<Mail> Ptr; |
107 | using Entity::Entity; | 111 | using Entity::Entity; |
112 | virtual ~Mail(); | ||
108 | }; | 113 | }; |
109 | 114 | ||
110 | struct Folder : public Entity { | 115 | struct Folder : public Entity { |
111 | typedef QSharedPointer<Folder> Ptr; | 116 | typedef QSharedPointer<Folder> Ptr; |
112 | using Entity::Entity; | 117 | using Entity::Entity; |
118 | virtual ~Folder(); | ||
113 | }; | 119 | }; |
114 | 120 | ||
115 | /** | 121 | /** |
@@ -121,6 +127,7 @@ struct Folder : public Entity { | |||
121 | struct SinkResource : public ApplicationDomainType { | 127 | struct SinkResource : public ApplicationDomainType { |
122 | typedef QSharedPointer<SinkResource> Ptr; | 128 | typedef QSharedPointer<SinkResource> Ptr; |
123 | using ApplicationDomainType::ApplicationDomainType; | 129 | using ApplicationDomainType::ApplicationDomainType; |
130 | virtual ~SinkResource(); | ||
124 | }; | 131 | }; |
125 | 132 | ||
126 | /** | 133 | /** |
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index c7326d3..758ea0d 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -197,7 +197,6 @@ private slots: | |||
197 | default: | 197 | default: |
198 | return KAsync::error<qint64>(-1, "Unhandled command"); | 198 | return KAsync::error<qint64>(-1, "Unhandled command"); |
199 | } | 199 | } |
200 | return KAsync::null<qint64>(); | ||
201 | } | 200 | } |
202 | 201 | ||
203 | KAsync::Job<qint64, qint64> processQueuedCommand(const QByteArray &data) | 202 | KAsync::Job<qint64, qint64> processQueuedCommand(const QByteArray &data) |
diff --git a/common/log.cpp b/common/log.cpp index 45bbec1..316031d 100644 --- a/common/log.cpp +++ b/common/log.cpp | |||
@@ -17,7 +17,7 @@ public: | |||
17 | { | 17 | { |
18 | open(WriteOnly); | 18 | open(WriteOnly); |
19 | } | 19 | } |
20 | virtual ~DebugStream(){}; | 20 | virtual ~DebugStream(); |
21 | 21 | ||
22 | bool isSequential() const { return true; } | 22 | bool isSequential() const { return true; } |
23 | qint64 readData(char *, qint64) { return 0; /* eof */ } | 23 | qint64 readData(char *, qint64) { return 0; /* eof */ } |
@@ -35,6 +35,10 @@ private: | |||
35 | Q_DISABLE_COPY(DebugStream) | 35 | Q_DISABLE_COPY(DebugStream) |
36 | }; | 36 | }; |
37 | 37 | ||
38 | //Virtual method anchor | ||
39 | DebugStream::~DebugStream() | ||
40 | {} | ||
41 | |||
38 | class NullStream: public QIODevice | 42 | class NullStream: public QIODevice |
39 | { | 43 | { |
40 | public: | 44 | public: |
@@ -43,7 +47,7 @@ public: | |||
43 | { | 47 | { |
44 | open(WriteOnly); | 48 | open(WriteOnly); |
45 | } | 49 | } |
46 | virtual ~NullStream(){}; | 50 | virtual ~NullStream(); |
47 | 51 | ||
48 | bool isSequential() const { return true; } | 52 | bool isSequential() const { return true; } |
49 | qint64 readData(char *, qint64) { return 0; /* eof */ } | 53 | qint64 readData(char *, qint64) { return 0; /* eof */ } |
@@ -56,6 +60,10 @@ private: | |||
56 | Q_DISABLE_COPY(NullStream) | 60 | Q_DISABLE_COPY(NullStream) |
57 | }; | 61 | }; |
58 | 62 | ||
63 | //Virtual method anchor | ||
64 | NullStream::~NullStream() | ||
65 | {} | ||
66 | |||
59 | /* | 67 | /* |
60 | * ANSI color codes: | 68 | * ANSI color codes: |
61 | * 0: reset colors/style | 69 | * 0: reset colors/style |
@@ -175,8 +183,6 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char* file, | |||
175 | prefix = "Error: "; | 183 | prefix = "Error: "; |
176 | prefixColorCode = ANSI_Colors::Red; | 184 | prefixColorCode = ANSI_Colors::Red; |
177 | break; | 185 | break; |
178 | default: | ||
179 | break; | ||
180 | }; | 186 | }; |
181 | 187 | ||
182 | bool showLocation = false; | 188 | bool showLocation = false; |
diff --git a/common/propertymapper.h b/common/propertymapper.h index efde72c..94c9224 100644 --- a/common/propertymapper.h +++ b/common/propertymapper.h | |||
@@ -52,6 +52,8 @@ template<typename BufferType> | |||
52 | class ReadPropertyMapper | 52 | class ReadPropertyMapper |
53 | { | 53 | { |
54 | public: | 54 | public: |
55 | virtual ~ReadPropertyMapper(){}; | ||
56 | |||
55 | virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const | 57 | virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const |
56 | { | 58 | { |
57 | if (mReadAccessors.contains(key)) { | 59 | if (mReadAccessors.contains(key)) { |
@@ -106,6 +108,8 @@ template<typename BufferBuilder> | |||
106 | class WritePropertyMapper | 108 | class WritePropertyMapper |
107 | { | 109 | { |
108 | public: | 110 | public: |
111 | virtual ~WritePropertyMapper(){}; | ||
112 | |||
109 | virtual void setProperty(const QByteArray &key, const QVariant &value, QList<std::function<void(BufferBuilder &)> > &builderCalls, flatbuffers::FlatBufferBuilder &fbb) const | 113 | virtual void setProperty(const QByteArray &key, const QVariant &value, QList<std::function<void(BufferBuilder &)> > &builderCalls, flatbuffers::FlatBufferBuilder &fbb) const |
110 | { | 114 | { |
111 | if (mWriteAccessors.contains(key)) { | 115 | if (mWriteAccessors.contains(key)) { |
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 0c435c9..8296f1d 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -566,6 +566,9 @@ bool ResourceAccess::processMessageBuffer() | |||
566 | }, this); | 566 | }, this); |
567 | } | 567 | } |
568 | break; | 568 | break; |
569 | case Sink::Commands::NotificationType::NotificationType_Status: | ||
570 | case Sink::Commands::NotificationType::NotificationType_Warning: | ||
571 | case Sink::Commands::NotificationType::NotificationType_Progress: | ||
569 | default: | 572 | default: |
570 | Warning() << "Received unknown notification: " << buffer->type(); | 573 | Warning() << "Received unknown notification: " << buffer->type(); |
571 | break; | 574 | break; |
diff --git a/common/resultprovider.h b/common/resultprovider.h index 6958dbf..2d6efbe 100644 --- a/common/resultprovider.h +++ b/common/resultprovider.h | |||
@@ -27,8 +27,6 @@ | |||
27 | #include "resultset.h" | 27 | #include "resultset.h" |
28 | #include "log.h" | 28 | #include "log.h" |
29 | 29 | ||
30 | using namespace async; | ||
31 | |||
32 | namespace Sink { | 30 | namespace Sink { |
33 | 31 | ||
34 | /** | 32 | /** |
@@ -47,6 +45,11 @@ public: | |||
47 | 45 | ||
48 | } | 46 | } |
49 | 47 | ||
48 | virtual ~ResultProviderInterface() | ||
49 | { | ||
50 | |||
51 | } | ||
52 | |||
50 | virtual void add(const T &value) = 0; | 53 | virtual void add(const T &value) = 0; |
51 | virtual void modify(const T &value) = 0; | 54 | virtual void modify(const T &value) = 0; |
52 | virtual void remove(const T &value) = 0; | 55 | virtual void remove(const T &value) = 0; |
@@ -183,7 +186,7 @@ public: | |||
183 | 186 | ||
184 | void onDone(const std::function<void()> &callback) | 187 | void onDone(const std::function<void()> &callback) |
185 | { | 188 | { |
186 | mThreadBoundary = QSharedPointer<ThreadBoundary>::create(); | 189 | mThreadBoundary = QSharedPointer<async::ThreadBoundary>::create(); |
187 | mOnDoneCallback = callback; | 190 | mOnDoneCallback = callback; |
188 | } | 191 | } |
189 | 192 | ||
@@ -212,7 +215,7 @@ private: | |||
212 | 215 | ||
213 | QWeakPointer<ResultEmitter<T> > mResultEmitter; | 216 | QWeakPointer<ResultEmitter<T> > mResultEmitter; |
214 | std::function<void()> mOnDoneCallback; | 217 | std::function<void()> mOnDoneCallback; |
215 | QSharedPointer<ThreadBoundary> mThreadBoundary; | 218 | QSharedPointer<async::ThreadBoundary> mThreadBoundary; |
216 | std::function<void(const T &parent)> mFetcher; | 219 | std::function<void(const T &parent)> mFetcher; |
217 | }; | 220 | }; |
218 | 221 | ||
@@ -327,7 +330,7 @@ private: | |||
327 | std::function<void(void)> clearHandler; | 330 | std::function<void(void)> clearHandler; |
328 | 331 | ||
329 | std::function<void(const DomainType &parent)> mFetcher; | 332 | std::function<void(const DomainType &parent)> mFetcher; |
330 | ThreadBoundary mThreadBoundary; | 333 | async::ThreadBoundary mThreadBoundary; |
331 | }; | 334 | }; |
332 | 335 | ||
333 | template<class DomainType> | 336 | template<class DomainType> |
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 893c37c..e2c623e 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -443,8 +443,8 @@ Storage::NamedDatabase Storage::Transaction::openDatabase(const QByteArray &db, | |||
443 | d->implicitCommit = true; | 443 | d->implicitCommit = true; |
444 | auto p = new Storage::NamedDatabase::Private(db, allowDuplicates, d->defaultErrorHandler, d->name, d->transaction); | 444 | auto p = new Storage::NamedDatabase::Private(db, allowDuplicates, d->defaultErrorHandler, d->name, d->transaction); |
445 | if (!p->openDatabase(d->requestedRead, errorHandler)) { | 445 | if (!p->openDatabase(d->requestedRead, errorHandler)) { |
446 | return Storage::NamedDatabase(); | ||
447 | delete p; | 446 | delete p; |
447 | return Storage::NamedDatabase(); | ||
448 | } | 448 | } |
449 | return Storage::NamedDatabase(p); | 449 | return Storage::NamedDatabase(p); |
450 | } | 450 | } |
diff --git a/examples/client/main.cpp b/examples/client/main.cpp index f437c19..5af38bc 100644 --- a/examples/client/main.cpp +++ b/examples/client/main.cpp | |||
@@ -38,6 +38,7 @@ | |||
38 | */ | 38 | */ |
39 | class StoreBase { | 39 | class StoreBase { |
40 | public: | 40 | public: |
41 | virtual ~StoreBase(){}; | ||
41 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; | 42 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; |
42 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; | 43 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; |
43 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; | 44 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; |
diff --git a/sinksh/CMakeLists.txt b/sinksh/CMakeLists.txt index 1489fb3..521c740 100644 --- a/sinksh/CMakeLists.txt +++ b/sinksh/CMakeLists.txt | |||
@@ -2,6 +2,7 @@ project(sinksh) | |||
2 | 2 | ||
3 | find_package(Readline REQUIRED) | 3 | find_package(Readline REQUIRED) |
4 | 4 | ||
5 | add_definitions("-Wno-undefined-reinterpret-cast") | ||
5 | 6 | ||
6 | set(sink_cli_SRCS | 7 | set(sink_cli_SRCS |
7 | main.cpp | 8 | main.cpp |
diff --git a/sinksh/sinksh_utils.h b/sinksh/sinksh_utils.h index 457f644..3e75e0d 100644 --- a/sinksh/sinksh_utils.h +++ b/sinksh/sinksh_utils.h | |||
@@ -47,6 +47,7 @@ QMap<QString, QString> keyValueMapFromArgs(const QStringList &args); | |||
47 | */ | 47 | */ |
48 | class StoreBase { | 48 | class StoreBase { |
49 | public: | 49 | public: |
50 | virtual ~StoreBase() {}; | ||
50 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; | 51 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; |
51 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; | 52 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; |
52 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; | 53 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; |
diff --git a/sinksh/syntax_modules/core_syntax.cpp b/sinksh/syntax_modules/core_syntax.cpp index f5b6274..a05beb0 100644 --- a/sinksh/syntax_modules/core_syntax.cpp +++ b/sinksh/syntax_modules/core_syntax.cpp | |||
@@ -32,7 +32,6 @@ namespace CoreSyntax | |||
32 | bool exit(const QStringList &, State &) | 32 | bool exit(const QStringList &, State &) |
33 | { | 33 | { |
34 | ::exit(0); | 34 | ::exit(0); |
35 | return true; | ||
36 | } | 35 | } |
37 | 36 | ||
38 | bool showHelp(const QStringList &commands, State &state) | 37 | bool showHelp(const QStringList &commands, State &state) |
diff --git a/tests/dummyresourcewritebenchmark.cpp b/tests/dummyresourcewritebenchmark.cpp index 1a8893b..ccbe5ac 100644 --- a/tests/dummyresourcewritebenchmark.cpp +++ b/tests/dummyresourcewritebenchmark.cpp | |||
@@ -120,6 +120,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
120 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); | 120 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); |
121 | } | 121 | } |
122 | auto appendTime = time.elapsed(); | 122 | auto appendTime = time.elapsed(); |
123 | Q_UNUSED(appendTime); | ||
123 | auto bufferSizeTotal = bufferSize * num; | 124 | auto bufferSizeTotal = bufferSize * num; |
124 | 125 | ||
125 | //Wait until all messages have been processed | 126 | //Wait until all messages have been processed |