diff options
-rw-r--r-- | lldb/include/lldb/Host/FileSpec.h | 3 | ||||
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lldb/include/lldb/Host/FileSpec.h b/lldb/include/lldb/Host/FileSpec.h index 473a0d39f1b..057b5a45dd9 100644 --- a/lldb/include/lldb/Host/FileSpec.h +++ b/lldb/include/lldb/Host/FileSpec.h @@ -180,8 +180,7 @@ public: /// A pointer to this object if either the directory or filename /// is valid, NULL otherwise. //------------------------------------------------------------------ - operator - void* () const; + operator bool() const; //------------------------------------------------------------------ /// Logical NOT operator. diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index ba9f9201fc4..8f398e05ada 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -352,10 +352,9 @@ FileSpec::SetFile (const char *pathname, bool resolve) // if (file_spec) // {} //---------------------------------------------------------------------- -FileSpec::operator -void*() const +FileSpec::operator bool() const { - return (m_directory || m_filename) ? const_cast<FileSpec*>(this) : NULL; + return m_filename || m_directory; } //---------------------------------------------------------------------- |