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

View File

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

View File

@ -30,7 +30,7 @@ class gstr
{ {
public: public:
gstr(); gstr();
gstr(nullptr_t); gstr(std::nullptr_t);
explicit gstr(const char* s); explicit gstr(const char* s);
gstr(char* s, bool); gstr(char* s, bool);
~gstr(); ~gstr();
@ -52,7 +52,7 @@ public:
bool operator==(const gstr& other) const; bool operator==(const gstr& other) const;
bool operator==(const char* other) const; bool operator==(const char* other) const;
bool operator==(nullptr_t) const; bool operator==(std::nullptr_t) const;
template<typename T> template<typename T>
bool operator!=(const T& other) const 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)) if (!g_file_get_contents (filename.get(), &contents, NULL, &error))
{ {
TEST_FAILED_MSG ("could not load file '%s': %s", TEST_FAILED_MSG ("could not load file '%s': %s",
filename, error->message); filename.get(), error->message);
g_error_free (error); g_error_free (error);
return; 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) if (_moo_mkdir_with_parents (test_data.working_dir.get(), &err) != 0)
{ {
g_critical ("could not create directory '%s': %s", g_critical ("could not create directory '%s': %s",
test_data.working_dir, test_data.working_dir.get(),
mgw_strerror (err)); mgw_strerror (err));
test_data.working_dir.clear(); test_data.working_dir.clear();
return FALSE; 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)) if (!_moo_remove_dir (test_data.working_dir.get(), TRUE, &error))
{ {
g_critical ("could not remove directory '%s': %s", 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); g_error_free (error);
error = NULL; error = NULL;
} }

View File

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

View File

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