]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
remove warnings of intentionally unreachable code
[wxWidgets.git] / include / wx / string.h
index 07e7e86992f4aa4223eb9d1d9c58e52c63e15d23..83ca3c62ee4e0a9c1289c503e769c647c2e3e2b7 100644 (file)
@@ -200,8 +200,6 @@ public:
     const wchar_t* AsWChar() const;
     operator const wchar_t*() const { return AsWChar(); }
 
-    inline operator bool() const;
-
 #if !wxUSE_UNICODE
     inline
 #endif
@@ -1075,6 +1073,11 @@ public:
     operator const char*() const { return c_str(); }
     operator const wchar_t*() const { return c_str(); }
 
+    // implicit conversion to untyped pointer for compatibility with previous
+    // wxWidgets versions: this is the same as conversion to const char * so it
+    // may fail!
+    operator const void*() const { return c_str(); }
+
     // identical to c_str(), for MFC compatibility
     const wxCStrData GetData() const { return c_str(); }
 
@@ -1507,7 +1510,7 @@ public:
     //
     // get writable buffer of at least nLen bytes. Unget() *must* be called
     // a.s.a.p. to put string back in a reasonable state!
-  wxDEPRECATED( wxChar *GetWriteBuf(size_t nLen) );
+  wxDEPRECATED( wxStringCharType *GetWriteBuf(size_t nLen) );
     // call this immediately after GetWriteBuf() has been used
   wxDEPRECATED( void UngetWriteBuf() );
   wxDEPRECATED( void UngetWriteBuf(size_t nLen) );
@@ -2555,11 +2558,6 @@ inline wxCStrData::~wxCStrData()
         delete m_str;
 }
 
-inline wxCStrData::operator bool() const
-{
-    return !m_str->empty();
-}
-
 // simple cases for AsChar() and AsWChar(), the complicated ones are
 // in string.cpp
 #if wxUSE_UNICODE_WCHAR