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
This commit is contained in:
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
|
|||||||
" * %s to Unicode recoding table\n"
|
" * %s to Unicode recoding table\n"
|
||||||
" * based on file %s by Unicode Consortium\n"
|
" * based on file %s by Unicode Consortium\n"
|
||||||
" */\n\n"
|
" */\n\n"
|
||||||
"static wxUint16 encoding_table__%s[128] = {",
|
"static const wxUint16 encoding_table__%s[128] = {",
|
||||||
argv[2], argv[1], argv[2]);
|
argv[2], argv[1], argv[2]);
|
||||||
|
|
||||||
for (i = 128; i < 256; i++)
|
for (i = 128; i < 256; i++)
|
||||||
|
@@ -110,7 +110,7 @@ echo "
|
|||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
wxFontEncoding encoding; // encoding identifier
|
wxFontEncoding encoding; // encoding identifier
|
||||||
wxUint16 *table; // 8bit to unicode table
|
const wxUint16 *table; // 8bit to unicode table
|
||||||
} encodings_list[] = {
|
} encodings_list[] = {
|
||||||
" >> unictabl.inc
|
" >> unictabl.inc
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@
|
|||||||
#include "wx/msw/wince/missing.h" // for bsearch()
|
#include "wx/msw/wince/missing.h" // for bsearch()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static wxUint16* GetEncTable(wxFontEncoding enc)
|
static const wxUint16* GetEncTable(wxFontEncoding enc)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
if( enc >= wxFONTENCODING_MACMIN && enc <= wxFONTENCODING_MACMAX )
|
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];
|
CharsetItem *rev = new CharsetItem[128];
|
||||||
|
|
||||||
@@ -124,7 +124,8 @@ wxEncodingConverter::wxEncodingConverter()
|
|||||||
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
|
bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method)
|
||||||
{
|
{
|
||||||
unsigned i;
|
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;}
|
if (m_Table) {delete[] m_Table; m_Table = NULL;}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user