diff options
author | Max Kellermann <max@duempel.org> | 2014-12-26 14:40:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-26 14:40:32 +0100 |
commit | 412bedb697c66c809652510951e1ccdb5319d0bb (patch) | |
tree | a9c94234d7078e7a1e694e65db70a65966ccb5ac /src/db | |
parent | d37811f177bb7e4c5dd6e3a18b3466ba831aa379 (diff) | |
parent | 163597ef6939e4250afafe12f821aa732b1fc2b7 (diff) | |
download | mpd-412bedb697c66c809652510951e1ccdb5319d0bb.tar.gz mpd-412bedb697c66c809652510951e1ccdb5319d0bb.tar.xz mpd-412bedb697c66c809652510951e1ccdb5319d0bb.zip |
Merge branch 'v0.19.x'
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/plugins/LazyDatabase.hxx | 2 | ||||
-rw-r--r-- | src/db/plugins/ProxyDatabasePlugin.cxx | 8 | ||||
-rw-r--r-- | src/db/plugins/simple/SimpleDatabasePlugin.cxx | 11 | ||||
-rw-r--r-- | src/db/plugins/simple/SimpleDatabasePlugin.hxx | 6 | ||||
-rw-r--r-- | src/db/plugins/upnp/UpnpDatabasePlugin.cxx | 6 |
5 files changed, 19 insertions, 14 deletions
diff --git a/src/db/plugins/LazyDatabase.hxx b/src/db/plugins/LazyDatabase.hxx index ae1b961d0..38b3fdc2a 100644 --- a/src/db/plugins/LazyDatabase.hxx +++ b/src/db/plugins/LazyDatabase.hxx @@ -43,7 +43,7 @@ public: virtual const LightSong *GetSong(const char *uri_utf8, Error &error) const override; - virtual void ReturnSong(const LightSong *song) const; + void ReturnSong(const LightSong *song) const override; virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index fba72210d..5fd224bb5 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -103,7 +103,7 @@ public: virtual void Close() override; virtual const LightSong *GetSong(const char *uri_utf8, Error &error) const override; - virtual void ReturnSong(const LightSong *song) const; + void ReturnSong(const LightSong *song) const override; virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, @@ -731,7 +731,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection, { // TODO: eliminate the const_cast if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error)) - return nullptr; + return false; if (!visit_directory && !visit_playlist && selection.recursive && (ServerSupportsSearchBase(connection) @@ -757,7 +757,7 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection, { // TODO: eliminate the const_cast if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error)) - return nullptr; + return false; enum mpd_tag_type tag_type2 = Convert(tag_type); if (tag_type2 == MPD_TAG_COUNT) { @@ -810,7 +810,7 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection, // TODO: eliminate the const_cast if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error)) - return nullptr; + return false; struct mpd_stats *stats2 = mpd_run_stats(connection); diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx index bc9c42d2d..00eb078bc 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx @@ -435,9 +435,12 @@ SimpleDatabase::Save(Error &error) bool SimpleDatabase::Mount(const char *uri, Database *db, Error &error) { +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ assert(uri != nullptr); - assert(*uri != 0); assert(db != nullptr); +#endif + assert(*uri != 0); ScopeDatabaseLock protect; @@ -445,13 +448,13 @@ SimpleDatabase::Mount(const char *uri, Database *db, Error &error) if (r.uri == nullptr) { error.Format(db_domain, DB_CONFLICT, "Already exists: %s", uri); - return nullptr; + return false; } if (strchr(r.uri, '/') != nullptr) { error.Format(db_domain, DB_NOT_FOUND, "Parent not found: %s", uri); - return nullptr; + return false; } Directory *mnt = r.directory->CreateChild(r.uri); @@ -478,7 +481,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri, if (cache_path.IsNull()) { error.Format(db_domain, DB_NOT_FOUND, "No 'cache_directory' configured"); - return nullptr; + return false; } std::string name(storage_uri); diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.hxx b/src/db/plugins/simple/SimpleDatabasePlugin.hxx index eb225b2c8..dec2a3a7c 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.hxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.hxx @@ -110,9 +110,9 @@ public: virtual bool Open(Error &error) override; virtual void Close() override; - virtual const LightSong *GetSong(const char *uri_utf8, - Error &error) const override; - virtual void ReturnSong(const LightSong *song) const; + const LightSong *GetSong(const char *uri_utf8, + Error &error) const override; + void ReturnSong(const LightSong *song) const override; virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx index 8d7f1bda8..aea97aa8e 100644 --- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx +++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx @@ -85,7 +85,7 @@ public: virtual void Close() override; virtual const LightSong *GetSong(const char *uri_utf8, Error &error) const override; - virtual void ReturnSong(const LightSong *song) const; + void ReturnSong(const LightSong *song) const override; virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, @@ -101,7 +101,9 @@ public: virtual bool GetStats(const DatabaseSelection &selection, DatabaseStats &stats, Error &error) const override; - virtual time_t GetUpdateStamp() const {return 0;} + time_t GetUpdateStamp() const override { + return 0; + } protected: bool Configure(const config_param ¶m, Error &error); |