X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c663122e48dfd9eca0170b0e56541efc211c996..d3d0974f0f4ea623b5255db0b70b5e8374bf9d3f:/src/common/wxchar.cpp?ds=sidebyside diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 846e7d5058..be0dc8d53d 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -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 // ---------------------------------------------------------------------------- @@ -1389,7 +1392,7 @@ int isascii( int c ) } #endif -#if defined(__WXWINCE__) +#if defined(__WXWINCE__) && (_WIN32_WCE <= 211) #if (_WIN32_WCE < 300) void *calloc( size_t num, size_t size ) { @@ -1399,12 +1402,10 @@ void *calloc( size_t num, size_t size ) } #endif -#if (_WIN32_WCE <= 211) int isspace(int c) { return (c == ' '); } -#endif #endif