util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare

New in clang 3.6.
This commit is contained in:
Max Kellermann
2014-12-26 13:40:17 +01:00
parent a5049136ff
commit 53f4044890
11 changed files with 52 additions and 0 deletions

View File

@@ -79,7 +79,10 @@ GetFSCharset()
std::string
PathToUTF8(const char *path_fs)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(path_fs != nullptr);
#endif
if (fs_charset.empty())
return std::string(path_fs);
@@ -109,7 +112,10 @@ PathToUTF8(const char *path_fs)
char *
PathFromUTF8(const char *path_utf8)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(path_utf8 != nullptr);
#endif
if (fs_charset.empty())
return g_strdup(path_utf8);

View File

@@ -25,7 +25,10 @@
const char *
PathTraits::GetBaseUTF8(const char *p)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
#endif
const char *slash = strrchr(p, SEPARATOR_UTF8);
return slash != nullptr
@@ -36,7 +39,10 @@ PathTraits::GetBaseUTF8(const char *p)
std::string
PathTraits::GetParentUTF8(const char *p)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
#endif
const char *slash = strrchr(p, SEPARATOR_UTF8);
return slash != nullptr