Fixed clang errors

master
Yevgen Muntyan 2017-10-24 12:37:37 -07:00
parent ff983fb95f
commit f63758a005
6 changed files with 12 additions and 10 deletions

View File

@ -86,7 +86,7 @@ public:
return ObjectPtr(obj, ObjectMemPolicy::CopyReference);
}
ObjectPtr& operator=(nullptr_t)
ObjectPtr& operator=(std::nullptr_t)
{
reset();
return *this;
@ -127,7 +127,7 @@ public:
return m_p == nullptr;
}
bool operator==(const nullptr_t&) const
bool operator==(const std::nullptr_t&) const
{
return m_p == nullptr;
}

View File

@ -20,7 +20,7 @@ gstr::gstr()
{
}
gstr::gstr(nullptr_t)
gstr::gstr(std::nullptr_t)
: gstr()
{
}
@ -112,7 +112,7 @@ bool gstr::operator==(const char* other) const
return strcmp(get(), other ? other : "") == 0;
}
bool gstr::operator==(nullptr_t) const
bool gstr::operator==(std::nullptr_t) const
{
return empty();
}

View File

@ -30,7 +30,7 @@ class gstr
{
public:
gstr();
gstr(nullptr_t);
gstr(std::nullptr_t);
explicit gstr(const char* s);
gstr(char* s, bool);
~gstr();
@ -52,7 +52,7 @@ public:
bool operator==(const gstr& other) const;
bool operator==(const char* other) const;
bool operator==(nullptr_t) const;
bool operator==(std::nullptr_t) const;
template<typename T>
bool operator!=(const T& other) const

View File

@ -32,7 +32,7 @@ check_contents (const gstr& filename,
if (!g_file_get_contents (filename.get(), &contents, NULL, &error))
{
TEST_FAILED_MSG ("could not load file '%s': %s",
filename, error->message);
filename.get(), error->message);
g_error_free (error);
return;
}
@ -223,7 +223,7 @@ test_suite_init (G_GNUC_UNUSED gpointer data)
if (_moo_mkdir_with_parents (test_data.working_dir.get(), &err) != 0)
{
g_critical ("could not create directory '%s': %s",
test_data.working_dir,
test_data.working_dir.get(),
mgw_strerror (err));
test_data.working_dir.clear();
return FALSE;
@ -242,7 +242,7 @@ test_suite_cleanup (G_GNUC_UNUSED gpointer data)
if (!_moo_remove_dir (test_data.working_dir.get(), TRUE, &error))
{
g_critical ("could not remove directory '%s': %s",
test_data.working_dir, error->message);
test_data.working_dir.get(), error->message);
g_error_free (error);
error = NULL;
}

View File

@ -67,7 +67,7 @@ void moo_python_remove_path (const char *dir);
#define return_Int(v) return PyInt_FromLong (v)
#ifdef __cplusplus
const nullptr_t moo_nullptr = nullptr;
const std::nullptr_t moo_nullptr = nullptr;
#else
#define moo_nullptr NULL
#endif

View File

@ -1245,8 +1245,10 @@ _moo_glob_match_simple (const char *pattern,
if ((gl = _moo_glob_new (pattern)))
result = _moo_glob_match (gl, filename);
#if 0
if (result && 0)
_moo_message ("'%s' matched '%s'", filename, pattern);
#endif
_moo_glob_free (gl);
return result;