Commit 29ae84e1 authored by Rosen Penev's avatar Rosen Penev

manual braced init

Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent 250011f0
......@@ -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
......
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