]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wxchar.cpp
conversion warning gcc 3.3 mac
[wxWidgets.git] / src / common / wxchar.cpp
index 06c69bd0cd0319719a899c40ca10bfd4883c1f97..edbe661e7572ec6be452d9dc82bc04bf04891c33 100644 (file)
@@ -599,7 +599,7 @@ int vfwprintf(FILE *stream, const wxChar *format, va_list argptr)
     if ( rc != -1 )
     {
         // we can't do much better without Unicode support in libc...
-        if ( fprintf(stream, "%s", s.mb_str()) == -1 )
+        if ( fprintf(stream, "%s", (const char*)s.mb_str() ) == -1 )
             return -1;
     }
 
@@ -752,7 +752,11 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
             // precision?
             if ( *format == _T('.') )
             {
-                SkipDigits(&format);
+                CopyFmtChar(*format++);
+                if ( *format == _T('*') )
+                    CopyFmtChar(*format++);
+                else
+                    SkipDigits(&format);
             }
 
             // next we can have a size modifier
@@ -799,23 +803,14 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
                 case _T('c'):
                 case _T('s'):
                     // %c -> %lc but %hc stays %hc and %lc is still %lc
-                    switch ( size )
-                    {
-                        case Default:
-                            InsertFmtChar(_T('l'));
-                            break;
-
-                        case Short:
-                            CopyFmtChar(_T('h'));
-                            break;
-
-                        case Long:
-                            ;
-                    }
+                    if ( size == Default)
+                        InsertFmtChar(_T('l'));
                     // fall through
 
                 default:
                     // nothing special to do
+                    if ( size != Default )
+                        CopyFmtChar(*(format - 1));
                     CopyFmtChar(*format++);
             }
         }
@@ -827,6 +822,14 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
     #define wxFormatConverter(x) (x)
 #endif // wxNEED_PRINTF_CONVERSION/!wxNEED_PRINTF_CONVERSION
 
+#ifdef __WXDEBUG__
+// For testing the format converter
+wxString wxConvertFormat(const wxChar *format)
+{
+    return wxString(wxFormatConverter(format));
+}
+#endif
+
 // ----------------------------------------------------------------------------
 // wxPrintf(), wxScanf() and relatives
 // ----------------------------------------------------------------------------