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/plugins/simple/SimpleDatabasePlugin.cxx | |
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/plugins/simple/SimpleDatabasePlugin.cxx')
-rw-r--r-- | src/db/plugins/simple/SimpleDatabasePlugin.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
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); |