manual braced init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
250011f016
commit
29ae84e199
@ -30,7 +30,7 @@ MusicChunkPtr
|
||||
MusicBuffer::Allocate() noexcept
|
||||
{
|
||||
const std::scoped_lock<Mutex> protect(mutex);
|
||||
return MusicChunkPtr(buffer.Allocate(), MusicChunkDeleter(*this));
|
||||
return {buffer.Allocate(), MusicChunkDeleter(*this)};
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -31,7 +31,7 @@ AllocatedPath::FromUTF8(std::string_view path_utf8) noexcept
|
||||
return FromFS(path_utf8);
|
||||
#else
|
||||
try {
|
||||
return AllocatedPath(::PathFromUTF8(path_utf8));
|
||||
return {::PathFromUTF8(path_utf8)};
|
||||
} catch (...) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -44,7 +44,7 @@ AllocatedPath::FromUTF8Throw(std::string_view path_utf8)
|
||||
#ifdef FS_CHARSET_ALWAYS_UTF8
|
||||
return FromFS(path_utf8);
|
||||
#else
|
||||
return AllocatedPath(::PathFromUTF8(path_utf8));
|
||||
return {::PathFromUTF8(path_utf8)};
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -339,8 +339,7 @@ UPnPDeviceDirectory::GetServer(std::string_view friendly_name)
|
||||
|
||||
for (const auto &service : device.services)
|
||||
if (isCDService(service.serviceType.c_str()))
|
||||
return ContentDirectoryService(device,
|
||||
service);
|
||||
return {device, service};
|
||||
}
|
||||
|
||||
throw std::runtime_error("Server not found");
|
||||
|
@ -31,7 +31,7 @@ MakeArgError(const char *msg, const char *value) noexcept
|
||||
{
|
||||
char buffer[256];
|
||||
snprintf(buffer, sizeof(buffer), "%s: %s", msg, value);
|
||||
return ProtocolError(ACK_ERROR_ARG, buffer);
|
||||
return {ACK_ERROR_ARG, buffer};
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
@ -206,15 +206,13 @@ ParseStringFilter(const char *&s, bool fold_case)
|
||||
if (auto after_contains = StringAfterPrefixIgnoreCase(s, "contains ")) {
|
||||
s = StripLeft(after_contains);
|
||||
auto value = ExpectQuoted(s);
|
||||
return StringFilter(std::move(value),
|
||||
fold_case, true, false);
|
||||
return {std::move(value), fold_case, true, false};
|
||||
}
|
||||
|
||||
if (auto after_not_contains = StringAfterPrefixIgnoreCase(s, "!contains ")) {
|
||||
s = StripLeft(after_not_contains);
|
||||
auto value = ExpectQuoted(s);
|
||||
return StringFilter(std::move(value),
|
||||
fold_case, true, true);
|
||||
return {std::move(value), fold_case, true, true};
|
||||
}
|
||||
|
||||
bool negated = false;
|
||||
@ -240,8 +238,7 @@ ParseStringFilter(const char *&s, bool fold_case)
|
||||
s = StripLeft(s + 2);
|
||||
auto value = ExpectQuoted(s);
|
||||
|
||||
return StringFilter(std::move(value),
|
||||
fold_case, false, negated);
|
||||
return {std::move(value), fold_case, false, negated};
|
||||
}
|
||||
|
||||
ISongFilterPtr
|
||||
|
Loading…
Reference in New Issue
Block a user