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
This commit is contained in:
Vadim Zeitlin
2009-11-05 14:59:55 +00:00
parent 7b611a3ae9
commit 651548666a
7 changed files with 27 additions and 24 deletions

View File

@@ -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 presence of an element in the list only. If you used it as Find(), simple do
use Find() instead. 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 Deprecated methods and their replacements
----------------------------------------- -----------------------------------------

View File

@@ -978,28 +978,28 @@ typedef wxUint32 wxDword;
#if (defined(__VISUALC__) && defined(__WIN32__)) #if (defined(__VISUALC__) && defined(__WIN32__))
#define wxLongLong_t __int64 #define wxLongLong_t __int64
#define wxLongLongSuffix i64 #define wxLongLongSuffix i64
#define wxLongLongFmtSpec wxT("I64") #define wxLongLongFmtSpec "I64"
#elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520) #elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520)
#define wxLongLong_t __int64 #define wxLongLong_t __int64
#define wxLongLongSuffix i64 #define wxLongLongSuffix i64
#define wxLongLongFmtSpec wxT("L") #define wxLongLongFmtSpec "L"
#elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__))) #elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__)))
#define wxLongLong_t __int64 #define wxLongLong_t __int64
#define wxLongLongSuffix i64 #define wxLongLongSuffix i64
#define wxLongLongFmtSpec wxT("L") #define wxLongLongFmtSpec "L"
#elif defined(__DIGITALMARS__) #elif defined(__DIGITALMARS__)
#define wxLongLong_t __int64 #define wxLongLong_t __int64
#define wxLongLongSuffix LL #define wxLongLongSuffix LL
#define wxLongLongFmtSpec wxT("ll") #define wxLongLongFmtSpec "ll"
#elif defined(__MINGW32__) #elif defined(__MINGW32__)
#define wxLongLong_t long long #define wxLongLong_t long long
#define wxLongLongSuffix ll #define wxLongLongSuffix ll
#define wxLongLongFmtSpec wxT("I64") #define wxLongLongFmtSpec "I64"
#elif defined(__MWERKS__) #elif defined(__MWERKS__)
#if __option(longlong) #if __option(longlong)
#define wxLongLong_t long long #define wxLongLong_t long long
#define wxLongLongSuffix ll #define wxLongLongSuffix ll
#define wxLongLongFmtSpec wxT("ll") #define wxLongLongFmtSpec "ll"
#else #else
#error "The 64 bit integer support in CodeWarrior has been disabled." #error "The 64 bit integer support in CodeWarrior has been disabled."
#error "See the documentation on the 'longlong' pragma." #error "See the documentation on the 'longlong' pragma."
@@ -1011,7 +1011,7 @@ typedef wxUint32 wxDword;
#define wxLongLong_t long long #define wxLongLong_t long long
#endif /* __WXPALMOS6__ */ #endif /* __WXPALMOS6__ */
#define wxLongLongSuffix ll #define wxLongLongSuffix ll
#define wxLongLongFmtSpec wxT("ll") #define wxLongLongFmtSpec "ll"
#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400 #elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
#define wxLongLong_t long long #define wxLongLong_t long long
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
@@ -1021,11 +1021,11 @@ typedef wxUint32 wxDword;
(defined(__DJGPP__) && __DJGPP__ >= 2) (defined(__DJGPP__) && __DJGPP__ >= 2)
#define wxLongLong_t long long #define wxLongLong_t long long
#define wxLongLongSuffix ll #define wxLongLongSuffix ll
#define wxLongLongFmtSpec wxT("ll") #define wxLongLongFmtSpec "ll"
#elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
#define wxLongLong_t long #define wxLongLong_t long
#define wxLongLongSuffix l #define wxLongLongSuffix l
#define wxLongLongFmtSpec wxT("l") #define wxLongLongFmtSpec "l"
#define wxLongLongIsLong #define wxLongLongIsLong
#endif #endif

View File

@@ -2071,14 +2071,12 @@ public:
// insert a long long if they exist and aren't longs // insert a long long if they exist and aren't longs
wxString& operator<<(wxLongLong_t ll) wxString& operator<<(wxLongLong_t ll)
{ {
const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("d"); return (*this) << Format("%" wxLongLongFmtSpec "d", ll);
return (*this) << Format(fmt, ll);
} }
// insert an unsigned long long // insert an unsigned long long
wxString& operator<<(wxULongLong_t ull) wxString& operator<<(wxULongLong_t ull)
{ {
const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("u"); return (*this) << Format("%" wxLongLongFmtSpec "u" , ull);
return (*this) << Format(fmt , ull);
} }
#endif // wxLongLong_t && !wxLongLongIsLong #endif // wxLongLong_t && !wxLongLongIsLong
// insert a float into string // insert a float into string

View File

@@ -1915,7 +1915,7 @@ I am ready for my first lesson today.");
{ {
wxChar buf[200]; wxChar buf[200];
wxSprintf(buf, wxT("%07") wxLongLongFmtSpec wxT("o"), wxLL(040000000000)); wxSprintf(buf, "%07" wxLongLongFmtSpec "o", wxLL(040000000000));
#if 0 #if 0
// for some reason below line fails under Borland // for some reason below line fails under Borland
wxPrintf (wxT("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf); wxPrintf (wxT("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf);

View File

@@ -74,7 +74,7 @@
typedef wxLongLong wxTimerTick_t; typedef wxLongLong wxTimerTick_t;
#if wxUSE_LONGLONG_WX #if wxUSE_LONGLONG_WX
#define wxTimerTickFmtSpec wxLongLongFmtSpec wxT("d") #define wxTimerTickFmtSpec wxLongLongFmtSpec "d"
#define wxTimerTickPrintfArg(tt) (tt.GetValue()) #define wxTimerTickPrintfArg(tt) (tt.GetValue())
#else // using native wxLongLong #else // using native wxLongLong
#define wxTimerTickFmtSpec wxT("s") #define wxTimerTickFmtSpec wxT("s")

View File

@@ -281,7 +281,7 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress)
} }
else // opaque 64 bit value else // opaque 64 bit value
{ {
s.Printf(wxT("%#" wxLongLongFmtSpec wxT("x")), *(PDWORD *)pAddress); s.Printf("%#" wxLongLongFmtSpec "x", *(PDWORD *)pAddress);
} }
} }

View File

@@ -359,14 +359,14 @@ static const wxChar* gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = {
}; };
static const wxChar* gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = { static const wxChar* gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = {
wxT("%") wxLongLongFmtSpec wxT("x"), "%" wxLongLongFmtSpec "x",
wxT("0x%") wxLongLongFmtSpec wxT("x"), "0x%" wxLongLongFmtSpec "x",
wxT("$%") wxLongLongFmtSpec wxT("x"), "$%" wxLongLongFmtSpec "x",
wxT("%") wxLongLongFmtSpec wxT("X"), "%" wxLongLongFmtSpec "X",
wxT("0x%") wxLongLongFmtSpec wxT("X"), "0x%" wxLongLongFmtSpec "X",
wxT("$%") wxLongLongFmtSpec wxT("X"), "$%" wxLongLongFmtSpec "X",
wxT("%") wxLongLongFmtSpec wxT("u"), "%" wxLongLongFmtSpec "u",
wxT("%") wxLongLongFmtSpec wxT("o") "%" wxLongLongFmtSpec "o"
}; };
WX_PG_IMPLEMENT_PROPERTY_CLASS(wxUIntProperty,wxPGProperty, WX_PG_IMPLEMENT_PROPERTY_CLASS(wxUIntProperty,wxPGProperty,