fixed 64but bug with g_strEmpty initialization
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -125,7 +125,7 @@ inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; }
|
|||||||
struct WXDLLEXPORT wxStringData
|
struct WXDLLEXPORT wxStringData
|
||||||
{
|
{
|
||||||
int nRefs; // reference count
|
int nRefs; // reference count
|
||||||
size_t nDataLength, // actual string length
|
size_t nDataLength, // actual string length
|
||||||
nAllocLength; // allocated memory size
|
nAllocLength; // allocated memory size
|
||||||
|
|
||||||
// mimics declaration 'char data[nAllocLength]'
|
// mimics declaration 'char data[nAllocLength]'
|
||||||
|
@@ -32,9 +32,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
#include <wx/intl.h>
|
#include "wx/intl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -62,13 +62,17 @@
|
|||||||
// static data
|
// static data
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// for an empty string, GetStringData() will return this address
|
// for an empty string, GetStringData() will return this address: this
|
||||||
static int g_strEmpty[] = { -1, // ref count (locked)
|
// structure has the same layout as wxStringData and it's data() method will
|
||||||
0, // current length
|
// return the empty string (dummy pointer)
|
||||||
0, // allocated memory
|
static const struct
|
||||||
0 }; // string data
|
{
|
||||||
|
wxStringData data;
|
||||||
|
char dummy;
|
||||||
|
} g_strEmpty = { {-1, 0, 0}, '\0' };
|
||||||
|
|
||||||
// empty C style string: points to 'string data' byte of g_strEmpty
|
// empty C style string: points to 'string data' byte of g_strEmpty
|
||||||
extern const char *g_szNul = (const char *)(&g_strEmpty[3]);
|
extern const char *g_szNul = &g_strEmpty.dummy;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global functions
|
// global functions
|
||||||
|
Reference in New Issue
Block a user