From cd1a22d1d32ddb1ed65c0443e8333d3d3e12ca81 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Wed, 5 Apr 2006 00:30:18 +0000 Subject: [PATCH] Support having const encoding tables. Modify generator code to regenerate as such. Can't simply regenerate src/common/unictabl.inc, because KOI8-U.TXT is missing, and mk_fallbacks has issues (sort +2 isn't valid on my system) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- misc/unictabl/mk_ctable.c | 2 +- misc/unictabl/mk_encodings.sh | 2 +- src/common/encconv.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/misc/unictabl/mk_ctable.c b/misc/unictabl/mk_ctable.c index 19b63326cc..9ee7418458 100644 --- a/misc/unictabl/mk_ctable.c +++ b/misc/unictabl/mk_ctable.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) " * %s to Unicode recoding table\n" " * based on file %s by Unicode Consortium\n" " */\n\n" - "static wxUint16 encoding_table__%s[128] = {", + "static const wxUint16 encoding_table__%s[128] = {", argv[2], argv[1], argv[2]); for (i = 128; i < 256; i++) diff --git a/misc/unictabl/mk_encodings.sh b/misc/unictabl/mk_encodings.sh index a7dc61a7ac..45d894953b 100755 --- a/misc/unictabl/mk_encodings.sh +++ b/misc/unictabl/mk_encodings.sh @@ -110,7 +110,7 @@ echo " static struct { wxFontEncoding encoding; // encoding identifier - wxUint16 *table; // 8bit to unicode table + const wxUint16 *table; // 8bit to unicode table } encodings_list[] = { " >> unictabl.inc diff --git a/src/common/encconv.cpp b/src/common/encconv.cpp index 9e06d0df43..f43d0687e4 100644 --- a/src/common/encconv.cpp +++ b/src/common/encconv.cpp @@ -50,7 +50,7 @@ #include "wx/msw/wince/missing.h" // for bsearch() #endif -static wxUint16* GetEncTable(wxFontEncoding enc) +static const wxUint16* GetEncTable(wxFontEncoding enc) { #ifdef __WXMAC__ if( enc >= wxFONTENCODING_MACMIN && enc <= wxFONTENCODING_MACMAX ) @@ -98,7 +98,7 @@ CompareCharsetItems(const void *i1, const void *i2) } -static CharsetItem* BuildReverseTable(wxUint16 *tbl) +static CharsetItem* BuildReverseTable(const wxUint16 *tbl) { CharsetItem *rev = new CharsetItem[128]; @@ -124,7 +124,8 @@ wxEncodingConverter::wxEncodingConverter() bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method) { unsigned i; - wxUint16 *in_tbl, *out_tbl = NULL; + const wxUint16 *in_tbl; + const wxUint16 *out_tbl = NULL; if (m_Table) {delete[] m_Table; m_Table = NULL;} -- 2.45.2