From 651548666aa3bb4129c3297c71db1051ed76a6bb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 5 Nov 2009 14:59:55 +0000 Subject: [PATCH] Change wxLongLongFmtSpec to be a non-wide string. As with other ANSI/Unicode unification changes, we choose to preserve compatibility with the existing code using wxLongLongFmtSpec in ANSI build and require people using it in Unicode build to change their code. Closes #11372. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 5 +++++ include/wx/defs.h | 18 +++++++++--------- include/wx/string.h | 6 ++---- samples/console/console.cpp | 2 +- src/generic/timer.cpp | 2 +- src/msw/debughlp.cpp | 2 +- src/propgrid/props.cpp | 16 ++++++++-------- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 6897d9d408..9891632fd5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -283,6 +283,11 @@ Changes in behaviour which may result in compilation errors presence of an element in the list only. If you used it as Find(), simple do use Find() instead. +- wxLongLongFmtSpec is now a normal and not wide string so you will need to + change expressions of the form wxT("%") wxLongLongFmtSpec wxT("x") to + just "%" wxLongLongFmtSpec "x", i.e. simply remove wxT() from the strings you + concatenate with it. + Deprecated methods and their replacements ----------------------------------------- diff --git a/include/wx/defs.h b/include/wx/defs.h index fd5449895b..1155806e24 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -978,28 +978,28 @@ typedef wxUint32 wxDword; #if (defined(__VISUALC__) && defined(__WIN32__)) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("I64") + #define wxLongLongFmtSpec "I64" #elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("L") + #define wxLongLongFmtSpec "L" #elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__))) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("L") + #define wxLongLongFmtSpec "L" #elif defined(__DIGITALMARS__) #define wxLongLong_t __int64 #define wxLongLongSuffix LL - #define wxLongLongFmtSpec wxT("ll") + #define wxLongLongFmtSpec "ll" #elif defined(__MINGW32__) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("I64") + #define wxLongLongFmtSpec "I64" #elif defined(__MWERKS__) #if __option(longlong) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") + #define wxLongLongFmtSpec "ll" #else #error "The 64 bit integer support in CodeWarrior has been disabled." #error "See the documentation on the 'longlong' pragma." @@ -1011,7 +1011,7 @@ typedef wxUint32 wxDword; #define wxLongLong_t long long #endif /* __WXPALMOS6__ */ #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") + #define wxLongLongFmtSpec "ll" #elif defined(__VISAGECPP__) && __IBMCPP__ >= 400 #define wxLongLong_t long long #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ @@ -1021,11 +1021,11 @@ typedef wxUint32 wxDword; (defined(__DJGPP__) && __DJGPP__ >= 2) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") + #define wxLongLongFmtSpec "ll" #elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #define wxLongLong_t long #define wxLongLongSuffix l - #define wxLongLongFmtSpec wxT("l") + #define wxLongLongFmtSpec "l" #define wxLongLongIsLong #endif diff --git a/include/wx/string.h b/include/wx/string.h index 9ab7f3f10a..517abb1185 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -2071,14 +2071,12 @@ public: // insert a long long if they exist and aren't longs wxString& operator<<(wxLongLong_t ll) { - const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("d"); - return (*this) << Format(fmt, ll); + return (*this) << Format("%" wxLongLongFmtSpec "d", ll); } // insert an unsigned long long wxString& operator<<(wxULongLong_t ull) { - const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("u"); - return (*this) << Format(fmt , ull); + return (*this) << Format("%" wxLongLongFmtSpec "u" , ull); } #endif // wxLongLong_t && !wxLongLongIsLong // insert a float into string diff --git a/samples/console/console.cpp b/samples/console/console.cpp index e62d060ea7..d043138193 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -1915,7 +1915,7 @@ I am ready for my first lesson today."); { wxChar buf[200]; - wxSprintf(buf, wxT("%07") wxLongLongFmtSpec wxT("o"), wxLL(040000000000)); + wxSprintf(buf, "%07" wxLongLongFmtSpec "o", wxLL(040000000000)); #if 0 // for some reason below line fails under Borland wxPrintf (wxT("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf); diff --git a/src/generic/timer.cpp b/src/generic/timer.cpp index 00713f32b2..cd39aaac34 100644 --- a/src/generic/timer.cpp +++ b/src/generic/timer.cpp @@ -74,7 +74,7 @@ typedef wxLongLong wxTimerTick_t; #if wxUSE_LONGLONG_WX - #define wxTimerTickFmtSpec wxLongLongFmtSpec wxT("d") + #define wxTimerTickFmtSpec wxLongLongFmtSpec "d" #define wxTimerTickPrintfArg(tt) (tt.GetValue()) #else // using native wxLongLong #define wxTimerTickFmtSpec wxT("s") diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index c0a0a560d9..f6aff5e53c 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -281,7 +281,7 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) } else // opaque 64 bit value { - s.Printf(wxT("%#" wxLongLongFmtSpec wxT("x")), *(PDWORD *)pAddress); + s.Printf("%#" wxLongLongFmtSpec "x", *(PDWORD *)pAddress); } } diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index ea01f9b7a2..b727fdb93d 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -359,14 +359,14 @@ static const wxChar* gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = { }; static const wxChar* gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = { - wxT("%") wxLongLongFmtSpec wxT("x"), - wxT("0x%") wxLongLongFmtSpec wxT("x"), - wxT("$%") wxLongLongFmtSpec wxT("x"), - wxT("%") wxLongLongFmtSpec wxT("X"), - wxT("0x%") wxLongLongFmtSpec wxT("X"), - wxT("$%") wxLongLongFmtSpec wxT("X"), - wxT("%") wxLongLongFmtSpec wxT("u"), - wxT("%") wxLongLongFmtSpec wxT("o") + "%" wxLongLongFmtSpec "x", + "0x%" wxLongLongFmtSpec "x", + "$%" wxLongLongFmtSpec "x", + "%" wxLongLongFmtSpec "X", + "0x%" wxLongLongFmtSpec "X", + "$%" wxLongLongFmtSpec "X", + "%" wxLongLongFmtSpec "u", + "%" wxLongLongFmtSpec "o" }; WX_PG_IMPLEMENT_PROPERTY_CLASS(wxUIntProperty,wxPGProperty, -- 2.47.2