Commit 4e276256 authored by Rosen Penev's avatar Rosen Penev Committed by Max Kellermann

more braced init list conversion

Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent d0f9062b
...@@ -48,15 +48,14 @@ LocateFileUri(const char *uri, const Client *client ...@@ -48,15 +48,14 @@ LocateFileUri(const char *uri, const Client *client
/* this path was relative to the music /* this path was relative to the music
directory */ directory */
// TODO: don't use suffix.data() (ok for now because we know it's null-terminated) // TODO: don't use suffix.data() (ok for now because we know it's null-terminated)
return LocatedUri(LocatedUri::Type::RELATIVE, return {LocatedUri::Type::RELATIVE, suffix.data()};
suffix.data());
} }
#endif #endif
if (client != nullptr) if (client != nullptr)
client->AllowFile(path); client->AllowFile(path);
return LocatedUri(LocatedUri::Type::PATH, uri, std::move(path)); return {LocatedUri::Type::PATH, uri, std::move(path)};
} }
static LocatedUri static LocatedUri
...@@ -90,8 +89,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri ...@@ -90,8 +89,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
const auto suffix = storage->MapToRelativeUTF8(uri); const auto suffix = storage->MapToRelativeUTF8(uri);
if (suffix.data() != nullptr) if (suffix.data() != nullptr)
// TODO: don't use suffix.data() (ok for now because we know it's null-terminated) // TODO: don't use suffix.data() (ok for now because we know it's null-terminated)
return LocatedUri(LocatedUri::Type::RELATIVE, return {LocatedUri::Type::RELATIVE, suffix.data()};
suffix.data());
} }
if (kind == UriPluginKind::STORAGE && if (kind == UriPluginKind::STORAGE &&
...@@ -99,7 +97,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri ...@@ -99,7 +97,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
throw std::invalid_argument("Unsupported URI scheme"); throw std::invalid_argument("Unsupported URI scheme");
#endif #endif
return LocatedUri(LocatedUri::Type::ABSOLUTE, uri); return {LocatedUri::Type::ABSOLUTE, uri};
} }
LocatedUri LocatedUri
......
...@@ -60,7 +60,7 @@ CurlUnescape(CURL *curl, StringView src) noexcept ...@@ -60,7 +60,7 @@ CurlUnescape(CURL *curl, StringView src) noexcept
int outlength; int outlength;
CurlString tmp(curl_easy_unescape(curl, src.data, src.size, CurlString tmp(curl_easy_unescape(curl, src.data, src.size,
&outlength)); &outlength));
return std::string(tmp.c_str(), outlength); return {tmp.c_str(), size_t(outlength)};
} }
std::string std::string
......
...@@ -140,8 +140,7 @@ LibsampleratePcmResampler::Resample2(ConstBuffer<float> src) ...@@ -140,8 +140,7 @@ LibsampleratePcmResampler::Resample2(ConstBuffer<float> src)
throw FormatRuntimeError("libsamplerate has failed: %s", throw FormatRuntimeError("libsamplerate has failed: %s",
src_strerror(result)); src_strerror(result));
return ConstBuffer<float>(data.data_out, return {data.data_out, size_t(data.output_frames_gen * channels)};
data.output_frames_gen * channels);
} }
ConstBuffer<void> ConstBuffer<void>
......
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