db/simple: fix implicit nullptr/bool conversion
Return false on error, not nullptr.
This commit is contained in:
parent
95f84afd33
commit
163597ef69
@ -448,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);
|
||||
@ -481,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);
|
||||
|
@ -44,7 +44,7 @@ PcmFormatConverter::Open(SampleFormat _src_format, SampleFormat _dest_format,
|
||||
"PCM conversion from %s to %s is not implemented",
|
||||
sample_format_to_string(_src_format),
|
||||
sample_format_to_string(_dest_format));
|
||||
return nullptr;
|
||||
return false;
|
||||
|
||||
case SampleFormat::S16:
|
||||
case SampleFormat::S24_P32:
|
||||
|
@ -288,7 +288,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow,
|
||||
return false;
|
||||
|
||||
if (!WaitConnected(error))
|
||||
return nullptr;
|
||||
return false;
|
||||
|
||||
NfsGetInfoOperation operation(*connection, path.c_str(), info);
|
||||
return operation.Run(error);
|
||||
|
Loading…
Reference in New Issue
Block a user