]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Output deprecated warning for --rezflags and permanently disable it.
[wxWidgets.git] / src / common / string.cpp
index 9e72b8aa59bad2fc791ba288391aa226f2eaf420..c2abb44c199f66bed3f20588f222ddae563a9827 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
 #include <string.h>
 #include <stdlib.h>
 
-#ifndef __WXMSW__
-#include <errno.h>
-#endif
-
 #ifdef __SALFORDC__
   #include <clib.h>
 #endif
 #ifdef __SALFORDC__
   #include <clib.h>
 #endif
@@ -365,8 +361,8 @@ bool wxStringBase::Alloc(size_t nLen)
     if ( pData->IsEmpty() ) {
       nLen += EXTRA_ALLOC;
 
     if ( pData->IsEmpty() ) {
       nLen += EXTRA_ALLOC;
 
-      wxStringData* pData = (wxStringData*)
-          malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar));
+      pData = (wxStringData *)
+                malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar));
 
       if ( pData == NULL ) {
         // allocation failure handled by caller
 
       if ( pData == NULL ) {
         // allocation failure handled by caller
@@ -1839,23 +1835,13 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
 
         // vsnprintf() may return either -1 (traditional Unix behaviour) or the
         // total number of characters which would have been written if the
 
         // vsnprintf() may return either -1 (traditional Unix behaviour) or the
         // total number of characters which would have been written if the
-        // buffer were large enough
+        // buffer were large enough (newer standards such as Unix98)
         if ( len >= 0 && len <= size )
         {
             // ok, there was enough space
             break;
         }
 
         if ( len >= 0 && len <= size )
         {
             // ok, there was enough space
             break;
         }
 
-#ifdef EOVERFLOW
-        // if the error is not due to not having enough space (it could be e.g.
-        // EILSEQ), break too -- we'd just eat all available memory uselessly
-        if ( errno != EOVERFLOW )
-        {
-            // no sense in continuing
-            break;
-        }
-#endif // EOVERFLOW
-
         // still not enough, double it again
         size *= 2;
     }
         // still not enough, double it again
         size *= 2;
     }
@@ -2497,7 +2483,11 @@ void wxArrayString::Sort(CompareFunction compareFunction)
   END_SORT();
 }
 
   END_SORT();
 }
 
-typedef  int (wxC_CALLING_CONV * wxStringCompareFn)(const void *first, const void *second);
+extern "C"
+{
+    typedef int (wxC_CALLING_CONV * wxStringCompareFn)(const void *first,
+                                                       const void *second);
+}
 
 void wxArrayString::Sort(CompareFunction2 compareFunction)
 {
 
 void wxArrayString::Sort(CompareFunction2 compareFunction)
 {