Commit 163597ef authored by Max Kellermann's avatar Max Kellermann

db/simple: fix implicit nullptr/bool conversion

Return false on error, not nullptr.
parent 95f84afd
...@@ -448,13 +448,13 @@ SimpleDatabase::Mount(const char *uri, Database *db, Error &error) ...@@ -448,13 +448,13 @@ SimpleDatabase::Mount(const char *uri, Database *db, Error &error)
if (r.uri == nullptr) { if (r.uri == nullptr) {
error.Format(db_domain, DB_CONFLICT, error.Format(db_domain, DB_CONFLICT,
"Already exists: %s", uri); "Already exists: %s", uri);
return nullptr; return false;
} }
if (strchr(r.uri, '/') != nullptr) { if (strchr(r.uri, '/') != nullptr) {
error.Format(db_domain, DB_NOT_FOUND, error.Format(db_domain, DB_NOT_FOUND,
"Parent not found: %s", uri); "Parent not found: %s", uri);
return nullptr; return false;
} }
Directory *mnt = r.directory->CreateChild(r.uri); Directory *mnt = r.directory->CreateChild(r.uri);
...@@ -481,7 +481,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri, ...@@ -481,7 +481,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri,
if (cache_path.IsNull()) { if (cache_path.IsNull()) {
error.Format(db_domain, DB_NOT_FOUND, error.Format(db_domain, DB_NOT_FOUND,
"No 'cache_directory' configured"); "No 'cache_directory' configured");
return nullptr; return false;
} }
std::string name(storage_uri); std::string name(storage_uri);
......
...@@ -44,7 +44,7 @@ PcmFormatConverter::Open(SampleFormat _src_format, SampleFormat _dest_format, ...@@ -44,7 +44,7 @@ PcmFormatConverter::Open(SampleFormat _src_format, SampleFormat _dest_format,
"PCM conversion from %s to %s is not implemented", "PCM conversion from %s to %s is not implemented",
sample_format_to_string(_src_format), sample_format_to_string(_src_format),
sample_format_to_string(_dest_format)); sample_format_to_string(_dest_format));
return nullptr; return false;
case SampleFormat::S16: case SampleFormat::S16:
case SampleFormat::S24_P32: case SampleFormat::S24_P32:
......
...@@ -288,7 +288,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow, ...@@ -288,7 +288,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow,
return false; return false;
if (!WaitConnected(error)) if (!WaitConnected(error))
return nullptr; return false;
NfsGetInfoOperation operation(*connection, path.c_str(), info); NfsGetInfoOperation operation(*connection, path.c_str(), info);
return operation.Run(error); return operation.Run(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment