From f13f66487abad4b8b38f574d0df1789a85191747 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Apr 2020 16:14:26 +0200 Subject: [PATCH] fs/Charset: pass std::string_view to PathToUTF8() --- src/fs/Charset.cxx | 7 +------ src/fs/Charset.hxx | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx index 71cd96908..d1e1a7079 100644 --- a/src/fs/Charset.cxx +++ b/src/fs/Charset.cxx @@ -92,13 +92,8 @@ FixSeparators(const PathTraitsUTF8::string_view _s) } PathTraitsUTF8::string -PathToUTF8(PathTraitsFS::const_pointer path_fs) +PathToUTF8(PathTraitsFS::string_view path_fs) { -#if !CLANG_CHECK_VERSION(3,6) - /* disabled on clang due to -Wtautological-pointer-compare */ - assert(path_fs != nullptr); -#endif - #ifdef _WIN32 const auto buffer = WideCharToMultiByte(CP_UTF8, path_fs); return FixSeparators(buffer); diff --git a/src/fs/Charset.hxx b/src/fs/Charset.hxx index f387176f9..06c794e22 100644 --- a/src/fs/Charset.hxx +++ b/src/fs/Charset.hxx @@ -44,9 +44,8 @@ DeinitFSCharset() noexcept; * * Throws std::runtime_error on error. */ -gcc_nonnull_all PathTraitsUTF8::string -PathToUTF8(PathTraitsFS::const_pointer path_fs); +PathToUTF8(PathTraitsFS::string_view path_fs); /** * Convert the path from UTF-8.