From: Mart Raudsepp Date: Tue, 4 Apr 2006 23:01:57 +0000 (+0000) Subject: Make EquivalentEncodings 3-dimensional array const, moving 864 bytes from data segmen... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8ddbb137813bb2452a833c735da951d43238b806?ds=sidebyside 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 --- diff --git a/src/common/encconv.cpp b/src/common/encconv.cpp index a44449dc0d..9e06d0df43 100644 --- a/src/common/encconv.cpp +++ b/src/common/encconv.cpp @@ -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