Make EquivalentEncodings 3-dimensional array const, moving 864 bytes from data segment (copy-on-write) to

.rodata segment (always guaranteed to be shared among processes) in wxBase.
Make said array as big as necessary, not bigger than necessary (as before) - shaving 122 bytes off of that 864
bytes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp
2006-04-04 23:01:57 +00:00
parent ac131bab11
commit 8ddbb13781

View File

@@ -374,11 +374,14 @@ wxString wxEncodingConverter::Convert(const wxString& input) const
#define STOP wxFONTENCODING_SYSTEM
#define NUM_OF_PLATFORMS 4 /*must conform to enum wxPLATFORM_XXXX !!!*/
#define ENC_PER_PLATFORM 5
#define ENC_PER_PLATFORM 3
// max no. of encodings for one language used on one platform
// Anybody thinks 5 is not enough? ;-)
static wxFontEncoding
// It is too much. Using maximum of everything at the current moment to not
// make the library larger than necessary. Make larger only if necessary - MR
static const wxFontEncoding
EquivalentEncodings[][NUM_OF_PLATFORMS][ENC_PER_PLATFORM+1] = {
// *** Please put more common encodings as first! ***
@@ -477,7 +480,7 @@ wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding e
}
int i, clas, e ;
wxFontEncoding *f;
const wxFontEncoding *f;
wxFontEncodingArray arr;
clas = 0;
@@ -504,7 +507,7 @@ wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding e
wxFontEncodingArray wxEncodingConverter::GetAllEquivalents(wxFontEncoding enc)
{
int i, clas, e, j ;
wxFontEncoding *f;
const wxFontEncoding *f;
wxFontEncodingArray arr;
arr = GetPlatformEquivalents(enc); // we want them to be first items in array