]> git.saurik.com Git - wxWidgets.git/commitdiff
Support having const encoding tables. Modify generator code to regenerate as such.
authorMart Raudsepp <leio@gentoo.org>
Wed, 5 Apr 2006 00:30:18 +0000 (00:30 +0000)
committerMart Raudsepp <leio@gentoo.org>
Wed, 5 Apr 2006 00:30:18 +0000 (00:30 +0000)
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
misc/unictabl/mk_encodings.sh
src/common/encconv.cpp

index 19b63326cc7d2698d8416a70a26a62b935c61053..9ee74184587a61f351eeb57d839358a1c3c7698f 100644 (file)
@@ -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++)
index a7dc61a7acf09deb199250847fc7a7f33c56547d..45d894953b59af2954b5b38e33d3f01746b2bfce 100755 (executable)
@@ -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
 
index 9e06d0df43749e26441bdc1cb4187860e83a6cc9..f43d0687e4ff610bfe6d53ec20de10378bde3617 100644 (file)
@@ -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;}